BobLfoot Posted December 8, 2020 Report Posted December 8, 2020 I have done my fair share of Excel VBA coding and even some SQL DB manipulations, but these newer API, Json, XML style queries still puzzle me quite a bit. I'd like to take the data which comes back from this National Weather Service API Call - {https://nwis.waterservices.usgs.gov/nwis/iv/?format=json&indent=on&sites=01197000¶meterCd=00060&startDT=2020-12-08&endDT=2020-12-08} and stuff the values and DateTime stamps into an excel sheet or SQL DB. Eventually I'll use the data to adjust the gains on my Pond Level PID since this data tells me what my inflow to my pond was. Any simple suggestions or solution ideas are welcome.
BobLfoot Posted December 10, 2020 Author Report Posted December 10, 2020 Well some success, found out if I change from json to waterml format I get an XML file. {https://nwis.waterservices.usgs.gov/nwis/iv/?format=waterml&indent=on&sites=01197000¶meterCd=00060&startDT=2020-12-08&endDT=2020-12-08} and the waterml / xml format can be imported into Excel and manipulated by macros. Might need to leave a vb.net app running to translate from Website to PLC, but looks very doable now.
Steve Bailey Posted December 10, 2020 Report Posted December 10, 2020 Where can I find what data is available from that NWS location? One of my customers gets alternative energy credits for using process steam for feedwater heating. They don't have a functioning temperature sensor on the incoming water line so they've been using a conservative constant value. If the NWS database includes water temperature along with flow they might be able to use that. There shouldn't be too much of a temperature difference between Housatonic river water at Coltsville and the Pittsfield city water main under Dalton Avenue coming from the Cleveland Reservoir.
BobLfoot Posted December 11, 2020 Author Report Posted December 11, 2020 @Steve Bailey If you go to https://nwis.waterservices.usgs.gov/ you'll see the top level page and all the information about how data is published and what might be available. I don't know if temp is an available parameter or not. We're concerned with flow rates as it effects our potential production. You might also play around with the Test Tool - https://nwis.waterservices.usgs.gov/rest/IV-Test-Tool.html.
Steve Bailey Posted December 11, 2020 Report Posted December 11, 2020 Yeah, I checked. All they have available is flow. The NWS is primarily concerned with flow so they can forecast when a river might reach or exceed flood stage.
BobLfoot Posted December 14, 2020 Author Report Posted December 14, 2020 I did find some temps on other water sources listed on the test page. I'd keep poking around you might find something useful.
Steve Bailey Posted December 14, 2020 Report Posted December 14, 2020 I found some as well, but nothing from the East branch of the Housatonic. The closest I found was the Cold River in Savoy and Florida.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now