WSWCWaterDataExchange / MappingStatesDataToWaDE2.0

Manage all code to map and import state's data into WaDE 2.0
BSD 3-Clause "New" or "Revised" License
4 stars 1 forks source link

California-Operated Stream Gages data to WaDE #102

Closed amabdallah closed 2 years ago

amabdallah commented 3 years ago

Let's start here. Ignore stations that are operated or their data is accessible through USGS https://gispublic.waterboards.ca.gov/portal/home/item.html?id=32dfb85bd2744487affe6e3475190093

The actual time series data is available through Geoconnex here (Check with Kyle) https://sb19.linked-data.internetofwater.dev/

amabdallah commented 3 years ago

http://cdec.water.ca.gov/cgi-progs/staMeta?station_id=YPB Broken link: Solution as suggested by Kyle: For the cdec ones just change cgi-progs to dynamicapp Example: https://cdec.water.ca.gov/dynamicapp/staMeta?station_id=YPB

amabdallah commented 2 years ago

Kyle has organized CA gage location metadata and put it in Geoconnex. https://sb19.linked-data.internetofwater.dev/collections/ca_gages/items?startindex=200

Each site has URL pointing to its page on California's system

This is the historic, QC data for ones DWR tracks https://wdl.water.ca.gov/waterdatalibrary/ContinuousData.aspx?ReloadData=False

rwjam commented 2 years ago

Unnecessary links, don't use:

Use these:

import requests
import io
url = "https://cdec.water.ca.gov/dynamicapp/req/CSVDataServlet?Stations=CMR&SensorNums=1&dur_code=E&Start=2020-12-28T00%3A00&End=2022-03-15"  # Test here
r = requests.get(url)
r = r.content
rawData = pd.read_csv(io.StringIO(r.decode('utf-8')))
rawData
rwjam commented 2 years ago

May be too many records to retrieve. Resulting file was 35GB in size. Tried both a 1950 and 2000 start date year, with similar results.

Also ran into memory issue with script, not sure how that will affect things. image

rwjam commented 2 years ago

Going to use SensorNums=65 and only use sites that have a known timeseries of monthly for now (about 24 sites). Good place to start.

rwjam commented 2 years ago

Going to also include reservoir level time series data. I was able to literally just copy / paste a site info table from their website. Looks like we can use that same API call too using a a SensorNums = 15 for monthly RESERVOIR STORAGE, AF.

image