|
24 | 24 | "cell_type": "markdown", |
25 | 25 | "metadata": {}, |
26 | 26 | "source": [ |
27 | | - "This file will become your README and also the index of your documentation." |
| 27 | + "Here we are developing functions and code for the Madagascar ERA5 dataset project. The goal is for exposure data to be made available at the daily resolution when possible. Finer resolutions shouldn’t ever be needed for our purposes, and it should then be relatively easy to aggregate at coarser resolutions, such as weekly or monthly.\n", |
| 28 | + "\n", |
| 29 | + "Variables should generally be made available from 2010 onward, as that’s where our clinic data starts.\n", |
| 30 | + "\n", |
| 31 | + "All data are ideally made available at the “healthshed” geographical level. Healthsheds are defined as geographical areas where people who live all go to the same clinic. There are a total of ~2700 public clinics in Madagascar, hence ~2700 healthsheds, with each healthshed containing ~10000 people on average.\n", |
| 32 | + "\n", |
| 33 | + "Preliminary list of environmental variables\n", |
| 34 | + "\n", |
| 35 | + "- [ ] 2-m air temperature from ERA5: daily min, max, mean\n", |
| 36 | + " \n", |
| 37 | + "- [ ] 2-m air dew point temperature from ERA5: daily min, max, mean\n", |
| 38 | + "\n", |
| 39 | + "- [ ] Precipitation: daily total (ERA5)\n", |
| 40 | + "\n", |
| 41 | + "- [ ] Sea surface temperature: daily average and maximum in the nearest neighbor for each healthshed.\n", |
| 42 | + "\n", |
| 43 | + "- [ ] Precipitation: daily total (CHIRPS)\n", |
| 44 | + "\n", |
| 45 | + "- [ ] Chlorophyll-A (Giacomo)\n", |
| 46 | + "\n", |
| 47 | + "- [ ] Wealth index: Available from Giacomo \n", |
| 48 | + "\n", |
| 49 | + "- [ ] NDVI\n", |
| 50 | + "\n", |
| 51 | + "- [ ] Tropical storm\n", |
| 52 | + "\n", |
| 53 | + "- [ ] Flooding\n", |
| 54 | + "\n", |
| 55 | + "- [ ] Deforestation\n", |
| 56 | + "\n", |
| 57 | + "- [ ] Linking/segmenting healthsheds into climate zones and other \n", |
| 58 | + "\n", |
| 59 | + "- [ ] Relative humidity: daily average (lower priority)" |
28 | 60 | ] |
29 | 61 | }, |
30 | 62 | { |
|
56 | 88 | "# make sure era5_sandbox package is installed in development mode\n", |
57 | 89 | "$ pip install -e .\n", |
58 | 90 | "\n", |
59 | | - "# make changes under nbs/ directory\n", |
60 | | - "# ...\n", |
| 91 | + "# To make changes, go to the \"notes\" directory and edit the notebooks as necessary.\n", |
| 92 | + "# Each notebook refers to a module in the era5_sandbox package. Cells are exported to the module\n", |
| 93 | + "# when the notebook is saved and you run the following command:\n", |
61 | 94 | "\n", |
62 | | - "# compile to have changes apply to era5_sandbox\n", |
63 | | - "$ nbdev_prepare\n", |
64 | | - "```" |
| 95 | + "$ nbdev_export\n", |
| 96 | + "```\n", |
| 97 | + "\n", |
| 98 | + "For e.g., to change functionality of the [`testAPI()`](https://TinasheMTapera.github.io/era5_sandbox/core.html#testapi) function in the testAPI Hydra rule, you would edit the [`testAPI`](https://TinasheMTapera.github.io/era5_sandbox/core.html#testapi) notebook in the `notes` directory `notes/testAPI.ipynb`, and then save that notebook and run `nbdev_export` to update the `core` module in the package." |
65 | 99 | ] |
66 | 100 | }, |
67 | 101 | { |
|
85 | 119 | "Install latest from the GitHub [repository][repo]:\n", |
86 | 120 | "\n", |
87 | 121 | "```sh\n", |
88 | | - "$ pip install git+https://github.com/TinasheMTapera/era5_sandbox.git\n", |
89 | | - "```\n", |
90 | | - "\n", |
91 | | - "or from [conda][conda]\n", |
92 | | - "\n", |
93 | | - "```sh\n", |
94 | | - "$ conda install -c TinasheMTapera era5_sandbox\n", |
| 122 | + "$ pip install git+https://github.com/NSAPH-Data-Processing/era5_sandbox\n", |
95 | 123 | "```\n", |
96 | 124 | "\n", |
97 | | - "or from [pypi][pypi]\n", |
98 | | - "\n", |
| 125 | + "or clone and install in development mode:\n", |
99 | 126 | "\n", |
100 | 127 | "```sh\n", |
101 | | - "$ pip install era5_sandbox\n", |
| 128 | + "$ git clone https://github.com/NSAPH-Data-Processing/era5_sandbox\n", |
| 129 | + "$ pip install -e .\n", |
102 | 130 | "```\n", |
103 | 131 | "\n", |
104 | 132 | "\n", |
105 | | - "[repo]: https://github.com/TinasheMTapera/era5_sandbox\n", |
106 | | - "[docs]: https://TinasheMTapera.github.io/era5_sandbox/\n", |
107 | | - "[pypi]: https://pypi.org/project/era5_sandbox/\n", |
108 | | - "[conda]: https://anaconda.org/TinasheMTapera/era5_sandbox" |
| 133 | + "[repo]: https://github.com/NSAPH-Data-Processing/era5_sandbox" |
109 | 134 | ] |
110 | 135 | }, |
111 | 136 | { |
|
119 | 144 | "cell_type": "markdown", |
120 | 145 | "metadata": {}, |
121 | 146 | "source": [ |
122 | | - "Documentation can be found hosted on this GitHub [repository][repo]'s [pages][docs]. Additionally you can find package manager specific guidelines on [conda][conda] and [pypi][pypi] respectively.\n", |
123 | | - "\n", |
124 | | - "[repo]: https://github.com/TinasheMTapera/era5_sandbox\n", |
125 | | - "[docs]: https://TinasheMTapera.github.io/era5_sandbox/\n", |
126 | | - "[pypi]: https://pypi.org/project/era5_sandbox/\n", |
127 | | - "[conda]: https://anaconda.org/TinasheMTapera/era5_sandbox" |
| 147 | + "🚧Documentation is in development 🚧" |
128 | 148 | ] |
129 | 149 | }, |
130 | 150 | { |
|
138 | 158 | "cell_type": "markdown", |
139 | 159 | "metadata": {}, |
140 | 160 | "source": [ |
141 | | - "Fill me in please! Don't forget code examples:" |
| 161 | + "The pipeline currently downloads ERA5 temperature and dew point temperature data for a given date range and geographical bounding box. You can learn each of these steps by following the notebooks in `notes` in numerical order.\n", |
| 162 | + "\n", |
| 163 | + "To run the pipeline, the config at `config/config.yaml` should be updated with the desired date range and geographical bounding box. The pipeline can then be run with the following command:\n", |
| 164 | + "\n", |
| 165 | + "```sh\n", |
| 166 | + "sbatch snakemake.sbatch\n", |
| 167 | + "```\n", |
| 168 | + "\n", |
| 169 | + "You can investigate the downloaded raw data with python, eg.:\n", |
| 170 | + "\n", |
| 171 | + "```python\n", |
| 172 | + "import xarray as xr\n", |
| 173 | + "import matplotlib.pyplot as plt\n", |
| 174 | + "import cartopy.crs as ccrs\n", |
| 175 | + "import cartopy.feature as cfeature\n", |
| 176 | + "\n", |
| 177 | + "### the path to any of the downloaded files\n", |
| 178 | + "file_path = \"/n/dominici_lab/lab/data_processing/csph-era5_sandbox/data/input/2010_01.nc\"\n", |
| 179 | + "data = xr.open_dataset(file_path)\n", |
| 180 | + "\n", |
| 181 | + "\n", |
| 182 | + "temperature = data[\"t2m\"]\n", |
| 183 | + "\n", |
| 184 | + "\n", |
| 185 | + "\n", |
| 186 | + "# Select a specific time step\n", |
| 187 | + "temperature_at_time = temperature.isel(valid_time=0)\n", |
| 188 | + "\n", |
| 189 | + "# Plot the data on a map\n", |
| 190 | + "plt.figure(figsize=(12, 8))\n", |
| 191 | + "ax = plt.axes(projection=ccrs.PlateCarree())\n", |
| 192 | + "temperature_at_time.plot(ax=ax, cmap=\"coolwarm\", transform=ccrs.PlateCarree(), cbar_kwargs={\"label\": \"Temperature (K)\"})\n", |
| 193 | + "ax.coastlines()\n", |
| 194 | + "ax.add_feature(cfeature.BORDERS, linestyle=\":\")\n", |
| 195 | + "ax.set_title(\"Temperature at Time Step 0\")\n", |
| 196 | + "plt.show()\n", |
| 197 | + "```" |
142 | 198 | ] |
143 | 199 | }, |
144 | 200 | { |
|
175 | 231 | ], |
176 | 232 | "metadata": { |
177 | 233 | "kernelspec": { |
178 | | - "display_name": "Python 3 (ipykernel)", |
| 234 | + "display_name": "python3", |
179 | 235 | "language": "python", |
180 | 236 | "name": "python3" |
181 | | - }, |
182 | | - "language_info": { |
183 | | - "codemirror_mode": { |
184 | | - "name": "ipython", |
185 | | - "version": 3 |
186 | | - }, |
187 | | - "file_extension": ".py", |
188 | | - "mimetype": "text/x-python", |
189 | | - "name": "python", |
190 | | - "nbconvert_exporter": "python", |
191 | | - "pygments_lexer": "ipython3", |
192 | | - "version": "3.11.8" |
193 | | - }, |
194 | | - "widgets": { |
195 | | - "application/vnd.jupyter.widget-state+json": { |
196 | | - "state": {}, |
197 | | - "version_major": 2, |
198 | | - "version_minor": 0 |
199 | | - } |
200 | 237 | } |
201 | 238 | }, |
202 | 239 | "nbformat": 4, |
|
0 commit comments