This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
other:python:jyp_steps [2023/01/13 12:31] jypeter [NetCDF files: using cdms2, xarray and netCDF4] Added link to CliMAF and C-ESM-EP |
other:python:jyp_steps [2023/09/27 13:50] jypeter [Getting started] Added link to "100 numpy exercises" |
||
---|---|---|---|
Line 64: | Line 64: | ||
- Numpy Reference Guide | - Numpy Reference Guide | ||
- Scipy Reference Guide | - Scipy Reference Guide | ||
+ | - read [[https://github.com/rougier/numpy-100/blob/master/100_Numpy_exercises.ipynb|100 numpy exercises]] | ||
==== Beware of the array view side effects ==== | ==== Beware of the array view side effects ==== | ||
Line 133: | Line 134: | ||
* {{ :other:python:indirect_indexing_2.py.txt |}}: Take a vertical slice in a 3D zyx array, along a varying y 'path' | * {{ :other:python:indirect_indexing_2.py.txt |}}: Take a vertical slice in a 3D zyx array, along a varying y 'path' | ||
* [[https://numpy.org/doc/stable/user/basics.indexing.html|Array indexing basics (user guide)]] (//index arrays//, //boolean index arrays//, //np.newaxis//, //Ellipsis//, //variable numbers of indices//, ...) | * [[https://numpy.org/doc/stable/user/basics.indexing.html|Array indexing basics (user guide)]] (//index arrays//, //boolean index arrays//, //np.newaxis//, //Ellipsis//, //variable numbers of indices//, ...) | ||
- | * [[https://numpy.org/doc/stable/reference/arrays.indexing.html|Array indexing (reference manual)]] | + | * [[https://numpy.org/doc/stable/reference/arrays.indexing.html|Indexing routines (reference manual)]] |
* [[https://numpy.org/doc/stable/user/quickstart.html#advanced-indexing-and-index-tricks|Advanced indexing and index tricks]] and [[https://numpy.org/doc/stable/user/quickstart.html#the-ix-function|the ix_() function]] | * [[https://numpy.org/doc/stable/user/quickstart.html#advanced-indexing-and-index-tricks|Advanced indexing and index tricks]] and [[https://numpy.org/doc/stable/user/quickstart.html#the-ix-function|the ix_() function]] | ||
- | * [[https://numpy.org/doc/stable/reference/routines.indexing.html#routines-indexing|Indexing routines]] | ||
* More information about arrays: | * More information about arrays: | ||
* [[https://numpy.org/doc/stable/reference/routines.array-creation.html|Array creation routines]] | * [[https://numpy.org/doc/stable/reference/routines.array-creation.html|Array creation routines]] | ||
Line 156: | Line 156: | ||
</note> | </note> | ||
- | There is a good chance that your input array data will come from a file in the [[other:newppl:starting#netcdf_and_file_formats|NetCDF format]]. | + | * There is a good chance that your input array data will be stored in a [[other:newppl:starting#netcdf_and_related_conventions|NetCDF]] file. |
- | Depending on which [[other:python:starting#some_python_distributions|python distribution]] you are using, you can use the //cdms2//, //xarray// or //netCDF4// modules to read the data. | + | * There may be different ways of dealing with NetCDF files, depending on which [[other:python:starting#some_python_distributions|python distribution]] you have access to |
==== cdms2 ==== | ==== cdms2 ==== | ||
Line 173: | Line 173: | ||
Summary: [[http://xarray.pydata.org/en/stable/|xarray]] is an open source project and Python package that makes working with labelled multi-dimensional arrays simple, efficient, and fun! [...] It is particularly tailored to working with netCDF files | Summary: [[http://xarray.pydata.org/en/stable/|xarray]] is an open source project and Python package that makes working with labelled multi-dimensional arrays simple, efficient, and fun! [...] It is particularly tailored to working with netCDF files | ||
+ | |||
+ | === Some xarray related resources === | ||
+ | |||
+ | Note: more packages (than listed below) may be listed in the [[other:uvcdat:cdat_conda:cdat_8_2_1#extra_packages_list|Extra packages list]] | ||
+ | |||
+ | * [[https://xcdat.readthedocs.io/|xcdat]]: xarray extended with Climate Data Analysis Tools | ||
+ | |||
+ | * [[https://xoa.readthedocs.io/en/latest/|xoa]]: xarray-based ocean analysis library | ||
+ | |||
+ | * [[https://uxarray.readthedocs.io/|uxarray]]: provide xarray styled functionality for unstructured grid datasets following [[https://ugrid-conventions.github.io/ugrid-conventions/|UGRID Conventions]] | ||
+ | |||