TUW-GEO / ismn

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

Collection not created #34

Closed RY4GIT closed 3 years ago

RY4GIT commented 3 years ago

Hello, I am using your package with environment.yml on miniconda

I followed the tutorial and created ismn_data instance, however, ismn_data does not contain collection

Could you please help me with this problem?

from ismn.interface import ISMN_Interface

# Enter the path to your ISMN data
path_to_ismn_data = "myfilepath/Data_separate_files_20000101_20200229_6817_FTVy_20210520"
ismn_data = ISMN_Interface(path_to_ismn_data, network=['SCAN', 'USCRN'])
wpreimes commented 3 years ago

Hi @RY4GIT, thanks for reporting, we are still updating the docs for this, there is no "collection" anymore in ISMN_Interface. It should be possible to access the networks directly via their name (e.g. ismn_data['SCAN'] to get the station data for SCAN). I will push another update soon. And simply calling ismn_data should print a representation of all networks that are loaded.

RY4GIT commented 3 years ago

I see, thank you! By slicing ismn_data.metadata (e.g. ismn_data.metadata[1][2] I was able to access metadata.

However, it wasn't possible to directly access the network data as you suggested.

ismn_data['SCAN'] Traceback (most recent call last): File "C:\Program Files\JetBrains\Pycharm\PyCharm Community Edition 2020.2\plugins\python-ce\helpers\pydev_pydevd_bundle\pydevd_exec2.py", line 3, in Exec exec(exp, global_vars, local_vars) File "", line 1, in TypeError: 'ISMN_Interface' object is not subscriptable

ismn_data.metadata['SCAN'] Traceback (most recent call last): File "C:\Program Files\JetBrains\Pycharm\PyCharm Community Edition 2020.2\plugins\python-ce\helpers\pydev_pydevd_bundle\pydevd_exec2.py", line 3, in Exec exec(exp, global_vars, local_vars) File "", line 1, in ValueError: no field of name SCAN

Also, do the functions iter_sensors and read_data work in a similar way with the current documentation?

wpreimes commented 3 years ago

Can you check what version of the package you have installed? I assume the problem is that you have installed the package with pip (i.e v0.4), the current master branch version is not yet released on pypi, therefore the documentation does not match to your code. Either install the new package (from github or wait until we pushed it on pypi) or look at the old docs https://ismn.readthedocs.io/en/v0.4/

wpreimes commented 3 years ago

We have released the new version on pypi. Feel free to open another issue if you run into errors with this. Feedback is really welcome!

RY4GIT commented 3 years ago

I cannot thank you enough for your prompt response and update!! I will install the updated version