Skip to content

Support for MC-Toolkit meetings at IGE

Notifications You must be signed in to change notification settings

mmenegoz/MC-Toolkit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MC-Toolkit

The goal of this repository is to give support materials for the meetings at IGE about tools: MC-Toolkit (MC stand for Mardi-Café, Modelisation&Climate,... who knows?), in additions of a Slack channel.

Planning:

Here are some ideas of topics/tools to talk about:

  • xarray (+dask) / cdo / climaf (climatology)
  • How to compute climatologies (DJF, days in months, etc. what do you do?)
  • cartopy / ferret / basemap / proplot (plot)
  • regrid (cdo, basemap, scipy/stats, xESMF)
  • Jupiter Notebook / Anaconda
  • Computation centers (CIMENT, CICLAD, etc?)
  • Machine Learning
  • How to make a poster?
  • Statistics (how to compute trends, etc.?)
  • How to write an article / deal with bibliography? (latex, medeley, overleaf, etc.)
  • Linux basics (bash, commands)
  • How to get CMIP6 data? (website, CICLAD/CLIMAF)
  • Reanalyses / Observations
  • How to launch MAR / LMDZ / Elmer-ICE / NEMO
  • visit / FlowVR (Basile HECTOR)

The goal is to present a tool and exchange with others + know who to ask when we need help.

Recommended installation for xarray examples

  1. Main packages descriptions:
  • xarray: to open netCDF files and do way more....
  • dask: for parallelization
  • jupyter: for using jupyter-notebook
  • matplotlib: backend for making plots
  • cartopy: replace basemap, backend for map projections
  • proplot: new plot package that I find really promissing (try to have lastest version because it is evolving fast)
  • xesmf: for regridding
  1. Install Miniconda: (if you don't already have an installation of Anaconda/Miniconda -> Miniconda is lighter and allows to only install the packages that you need)

If you are on a cluster, try to install it on a different path than the default one (usually it takes some spaces and it is not recommander to have it in your home), otherwise make the default installation and put yes anytime it ask something.

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh 
sh Miniconda3-latest-Linux-x86_64.sh 
source ~/.bashrc  

You should have a (base) in front of your line in your terminal, that correspond to the root environment.

  1. Add conda-forge and update your installation (optionnal but I recommend):
conda config --add channels conda-forge  
conda config --set channel_priority strict  
conda update -n base -c defaults conda  
  1. Create an xarray environment:

It is recommanded not to use the root (base) environment so that you keep a clean installation (see the note at the end of the page). If you already have an Anaconda/Miniconda it doesn't mater and just make a new environment for the examples of this repository.

Download the spec-file.txt and use this command to create a new xarray environment (you put any other name if you want):

conda create -n xarray --file spec-file.txt
conda activate xarray

You can finish here. Then launch Jupyter-Notebook in a terminal with: jupyter-notebook

  1. (bis) If you wish to make a manual installation with updated packages (without the spec-file.txt):

Install xESMF first with esmpy before by itself (see this issue, may be not the case anymore for future versions):

conda create -n xarray  
conda activate xarray  
conda install esmpy  
conda install xesmf dask  

Test the xesmf environment:

pip install pytest  
pytest -v --pyargs xesmf  

If it doesn't work I advice you to install with the spec-file.txt (3. above) or give up for this package (it is for regridding). You can use CDO or another tool for regridding.

Then install other packages (xarray, pandas, numpy already isntalled from previous packages):

conda install jupyter psutil netcdf4 proplot cartopy matplotlib 

Usefull commands for Anaconda/Miniconda:

conda list --explicit > spec-file.txt  
conda create --name myenv --file spec-file.txt  
conda remove --name myenv --all  
conda info --envs 
  • Update environment:
conda update -n base -c defaults conda
conda update --all

About

Support for MC-Toolkit meetings at IGE

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 99.6%
  • Python 0.4%