-
Notifications
You must be signed in to change notification settings - Fork 168
Add FieldSet.from_copernicusmarine
#2230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add FieldSet.from_copernicusmarine
#2230
Conversation
FieldSet.from_copernicusmarine
b0307e6 to
019cb99
Compare
|
|
||
| ds = _rename_coords_copernicusmarine(ds) | ||
| grid = XGrid( | ||
| xgcm.Grid( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get a lot of warnings
/Users/erik/anaconda3/envs/parcels-v4/lib/python3.12/site-packages/xgcm/grid.py:196: DeprecationWarning: The `periodic` argument will be deprecated. To preserve previous behavior supply `boundary = 'periodic'.
Should we fix these here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get a lot of warnings
/Users/erik/anaconda3/envs/parcels-v4/lib/python3.12/site-packages/xgcm/grid.py:196: DeprecationWarning: The `periodic` argument will be deprecated. To preserve previous behavior supply `boundary = 'periodic'.Should we fix these here?
Investigating, but not sure how simple this is (might be upstream) - but merging for now so others can easily test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be upstream
Indeed upstream - we can't really get around the warnings xgcm/xgcm#678 .
|
Just realise: we should also add |
Test* is particular to pytest
6500d3a to
ace2806
Compare
I'll deal with this separately next. Merging for now so people can test with horizontal velocities |
Looks like the vertical velocities for this product here are stored in a different dataset ID with name "Vertical currents, *" - not sure if there are copernicus datasets that ship U V and W together. Either way, I'll add parsing for standard name >>> copernicusmarine.open_dataset('cmems_mod_glo_phy-cur_anfc_0.083deg_P1M-m')
INFO - 2025-09-25T10:57:20Z - Selected dataset version: "202406"
INFO - 2025-09-25T10:57:20Z - Selected dataset part: "default"
<xarray.Dataset> Size: 138GB
Dimensions: (depth: 50, latitude: 2041, longitude: 4320, time: 39)
Coordinates:
* depth (depth) float32 200B 0.494 1.541 2.646 ... 5.275e+03 5.728e+03
* latitude (latitude) float32 8kB -80.0 -79.92 -79.83 ... 89.83 89.92 90.0
* longitude (longitude) float32 17kB -180.0 -179.9 -179.8 ... 179.8 179.9
* time (time) datetime64[ns] 312B 2022-06-01 2022-07-01 ... 2025-08-01
Data variables:
uo (time, depth, latitude, longitude) float32 69GB dask.array<chunksize=(2, 50, 512, 2048), meta=np.ndarray>
vo (time, depth, latitude, longitude) float32 69GB dask.array<chunksize=(2, 50, 512, 2048), meta=np.ndarray>
Attributes:
Conventions: CF-1.6
references: http://marine.copernicus.eu
institution: Mercator Ocean
credit: E.U. Copernicus Marine Service Information (CMEMS)
source: MERCATOR GLO12
producer: CMEMS - Global Monitoring and Forecasting Centre
contact: servicedesk.cmems@mercator-ocean.eu
title: Monthly mean fields for product GLOBAL_ANALYSISFORECAST_PHY...
>>> copernicusmarine.open_dataset('cmems_mod_glo_phy-wcur_anfc_0.083deg_P1D-m')
INFO - 2025-09-25T10:58:47Z - Selected dataset version: "202406"
INFO - 2025-09-25T10:58:47Z - Selected dataset part: "default"
<xarray.Dataset> Size: 2TB
Dimensions: (depth: 50, latitude: 2041, longitude: 4320, time: 1222)
Coordinates:
* depth (depth) float32 200B 0.494 1.541 2.646 ... 5.275e+03 5.728e+03
* latitude (latitude) float32 8kB -80.0 -79.92 -79.83 ... 89.83 89.92 90.0
* longitude (longitude) float32 17kB -180.0 -179.9 -179.8 ... 179.8 179.9
* time (time) datetime64[ns] 10kB 2022-06-01 2022-06-02 ... 2025-10-04
Data variables:
wo (time, depth, latitude, longitude) float32 2TB dask.array<chunksize=(50, 2, 512, 2048), meta=np.ndarray>
Attributes:
Conventions: CF-1.8
references: http://marine.copernicus.eu
institution: Mercator Ocean International
credit: E.U. Copernicus Marine Service Information (CMEMS)
source: MOI GLO12
producer: CMEMS - Global Monitoring and Forecasting Centre
contact: https://marine.copernicus.eu/contact
title: daily mean fields from Global Ocean Physics Analysis and Fo...
>>> |
Also fixes #2222
Here I have only added testing on the FieldSet construction (not running any advection)