|
5 | 5 | "id": "02a608e9-0fb1-4532-980e-ce860b421d58",
|
6 | 6 | "metadata": {},
|
7 | 7 | "source": [
|
8 |
| - "# Additional information with the `utils` module\n", |
9 |
| - "In the `utils` module, an `add_all_info` function add to your dataset all the information that HuracanPy may compute. Submodules allow for the computation of individual attributes." |
| 8 | + "# Additional information with the `info` module\n", |
| 9 | + "In the `info` module, an `add_all_info` function add to your dataset all the information that HuracanPy may compute. Submodules allow for the computation of individual attributes." |
10 | 10 | ]
|
11 | 11 | },
|
12 | 12 | {
|
|
35 | 35 | "outputs": [],
|
36 | 36 | "source": [
|
37 | 37 | "# Add info\n",
|
38 |
| - "data = huracanpy.utils.add_all_info(data, slp_units=\"Pa\")\n", |
| 38 | + "data = huracanpy.info.add_all_info(data)\n", |
39 | 39 | "\n",
|
40 | 40 | "list(data.keys()) # Available attributes"
|
41 | 41 | ]
|
|
55 | 55 | "metadata": {},
|
56 | 56 | "outputs": [],
|
57 | 57 | "source": [
|
58 |
| - "# hemisphere, can also be obtained with huracanpy.utils.geography.get_hemisphere\n", |
| 58 | + "# hemisphere, can also be obtained with huracanpy.info.get_hemisphere\n", |
59 | 59 | "huracanpy.plot.tracks(\n",
|
60 | 60 | " data.lon, data.lat, intensity_var=data.hemisphere, scatter_kws=dict(s=10)\n",
|
61 | 61 | ")"
|
|
68 | 68 | "metadata": {},
|
69 | 69 | "outputs": [],
|
70 | 70 | "source": [
|
71 |
| - "# basin, can also be obtained with huracanpy.utils.geography.get_basin (NB: Several convention available)\n", |
| 71 | + "# basin, can also be obtained with huracanpy.info.get_basin (NB: Several convention available)\n", |
72 | 72 | "huracanpy.plot.tracks(\n",
|
73 | 73 | " data.lon, data.lat, intensity_var=data.basin, scatter_kws=dict(s=10)\n",
|
74 | 74 | ")"
|
|
81 | 81 | "metadata": {},
|
82 | 82 | "outputs": [],
|
83 | 83 | "source": [
|
84 |
| - "# is_ocean, can also be obtained with huracanpy.utils.geography.get_is_ocean\n", |
| 84 | + "# is_ocean, can also be obtained with huracanpy.info.get_is_ocean\n", |
85 | 85 | "huracanpy.plot.tracks(\n",
|
86 | 86 | " data.lon, data.lat, intensity_var=data.is_ocean, scatter_kws=dict(s=10)\n",
|
87 | 87 | ")"
|
|
100 | 100 | },
|
101 | 101 | "outputs": [],
|
102 | 102 | "source": [
|
103 |
| - "# country, can also be obtained with huracanpy.utils.geography.get_country\n", |
| 103 | + "# country, can also be obtained with huracanpy.info.get_country\n", |
104 | 104 | "data_ = data.isel(record=slice(0, 60))\n",
|
105 | 105 | "huracanpy.plot.tracks(\n",
|
106 | 106 | " data_.lon, data_.lat, intensity_var=data_.country, scatter_kws=dict(s=10)\n",
|
|
114 | 114 | "metadata": {},
|
115 | 115 | "outputs": [],
|
116 | 116 | "source": [
|
117 |
| - "# continent, can also be obtained with huracanpy.utils.geography.get_country\n", |
| 117 | + "# continent, can also be obtained with huracanpy.info.get_country\n", |
118 | 118 | "huracanpy.plot.tracks(\n",
|
119 | 119 | " data.lon, data.lat, intensity_var=data.continent, scatter_kws=dict(s=10)\n",
|
120 | 120 | ")"
|
|
135 | 135 | "metadata": {},
|
136 | 136 | "outputs": [],
|
137 | 137 | "source": [
|
138 |
| - "# Season. Can also be obtained with huracanpy.utils.time.get_season\n", |
| 138 | + "# Season. Can also be obtained with huracanpy.info.get_season\n", |
139 | 139 | "sns.scatterplot(data=data, x=\"time\", y=\"hemisphere\", hue=\"season\")"
|
140 | 140 | ]
|
141 | 141 | },
|
|
144 | 144 | "id": "e2753aa6-1e8a-478f-bef5-08701ec29ad0",
|
145 | 145 | "metadata": {},
|
146 | 146 | "source": [
|
147 |
| - "# Categories" |
| 147 | + "# Categories\n", |
| 148 | + "\n", |
| 149 | + "Categories are specific to tropical cyclones and can be found in the `huracanpy.tc` module\n", |
| 150 | + "A more generic function is available in `huracanpy.info.get_category`" |
148 | 151 | ]
|
149 | 152 | },
|
150 | 153 | {
|
|
154 | 157 | "metadata": {},
|
155 | 158 | "outputs": [],
|
156 | 159 | "source": [
|
157 |
| - "# sshs, can also be obtained with huracanpy.utils.category.get_sshs_cat\n", |
| 160 | + "# sshs, can also be obtained with huracanpy.tc.get_sshs_cat\n", |
| 161 | + "sshs = huracanpy.tc.get_sshs_cat(data.wind10)\n", |
158 | 162 | "huracanpy.plot.tracks(\n",
|
159 | 163 | " data.lon,\n",
|
160 | 164 | " data.lat,\n",
|
161 |
| - " intensity_var=data.sshs,\n", |
| 165 | + " intensity_var=sshs,\n", |
162 | 166 | " scatter_kws=dict(s=5, palette=\"Spectral\"),\n",
|
163 | 167 | ")"
|
164 | 168 | ]
|
|
170 | 174 | "metadata": {},
|
171 | 175 | "outputs": [],
|
172 | 176 | "source": [
|
173 |
| - "# pressure category, can also be obtained with huracanpy.utils.category.get_pres_cat\n", |
| 177 | + "# pressure category, can also be obtained with huracanpy.tc.get_pres_cat\n", |
| 178 | + "pres_cat = huracanpy.tc.get_pressure_cat(data.slp)\n", |
174 | 179 | "huracanpy.plot.tracks(\n",
|
175 | 180 | " data.lon,\n",
|
176 | 181 | " data.lat,\n",
|
177 |
| - " intensity_var=data.pres_cat,\n", |
| 182 | + " intensity_var=pres_cat,\n", |
178 | 183 | " scatter_kws=dict(s=5, palette=\"Spectral\"),\n",
|
179 | 184 | ")"
|
180 | 185 | ]
|
|
0 commit comments