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

Update README.md

parent 589f9c08
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
# polarSectors
## Getting started
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
## Add your files
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
```
cd existing_repo
git remote add origin https://forge.uclouvain.be/BenjaminRichaud/polarsectors.git
git branch -M main
git push -uf origin main
```
## Integrate with your tools
- [ ] [Set up project integrations](https://forge.uclouvain.be/BenjaminRichaud/polarsectors/-/settings/integrations)
## Collaborate with your team
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## Test and Deploy
Use the built-in continuous integration in GitLab.
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
#Quick start
`ds_grouped = tbxsectors.groupby_sectors(ds_in, ref='RH')`
or
`ds_grouped = tbxsectors.groupby_sectors(ds_in, ref='NSIDC', target_gd='ORCA1_nh')`
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
Python toolbox to divide polar regions into sectors. Available definitions:
1. Arctic:
- Koenigk et al. (2016)
- Årthun et al. (2021)
- NSIDC mask (2023)
2. Antarctic:
- Zwally et al. (1983) (typical definition, used by e.g. Cavalieri & Parkinson 2008)
- Raphael & Hobbs (2014)
## Content
Source code `src`:
1. The toolbox `tbxsectors` contains 4 functions:
- `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.
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
## 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.
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 NISDC, 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_sector` 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.
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.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## 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.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
***
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## 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.
......
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