You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update to https://pypi.org/project/copernicus-marine-client/ instead of opendap (requires py>=3.9), now in open beta, but goes into service in Q1 2024. Shutdown of legacy services (like opendap) is planned in March 2024, but some opendap datasets are already deprecated from 30 November 2023.
import os
# pip install copernicus-marine-client
import copernicus_marine_client as cmc
# retrieving catalog
# catalog = copernicus_marine.describe(include_datasets=True)
# optionally provide username/password via environment variables
# if not set, the tool queries username/password
# but when embedding it into another tool it is not clear what for, an introduction text would be useful
# os.environ["COPERNICUS_MARINE_SERVICE_USERNAME"] = ""
# os.environ["COPERNICUS_MARINE_SERVICE_PASSWORD"] = ""
lon_min, lon_max, lat_min, lat_max = -68.55, -67.9, 11.8, 12.6
dataset = cmc.open_dataset(
dataset_id = "cmems_mod_glo_phy-cur_anfc_0.083deg_PT6H-i",
variables = ['uo', 'vo'],
minimum_longitude = lon_min,
maximum_longitude = lon_max,
minimum_latitude = lat_min,
maximum_latitude = lat_max,
minimum_depth = 0,
maximum_depth = 30,
start_datetime = "2022-01-01 00:00:00",
end_datetime = "2022-01-01 23:00:00",
)
output_filename = "CMEMS_Bonaire_currents_2022-01.nc"
dataset.to_netcdf(output_filename)
Todo:
Can only be added for python>=3.9. So drop py38 support or add check in download code that this function is only available for python>=3.9
duplication (replace old function with new one)
add copernicus-marine-client<0.10.0 as dependency
solve code smells
simplify authentication via cmc functions
also support custom dataset_id, skip some steps in that case
maybe get resolution/buffer
times of api datasets are at midnight due to subset, so dfmt.round_timestamp_to_outer_noon can be simplified
check if pre-processing works (e.g. with modelbuilder)
add testcase for cmems forecast (tstart/tstop at now and now+1D)
add testcase voor hycom/opendap
Solve the issues with the global product variable when changing timeframe in same python instance. For the testbank to work, we now remove it in test_download.py. Move to global time extents instead.
make copernicusmarine_credentials() return credentials, gtsm cmems retrieval currently depends on it
suggest copernicusmarine_credentials() as new feature for copernicus-marine-client
Update to https://pypi.org/project/copernicus-marine-client/ instead of opendap (requires py>=3.9), now in open beta, but goes into service in Q1 2024. Shutdown of legacy services (like opendap) is planned in March 2024, but some opendap datasets are already deprecated from 30 November 2023.
Howto from https://help.marine.copernicus.eu/en/articles/8283072-copernicus-marine-client-api-subset:
Todo:
copernicus-marine-client<0.10.0
as dependencydataset_id
, skip some steps in that casedfmt.round_timestamp_to_outer_noon
can be simplifiedproduct
variable when changing timeframe in same python instance. For the testbank to work, we now remove it intest_download.py
. Move to global time extents instead.copernicusmarine_credentials()
return credentials, gtsm cmems retrieval currently depends on itcopernicusmarine_credentials()
as new feature for copernicus-marine-clientFollow up issues: #694 and #692
The text was updated successfully, but these errors were encountered: