-
Notifications
You must be signed in to change notification settings - Fork 15
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
Improvements in copernicus-marine-client related code #694
Comments
@veenstrajelmer w/r on:
It is not clear what you would expect from the toolbox with the For your use case, it seems that you could simply retrieve the first and last values of the time coordinate of the dataset of your interest and check it against your desired date values. FYI, we have introduced a import copernicus_marine_client as copernicusmarine
copernicusmarine.subset(
dataset_id="cmems_mod_glo_phy-cur_anfc_0.083deg_PT6H-i",
start_datetime="1921-01-01",
end_datetime="1921-01-02",
subset_method='strict'
)
INFO - 2023-12-19T05:11:38Z - Selected dataset version is "202211"
---------------------------------------------------------------------------
CoordinatesOutOfDatasetBounds Traceback (most recent call last)
[...] Anyhow, based on xarray behavior, slicing over time with the reported values would create the following dataset using import xarray
from copernicusmarine.future import store
dataset = xarray.open_dataset(store.model.global.sea_water_velocity.hourly.instantaneous)
dataset.sel(time=slice("1921-01-01", "1921-01-02"))
<xarray.Dataset>
Dimensions: (elevation: 50, latitude: 2041, longitude: 4320, time: 0)
Coordinates:
* elevation (elevation) float32 -5.728e+03 -5.275e+03 ... -1.541 -0.494
* latitude (latitude) float32 -80.0 -79.92 -79.83 ... 89.83 89.92 90.0
* longitude (longitude) float32 -180.0 -179.9 -179.8 ... 179.8 179.8 179.9
* time (time) datetime64[ns]
Data variables:
uo (time, elevation, latitude, longitude) float32 ...
vo (time, elevation, latitude, longitude) float32 ...
Attributes: (12/13)
Conventions: CF-1.6
area: GLOBAL
contact: servicedesk.cmems@mercator-ocean.eu
credit: E.U. Copernicus Marine Service Information...
institution: Mercator Ocean
licence: http://marine.copernicus.eu/services-portf...
... ...
product: GLOBAL_ANALYSISFORECAST_PHY_001_024
product_user_manual: http://marine.copernicus.eu/documents/PUM/...
quality_information_document: http://marine.copernicus.eu/documents/QUID...
references: http://marine.copernicus.eu
source: MERCATOR GLO12
title: Instantaneous fields for product GLOBAL_AN... Is it what you expected? many thanks in advance for your feedback 🙏 |
Follow up todo's from #630:
no_metadata_cache
orremove_metadata_cache
needed? >> probably notcmc.open_dataset(dataset_id="cmems_mod_glo_phy-cur_anfc_0.083deg_PT6H-i", start_datetime="1921-01-01", end_datetime="1921-01-02")
returns dataset with timestamp2020-11-01
>> report at helpdesk. We do a bit of time range checking ourselves indfmt.copernicusmarine_get_product()
, but is not called with custom dataset_id. >> fixed in 0.10.3dfmt.download_CMEMS
results in empty files #720copernicusmarine_get_dataset_id
, maybe get dataset_id from'copernicus-marine describe --include-datasets --contains <search_token>'
or (once) make global lists of varnames in different datasets (combine with retrieving tstart/tstop). >> wont doThe text was updated successfully, but these errors were encountered: