- This is alpha level software under development.
- Please contact Ken Mankoff <kdm@geus.dk> before using.
pip install git+https://gitlab.com/mankoff/PROMICE.git
Can be run in new environment, for example:
Conda:
conda create -n PROMICE python=3.8
conda activate PROMICE
pip install --upgrade git+https://gitlab.com/mankoff/PROMICE.git
Test the installation
conda activate PROMICE
python
Then,
import promice
promice.ice_discharge.discharge(resolution="GIS").to_dataframe().tail()
time | discharge | err | coverage |
2020-06-11 | 508.739014 | 52.574001 | 0.805 |
2020-06-23 | 509.875000 | 52.702000 | 0.718 |
2020-07-05 | 509.695007 | 52.209000 | 0.668 |
2020-07-17 | 506.665985 | 51.771999 | 0.713 |
2020-07-29 | 502.263000 | 51.325001 | 0.714 |
from promice import ice_discharge as ice
ds = ice.discharge(resolution="GIS")
ds.to_dataframe().tail()
time | discharge | err | coverage |
---|---|---|---|
2020-06-11 00:00:00 | 508.739 | 52.574 | 0.805 |
2020-06-23 00:00:00 | 509.875 | 52.702 | 0.718 |
2020-07-05 00:00:00 | 509.695 | 52.209 | 0.668 |
2020-07-17 00:00:00 | 506.666 | 51.772 | 0.713 |
2020-07-29 00:00:00 | 502.263 | 51.325 | 0.714 |
Load an xarray
dataset of all discharge
from promice import ice_discharge as ice
ds = ice.discharge(resolution="gate")
print(ds)
<xarray.Dataset> Dimensions: (gate: 267, time: 449) Coordinates: * time (time) datetime64[ns] 1986-04-15 1986-05-15 ... 2020-07-29 * gate (gate) int64 1 3 4 5 6 7 8 10 ... 350 352 353 354 355 356 357 Data variables: discharge (gate, time) float32 ... err (gate, time) float32 ... coverage (gate, time) float32 ... mean_x (gate) int32 ... mean_y (gate) int32 ... mean_lon (gate) float32 ... mean_lat (gate) float32 ... sector (gate) int32 ... region (gate) object ... name_Bjørk (gate) object ... name_Mouginot (gate) object ... Attributes: featureType: timeSeries title: Greenland discharge summary: Greenland discharge per gate keywords: Greenland; Ice Discharge; Calving; Submarine Melt source: git commit: b4f3e88 creator_name: Ken Mankoff creator_email: kdm@geus.dk creator_url: http://kenmankoff.com institution: GEUS references: 10.22008/promice/ice_discharge product_version: [2.]
top3 = ds.resample(time='A')\
.mean()['discharge']\
.to_dataframe()['discharge']\
.unstack()\
.iloc[-1]\
.sort_values(ascending=False)[0:3]
top3
gate 184 34.403828 231 33.083332 190 27.318832 Name: 2020-12-31 00:00:00, dtype: float32
df_3 = ds.sel(gate=top3.index)\
.to_dataframe()['discharge']\
.unstack()\
.T
df_3.head()
time | 184 | 190 | 231 |
---|---|---|---|
1986-04-15 00:00:00 | 23.174 | 15.267 | 29.657 |
1986-05-15 00:00:00 | 30.07 | 15.883 | 33.243 |
1986-06-15 00:00:00 | 30.006 | 16.714 | 31.41 |
1986-07-15 00:00:00 | 29.944 | 16.85 | 33.052 |
1986-08-15 00:00:00 | 29.88 | 16.148 | 31.726 |
- Convert the gate ID to named glacier
- Subset to just 2020
- Monthly average
df_3.rename(inplace=True, columns=dict([(i, str(ds.sel({'gate':i})['name_Bjørk'].values)) for i in df_3.columns]))
df_3[df_3.index.year >= 2020].resample('M').mean()
time | Sermeq Kujalleq | Kangerlussuaq Gletsjer | Helheim Gletsjer |
---|---|---|---|
2020-01-31 00:00:00 | 32.6853 | 27.941 | 35.2233 |
2020-02-29 00:00:00 | 31.465 | 27.523 | 35.2225 |
2020-03-31 00:00:00 | 31.1303 | 27.3773 | 34.3623 |
2020-04-30 00:00:00 | 31.8335 | 28.2875 | 34.657 |
2020-05-31 00:00:00 | 34.5737 | 27.0317 | 31.8193 |
2020-06-30 00:00:00 | 39.9095 | 26.9235 | 30.3435 |
2020-07-31 00:00:00 | 39.2283 | 26.407 | 30.2797 |
from promice import watson
df = watson.discharge()
df['2012-06-01':].head(3)
Date | Q | err |
---|---|---|
2012-06-01 00:00:00 | 0.17 | 0.04 |
2012-06-02 00:00:00 | 0.21 | 0.05 |
2012-06-03 00:00:00 | 0.26 | 0.06 |