Skip to content
Extraits de code Groupes Projets
Valider 35580029 rédigé par Benjamin Richaud's avatar Benjamin Richaud
Parcourir les fichiers

Update README.md

parent 2d2eb518
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -31,27 +31,27 @@ Source code `src`:
2. The notebook `test_tbxsectors.ipynb` provides an example of how to use the toolbox on a tutorial dataset.
Dataset in `data`:
- `NSIDC-0780_SeaIceRegions_PS-N3.125km_v1_wLatLon_df1.nc`: the original NSIDC mask for the Arctic region, at the 3.125km resolution.
- `NSIDCRegions_N3.125km_v1.1_wLatLon_df1.nc`: the original NSIDC mask for the Arctic region, at the 3.125km resolution.
- `NSIDCRegionsMask_ORCA025_nh.nc`: the interpolated NSIDC mask for the ORCA025 grid, when restrained to lat>50°N.
- `NSIDCRegionsMask_ORCA1_nh.nc`: the interpolated NSIDC mask for the ORCA1 grid, when restrained to lat>50°N.
## Installation and prerequisite
The module needs the following packages:
`xarray`, `numpy`, `matplotlib`, `cartopy`, `pathlib`, `pyproj`, `xesmf`.
The `pathlib`, `pyproj` and `xesmf` are only necessary for the 'NSIDC' definition.
`xarray`, `numpy`, `matplotlib`, `cartopy`, `pathlib`, `xesmf`.
The `xesmf` is only necessary for the 'NSIDC' definition.
For a quick use, only the `src/tbxsectors.py` file is necessary, but the NSIDC definition will not be available then.
For those wishing to use NSIDC, make sure `xesmf` is installed and download the `data/NSIDC-0780_SeaIceRegions_PS-N3.125km_v1_wLatLon_df1.nc` netCDF file containing the NSIDC mask. Set it in your current working directory, or provide the path and name of the file to the `groupby_sectors` function.
For those wishing to use NSIDC, make sure `xesmf` is installed and download the `data/NSIDCRegions_N3.125km_v1.1_wLatLon_df1.nc` netCDF file containing the NSIDC mask. Set it in your current working directory, or provide the path and name of the file to the `groupby_sectors` function.
## Further details
The Koenigk et al. (2016), Årthun et al. (2021), Zwally et al. (1983) and Raphael & Hobbs (2014) are all based on simple latitude and longitude values, so can be applied with pure pythonic functions and conditions to any grid.
The NSIDC definition is more complexe and doesn't follow meridians or parallels: it is based on a mask provided by the NSIDC (see https://nsidc.org/sites/default/files/documents/technical-reference/nsidc-special-report-25.pdf and https://nsidc.org/data/nsidc-0780/versions/1).
In order to apply this definition, the mask (provided here as `data/NSIDC-0780_SeaIceRegions_PS-N3.125km_v1_wLatLon_df1.nc`) needs to be interpolated onto the grid of the user data (hence the use of `xesmf` package), before it can be used.
In order to apply this definition, the mask (provided here as `data/NSIDCRegions_N3.125km_v1.1_wLatLon_df1.nc`) needs to be interpolated onto the grid of the user data (hence the use of `xesmf` package), before it can be used.
For ELIC users, `xesmf` is only installed on coriolis at the moment. Some workaround is implemented to still be able to use the module on cyclone, but the NSIDC definition is not (yet) available there.
## Tips
If the user uses the same input grid over and over again, a significant time gain would be provided by using the `interp_mask2grid` function, then saving the interpolated mask (use the `xr.Dataset.to_netcdf('path/filename.nc')`), and finally requesting this new interpolated mask when calling the `groupby_sectors` function.
If the user uses the same input grid over and over again, a significant time gain would be provided by using the `interp_mask2grid` function, then saving the interpolated mask (use the `xr.Dataset.to_netcdf('path/filename.nc')`), and finally requesting this new interpolated mask when calling the `groupby_sectors` function, by using the `target_gd='Path/to/file/filename.nc'` argument.
## Support
Please mention any bug or issue you might be encountering. Don't hesitate to request the implementation of new sector definitions as well.
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter