CCI-Tools / cate

ESA CCI Toolbox (Cate)
MIT License
50 stars 15 forks source link

ValueError: Could not find any dimension coordinates to use to order the datasets for concatenation #891

Closed AliceBalfanz closed 4 years ago

AliceBalfanz commented 4 years ago

Expected behavior

When using the cate python api to make a local store from a remote data store with a time range, which only includes one time stamp I expect it to behave exactly as for 2 or more time stamps.

Actual behavior

Error is raised, when opening dataset, which only contains one time stamp.

Steps to reproduce the problem

  1. Importing all necessary packages

    from cate.core.ds import DATA_STORE_REGISTRY
    import cate.ops as ops
    from cate.util.monitor import ConsoleMonitor
    from cate.core import ds
    import datetime
  2. getting opensearch datastore and local datastore

    data_store = DATA_STORE_REGISTRY.get_data_store('esa_cci_odp_os')
    local_store = DATA_STORE_REGISTRY.get_data_store('local')
  3. Selecting a time range which ensures, only one time stamp is included

    t_range = (datetime.datetime(2009, 2, 23, 12, 0),  datetime.datetime(2009, 2, 23, 12, 0))
    time_range=tuple(t.strftime('%Y-%m-%d') for t in t_range)
  4. Updating the file list for the desired datasets

    data_store.query('esacci2.SST.day.L3C.SSTskin.AVHRR-3.NOAA-19.AVHRR19_G.2-1.r1')[0].update_file_list()
  5. using make_local to include the selection to the local datastore

    data_store.query('esacci2.SST.day.L3C.SSTskin.AVHRR-3.NOAA-19.AVHRR19_G.2-1.r1')[0].make_local('test_sst_one_day', time_range=time_range)
  6. Opening dataset from local store

    ds.open_dataset('local.test_sst_one_day')

    This results in:
    ValueError: Could not find any dimension coordinates to use to order the datasets for concatenation

No problems are encountered if the time range is specified with one day more:

t_range = (datetime.datetime(2009, 2, 23, 12, 0),  datetime.datetime(2009, 2, 24, 12, 0))
AliceBalfanz commented 4 years ago

Cannot reproduce error anymore, the time range is interpreted correctly and when given a time range as a string of ('2009-02-24','2009-02-24') it converts into (datetime.datetime(2009, 2, 24, 0, 0), datetime.datetime(2009, 2, 24, 23, 59, 59)).

However, for dataset 'esacci.SST.day.L3C.SSTskin.AVHRR-3.NOAA-19.AVHRR19_G.2-1.r1' there seems to be an access error, which is not related to the false interpretation of time ranges.