heigeo / climata

Python library for loading and iterating over climate and flow time series data (from ACIS/NOAA RCCs, CoCoRaHS, Hydromet/USBR, CNRFC ESP/NWS, SNOTEL/AWDB/NRCS, and NWIS/USGS)
http://climata.houstoneng.net
MIT License
83 stars 14 forks source link

snotel RegionDailyDataIO #16

Open kashingtonDC opened 5 years ago

kashingtonDC commented 5 years ago

Hi, thanks for creating this awesome tool. I'm having trouble unpacking the <wq.io.util.FlatIO object at 0x11a36a9b0> when accessing snotel data. Here is the code i'm running

from climata.snotel import RegionDailyDataIO

data = RegionDailyDataIO(
    basin="18030007",
    start_date="2017-01-01",
    end_date="2017-01-31",
    parameter="SNWD"
)

for series in data:
    for i in series:
        print (i.data)
thatmushroom commented 5 years ago

This works for me. You have to drop the "data" in i.data.

from climata.snotel import RegionDailyDataIO

data = RegionDailyDataIO(
    basin="18030007",
    start_date="2017-01-01",
    end_date="2017-01-31",
    parameter="SNWD"
)

for series in data:
    for i in series:
        print(i)

dftest = data.as_dataframe()
brobertspierel commented 5 years ago

Thanks for creating this great tool! I am having an issue where I know that there is a longer data record for a particular snotel site that I am querying but it seems like climata is not pulling the full record for some reason. If I go and download the data directly it works but through the package it does not. It also seems like the tool is unable to query some sites that definitely exist and have data. Is it possible this is pulling from a legacy repo?