Skip to content

TCDSolar/STELLAR_SSW_tutorials

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

STELLAR Space Weather Workshop tutorials

This is a repository to hold the notebooks that will be used throughout the STELLAR Space Weather Workshop workshop

Each hands-on session is in its own directory - i.e. the day one hands on session is in day1_solar_sources etc.

Run in Binder

If you don't want to run these locally, or you are having issues with getting them started - all the notebooks in this repository can be run with binder. Click here Binder to launch binder and then run the notebooks in your browser: .

It may take a few minutes to load up the first time you launch it.

Run locally

Here are the steps you'll need to run:

1. Download the files using git

If you want to run these notebooks locally you can clone this reposity (or fork it and then clone it from your page). To do this run this command:

  • git clone https://github.com/TCDSolar/STELLAR_SSW_tutorials

If you have first forked it then you can run:

  • git clone https://github.com/<username>/STELLAR_SSW_tutorials

You can also download these notebooks by clicking on green code button on the top right hand side, and then by clicking download zip.

2. Create a conda environment

We recommend creating a new conda environment and install the requried packages used in these notebooks. Here is a nice introduction to anaconda environments for those new to the concept, and here is a conda cheatsheet which may help too!

The python packages required to run these workshop notebooks are listed in the environment.yml file in this repository. To create a new environment with these packages installed you can open a terminal and type:

  • conda env create -f environment.yml

This will then create a new conda environment called stellar_ssw (this name is listed in the enviroment.yml file).

You can then activate this environment by typing:

  • conda activate stellar_ssw

Note your prompt should change and now have stellar_sww near the start. If you want to list all your conda environments you can type conda info -e. You should see base which is your base enviroment, the stellar_ssw one, and any others you have created!

2.2 Updating the environment.yml file

If an update is made to the enviroment.yml file then you will need to type

  • conda env update --file environment.yml --prune

This may be important after you have down a git pull (see below 4.)

2.3 Installed new packages in this environment

You can also install new packages in this environment by using conda install <package>or by using pip! (pip install <package<)

3. Start a jupyter notebook!

Once you have your environment activated (remember to first type conda activate stellar_ssw) then in your local STELLAR_SSW repository type

  • jupyter notebook

This should then open the notebooks in your default browser!

If you are having any issues - just make sure first that you are in the stellar_ssw environment before you start jupyter.

Happy coding!!

4. Pulling the most up-to-date version

Throughout the workshop, these notebooks were updated and further notebooks were added. To make sure that your local repository reflects whats currently here you will need to run a git pull. This will pull the most up-to-date version of this repository. Before you do this however, you will want to check which remote you have linked to this repository. To find out this you can type this in your local STELLAR_SSW repository:

  • git remote -v

and this will list the current remotes It might looks something like this

origin	https://github.com/<username>/STELLAR_SSW_tutorials.git (fetch)
origin	https://github.com/<username>/STELLAR_SSW_tutorials.git (push)
upstream	https://github.com/TCDSolar/STELLAR_SSW_tutorials (fetch)
upstream	https://github.com/TCDSolar/STELLAR_SSW_tutorials (push)

what you will want to do is pull the main branch from the one that is linked to https://github.com/TCDSolar/STELLAR_SSW_tutorials - which in this example is upstream. Hence to pull the latest version of this repository you would type:

  • git pull upstream main

and this will update your local files.

Otherwise if when you typed git remote -v and it looks like

origin	https://github.com/TCDSolar/STELLAR_SSW_tutorials  (fetch)
origin	https://github.com/TCDSolar/STELLAR_SSW_tutorials  (push)

then you would type

  • git pull origin main

to update your local files.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published