DOI-USGS / nawqa_wqp

Scripts/workflow for Water Quality Portal pulls for NAWQA trends and networks analyses.
Other
4 stars 3 forks source link

Use pcodes to pull WQP data, too #24

Open lindsayplatt opened 6 years ago

lindsayplatt commented 6 years ago

See email exchange from 8/23.

Some USGS parameter codes are not mapped to a WQP characteristic name. This means that we are missing some data. Below are the pcodes that Melissa is currently wanting to add that aren't mapped to a characteristic name, but there could be more in the future.

pcode category description
00677 Nutrient Hydrolyzable phosphorus plus orthophosphate, water, filtered, milligrams per liter as phosphorus
00678 Nutrient Hydrolyzable phosphorus plus orthophosphate, water, unfiltered, milligrams per liter as phosphorus
52314  Nutrient Phosphates (orthophosphate plus condensed and polyphosphates), water, unfiltered, milligrams per liter as PO4
52315 Nutrient Phosphates (orthophosphate plus condensed and polyphosphates), water, filtered, milligrams per liter as PO4
72244 Sediment Suspended sediment volumetric concentration by Laser In-Situ Scattering and Tranmissometry (LISST), microliters per liter
72245 Sediment Full size suspended sediment volumetric diameter by Laser In-Situ Scattering and Tranmissometry (LISST), micrometers
72246 Sediment Suspended sediment volumetric concentration greater than 63 microns by Laser In-Situ Scattering and Tranmissometry (LISST), microliters per liter
72247 Sediment Suspended sediment volumetric diameter greater than 63 microns by Laser In-Situ Scattering and Tranmissometry (LISST), micrometers
99423 Nutrient Hydrolyzable phosphorus, water, filtered, estimated by GCLAS, milligrams per liter as phosphorus

We should add pcodes to the wqp_codes.yml config file but map to one of the characteristics ourselves. Then, use NULL for the characteristic name when pulling data for the pcode (make pCode = NULL by default). Could prefix p-codes with pcode-00010 and grep on pcode to use them?

x <- dataRetrieval::readWQPdata(siteid = "USGS-02361000", 
                                startDateLo = "2014-05-11", 
                                startDateHi = "2014-05-13", 
                                characteristicName = "Temperature, water", 
                                pCode = NULL)

x2 <- dataRetrieval::readWQPdata(siteid = "USGS-02361000", 
                                 startDateLo = "2014-05-11", 
                                 startDateHi = "2014-05-13", 
                                 characteristicName = NULL, 
                                 pCode = "00010")