From 76035d957852acb34b87cb3b9870752cd1e965e1 Mon Sep 17 00:00:00 2001 From: Benjamin Richaud <benjamin.richaud@uclouvain.be> Date: Wed, 22 May 2024 12:47:13 +0000 Subject: [PATCH] Update README.md --- README.md | 45 ++++++++++++++++----------------------------- 1 file changed, 16 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index ec42237..9149aeb 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,14 @@ # polarSectors -#Quick start -`ds_grouped = tbxsectors.groupby_sectors(ds_in, ref='RH')` +## Quick start + +```python +ds_grouped = tbxsectors.groupby_sectors(ds_in, ref='RH') +``` or -`ds_grouped = tbxsectors.groupby_sectors(ds_in, ref='NSIDC', target_gd='ORCA1_nh')` +```python +ds_grouped = tbxsectors.groupby_sectors(ds_in, ref='NSIDC', target_gd='ORCA1_nh') +``` ## Description Python toolbox to divide polar regions into sectors. Available definitions: @@ -21,11 +26,13 @@ Source code `src`: - `groupby_sectors`: the main function, which uses the `xarray.groupby` functionality (https://docs.xarray.dev/en/v2024.05.0/user-guide/groupby.html#groupby) to create the sectors. - `plot_sectormaps`: plots a figure of the available definition, to help the user to pick the most appropriate definition. - `define_sectors`: provides the latitude and longitude boundaries for each sector, for the hard-coded definitions; for NSIDC, provides the name of the sector associated with each flag in the mask. Mostly internal function. - - `interp_mask2grid`: interpolate the NSIDC mask onto the user grid, or load the regridder if already calculated. Only internal function, used in groupby_sectors. + - `interp_mask2grid`: interpolate the NSIDC mask onto the user grid, or load the interpolated mask if already calculated. Only internal function, used in groupby_sectors. 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 NSIDC mask for the Arctic region + - `NSIDC-0780_SeaIceRegions_PS-N3.125km_v1_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: @@ -42,30 +49,10 @@ The NSIDC definition is more complexe and doesn't follow meridians or parallels: 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. 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. -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. - -*** - +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. ## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. - -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. - -## Contributing -State if you are open to contributions and what your requirements are for accepting them. - -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. - -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. - -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. - -## License -For open source projects, say how it is licensed. +Please mention any bug or issue you might be encountering. Don't hesitate to request the implementation of new sector definitions as well. -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. +## Acknowledgment +Discussions with Annelies Sticker, François Massonnet, Thomas Bracegirdle and David Docquier helped to identify the most relevant sectorizations and to implement them. -- GitLab