TUW-GEO / ismn

Readers for the data from the International Soil Moisture Network
https://ismn.earth/en/
MIT License
39 stars 21 forks source link

ISMN v1.2.0: error when reading dataset #52

Open xushanthu-2014 opened 2 years ago

xushanthu-2014 commented 2 years ago

When I tried v1.2.0, it seems to be an error when I was reading data Data_separate_files_header_20170101_20211231_9078_Zd6I_20220911 (this is a file I downloaded from ISMN station, containing lat from 36N to 58N and lon from 11.75W to 29.5E.):

ismn_data = ISMN_Interface(data_path)
Files Processed: 100%|██████████| 321/321 [00:00<00:00, 4521.32it/s]Processing metadata for all ismn stations into folder /Users/xushan/research/TUD/ISMN_westEurope/Data_separate_files_header_20170101_20211231_9078_Zd6I_20220911.
This may take a few minutes, but is only done once...
Hint: Use `parallel=True` to speed up metadata generation for large datasets
Metadata generation finished after 0 Seconds.
Metadata and Log stored in /Users/xushan/research/TUD/ISMN_westEurope/Data_separate_files_header_20170101_20211231_9078_Zd6I_20220911/python_metadata

Traceback (most recent call last):

  File "<ipython-input-23-84af3e3a7ed0>", line 1, in <module>
    ismn_data = ISMN_Interface(data_path)

  File "/Users/xushan/opt/anaconda3/lib/python3.7/site-packages/ismn/interface.py", line 135, in __init__
    self.activate_network(network=network, meta_path=meta_path, temp_root=temp_root)

  File "/Users/xushan/opt/anaconda3/lib/python3.7/site-packages/ismn/interface.py", line 166, in activate_network
    self.__file_collection.to_metadata_csv(meta_csv_file)

  File "/Users/xushan/opt/anaconda3/lib/python3.7/site-packages/ismn/filecollection.py", line 403, in to_metadata_csv
    dfs = pd.concat(dfs, axis=0, sort=True)

  File "/Users/xushan/opt/anaconda3/lib/python3.7/site-packages/pandas/util/_decorators.py", line 311, in wrapper
    return func(*args, **kwargs)

  File "/Users/xushan/opt/anaconda3/lib/python3.7/site-packages/pandas/core/reshape/concat.py", line 304, in concat
    sort=sort,

  File "/Users/xushan/opt/anaconda3/lib/python3.7/site-packages/pandas/core/reshape/concat.py", line 351, in __init__
    raise ValueError("No objects to concatenate")

ValueError: No objects to concatenate

Can you please help me with this? Thanks!

xushanthu-2014 commented 2 years ago

is there somebody who can help me? Thanks!

wpreimes commented 2 years ago

Thanks for reporting this. I can reproduce some issues with reading files in the header format. I will keep you posted and push a fix to the package if necessary.

wpreimes commented 2 years ago

@xushanthu-2014 the problem is that for some reason the package cannot collect any metadata from the files you have downloaded. Could you 1) Make sure that this is the correct path to your data /Users/xushan/research/TUD/ISMN_westEurope/Data_separate_files_header_20170101_20211231_9078_Zd6I_20220911 and that you have write access to this folder 2) Did you change the contents or structure of this folder in any way after extracting the data? The package relies on the original structure and file names as provided in the downloaded zip file. 3) Can you confirm that you downloaded the data through this portal https://www.geo.tuwien.ac.at/insitu/data_viewer/ and not trough this one (which is still in beta): https://ismn.geo.tuwien.ac.at/en/dataviewer/ 4) Can you check if there is a .log file in this folder /Users/xushan/research/TUD/ISMN_westEurope/Data_separate_files_header_20170101_20211231_9078_Zd6I_20220911/python_metadata and upload it here if it has any contents. 5) If your archive is not too large (I think it should only be a few MB, can you upload it to here https://cloud.geo.tuwien.ac.at/s/9nAFaFNpA6nag8r)

That would be useful to identify what is going wrong. Thanks