CDEC data

30 views
Skip to first unread message

Siemen Algra

unread,
Sep 9, 2021, 5:05:09 AM9/9/21
to ulmo
Is this group still used?

I'm currently working on building a flood level warning model for an island in the californian river delta, but I can't really figure out the right way to download the data from the CDEC website. 

So I use this line of code:
data = cdec.historical.get_data(station_ids=['ORO'], sensor_ids=[23], resolutions='hourly', start='2020-02-01', end='2020-02-25')

but the dataframe it pulls remains empty.
{'ORO': {'RESERVOIR OUTFLOW': Empty DataFrame Columns: [station_id, duration, sensor_number, sensor_type, obs_date, value, data_flag, units] Index: []}}

It is able to find the station ids and variables available for the station.

Please let me know if this is still being used and if someone would be able to help me.
I want to thank you for your time in advance!

mayorga

unread,
Sep 9, 2021, 9:47:49 PM9/9/21
to ulmo
Effectively, this group isn't used, since there's been no traffic in a while. I suggest posting as a GitHub issue at https://github.com/ulmo-dev/ulmo/issues

I don't use CDEC myself, but I haven't seen any failures for the ulmo CDEC tests (https://github.com/ulmo-dev/ulmo/blob/master/test/cdec_historical_test.py). I looked at the CDEC reader code (https://github.com/ulmo-dev/ulmo/blob/master/ulmo/cdec/historical/core.py) to see if there was anything I could find that might be wrong with your request. In the process, I was able to reconstruct a sample data request:


It works on the browser (but note that it gets mapped to https, so that could be an issue). It also worked on the terminal when using wget. So, there could be a subtle change in the response that's causing an ulmo parsing failure, but again since I don't use the CDEC reader I don't think I can help much. On GitHub, a CDEC user might still be listening and may be able to help.

Cheers,
-Emilio

mayorga

unread,
Sep 10, 2021, 1:47:24 AM9/10/21
to ulmo
I ended up getting sucked into this. I guess I was too curious. The good news is that I found the problem, and the fix. It has to do with a change in the date string format that the CDEC data service accepts.

I'll push the fix to the github repo in the next couple of days, and you should then be able to pip install it from github. But it'll be a good while before I issue a new release, with a new conda package. I issued a new release just a week ago!

-Emilio
Reply all
Reply to author
Forward
0 new messages