MET-OM / metocean-api

Extract time series of metocean data from global/regional/coastal hindcasts/reanalysis
GNU Lesser General Public License v2.1
4 stars 5 forks source link

Issues with new CDS-beta API version #20

Closed Mel41127 closed 5 days ago

Mel41127 commented 1 month ago

Hello,

I updated the package to its latest version (v1.1.6) and the new cds-beta api (since the current version will be decommissioned very soon) but now I have issues when trying to run the basic example in the package :

from metocean_api import ts

# Define TimeSeries-object
df_ts = ts.TimeSeries(lon=109, lat=15,start_time='2000-01-01', end_time='2000-01-02' , product='ERA5', 
                      variable=[ 'significant_height_of_combined_wind_waves_and_swell',
                                'mean_wave_direction',
                                'peak_wave_period'])
# Import data from thredds.met.no and save it as csv
df_ts.import_data(save_csv=True)

Return the following Error: KeyError: "'time' is not a valid dimension or coordinate for Dataset with dimensions FrozenMappingWarningOnValuesAccess({'valid_time': 48, 'latitude': 1, 'longitude': 1})"

It seems that something goes wrong when reading the coordinates since I haven't ask for (1, 1) but I'm not sure if the issue lays here. Can the current version of metocean_api sustain this new cds-beta ?