EPA Air Quality Monitoring System Overview
The EPA operates air quality monitoring stations across the United States, utilizing a cloud-based system with secure connections. Data from these stations, though lagging, covers various substrates like CO, Ozone, and Wind Speed. Users can access monitored parameters, set up the EPA API with a key provided via email, and create connectors in SkySpark for data retrieval and analysis.
Download Presentation
Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
E N D
Presentation Transcript
EPA Air Quality System The EPA has air quality monitoring stations all over the United States In some locations, it can monitor many different types of substrates It has a static key (and also uses email to authenticate) as well as ssl/https which gives it some security The connection is cloud-based since you are connecting to an EPA server to get their data Data seems to lag many months behind so this data is not useful for real- time analytics
Things that can be Monitored You can run read(epaConn).epaCmd("parameters") and see a list of 1,000s of points that potentially can be monitored Realistically, the vast majority of these points will not be available in your location We have coded the following points (1,000s of others can still be added): Ammonia Apparent Temperature Barometric Pressure CO CO2 H2S IR NMHC Temperature NO2 NOx Ozone PM10 Precipitation Relative Humidity SO2 TVOC UV Visibility Wind Direction Wind Speed
EPA API Set Up Note that you do not need to fill out the epaKey field when setting up the connector Run read(epaConn).epaSignup to have a key sent to you Read your email and place the key provided to you into the epaKey field Go learn your points and enjoy!
EPA Connectors in SkySpark Creating an EPA connector: dis: Any Readable Name epaKey: This is emailed to you when you run epaSignup(). It will show up as blank when you look at the connector. This is an intentional security feature. epaEmail: This is needed to get your key and is also passed to requests uri: ` https://aqs.epa.gov/data/api/ ` Of course, these records will have the epaConn and conn tags These can be created in the connector app
EPA Connector Status shows up after ping
EPA Functions epaLearn return a grid of all pre-coded points (only his points are available) read(epaConn). epaLearn epaSyncHis force one or more points to sync readAll(epaHis). epaSyncHis(lastMonth) epaPing send ping to connector to check connection read(epaConn).epaPing epaCmd send the EPA a custom request read(epaConn).epaCmd("state") gets a list of states and their codes read(epaConn).epaCmd("county,51") gets a list of counties and their codes for a given state read(epaConn).epaCmd("site,51,087") gets a list of sites and their codes for a given state read(epaConn).epaCmd("parameters") gets a list of every possible measurement (most are not available) epaSetState(read(site)) uses a site s 2 letter geoState code to give that site a geoStateCode (used for synching) epaSetCounty(read(site)) uses a site s geoCounty to give that site a geoCountyCode (used for synching) epaSetSite(read(site)) finds the first named testing location in a site s county and gives that testing location s code to the site (used for synching) epaSignup used to have a key emailed to you during registration
Getting Data for EPA Points Manually or Automatically Getting history data from Trend_Logs: Each point must have these tags: epaConnRef (ref) which is a ref that points to the EPA Connector epaHis (str) which points to the EPA material being measured his (marker) siteRef->geoStateCode (str) the state parameter found on the site is also used in synching and can be automatically set up from the epaSetState() function siteRef->geoCountyCode (str) the county parameter found on the site is also used in synching and can be automatically set up from the epaSetCounty() function siteRef->siteCode (str) the site (testing location) parameter found on the site is also used in synching and one can be automatically picked with the epaSetSite() function
Basic Troubleshooting Note that it is normal for a connection to close when it has no points in a watch for a given period of time For larger systems, you may want to stagger your syncs
Getting Points via Code () => do varConn: read(epaConn) varConn.epaLearn().map r => do r = r.merge( { equipRef: read(equip)->id, siteRef: read(site)->id, }) end.each r => commit(diff(null, r, {add})) Run as a task in large systems to avoid a timeout error
Getting History For getting history from trend logs: Your initial import should be a set timeRange. Your reoccurring import will be set up in the Job App and will not need a parameter as it will take the default of null which always gets exactly the right amount of history. (dates: null) => do readAll(epaHis).epaSyncHis(dates) end Run as task in large systems to avoid a timeout error