Comments (8)
What version are you using? I think the one on CRAN and the one on gitHub (install_github("USGS-R/dataRetrieval") all use the function readNWISqw
, which does allow for multiple parameter codes:
siteNumbers <- c('04024430','04024000')
startDate <- '2010-01-01'
endDate <- ''
parameterCd <- c('34247','30234','32104','34220')
rawNWISqwData <- readNWISqw(siteNumbers,parameterCd,startDate,endDate)
So, if you know what pCodes are available from whatNWISdata
, you could (I think) get what you are looking for.
Perhaps like this?:
siteNumbers <- c('04024430','04024000')
startDate <- '2010-01-01'
endDate <- ''
availableData <- whatNWISdata(siteNumbers, service = "qw")
pCodes <- unique(availableData$parm_cd[
which(availableData$parameter_group_nm == "Nutrient")])
rawNWISqwData <- readNWISqw(siteNumbers,pCodes,startDate,endDate)
Let me know if I didn't address your issue...of if you think there's an additional enhancement that i am missing.
from dataretrieval.
Yes that would work just fine, thanks! However, if you want, I believe you could add in the option to just pull all parms following this URL example:
the "radio_parm_cds=all_parm_cds" argument pulls all params
from dataretrieval.
I'll look into using this:
http://nwis.waterdata.usgs.gov/usa/nwis/qwdata
more effectively.
I'm grabbing all the other data from waterservices (not waterdata), so I haven't had to pay as much attention to this url generation scheme.
from dataretrieval.
@dlorenz-usgs has the same request. Need to bump up priority.
from dataretrieval.
I need to submit an update to CRAN (NWISweb slightly changed their server config). I will get the param="all" update in this next release, but not parameter groups...that will be a future release.
from dataretrieval.
I added the parameter_group option. Choosing one group seems fine. Choosing more than one, I'm still troubleshooting if it's correct or not. Fewer rows are returned (but the number of parameter codes is greater). I assume that is because choosing the 2 groups means NWIS will return the sites that have both groups (AND instead of OR).
I'll keep troubleshooting, but if anyone just knows the answer, feel free to let me know (@tmills-usgs, @dlorenz-usgs ?).
Here are 3 example urls:
Nutrient:
http://nwis.waterdata.usgs.gov/nwis/qwdata?multiple_site_no=04024430,04024000&sort_key=site_no&group_key=NONE&inventory_output=0&begin_date=2010-01-01&end_date=&TZoutput=0¶m_group=NUT&qw_attributes=0&format=rdb&qw_sample_wide=0&rdb_qw_attributes=expanded&date_format=YYYY-MM-DD&rdb_compression=value&list_of_search_criteria=multiple_site_no
(returns 1512 rows)
If I try to reproduce with the point and click browser option, I get no results...but I've never been very successful at navigating that site:
from dataretrieval.
OK, this is merged into the main branch. I'm confident that with one parameter group it's working right. I'm confident that dataRetrieval
is returning the data correctly with 2 groups...I'm just not 100% sure what that data is.
If anyone knows, or knows who to ask, please let me know.
from dataretrieval.
Ah HA!
When you ask for more than one group, you only get sites back that have both (thanks to @eread-usgs ). I will document this, push it, and get it out to CRAN soon. The only lingering question I have is can I over-ride that behavior through the url, so I get all the data back?
from dataretrieval.
Related Issues (20)
- Inclusive Date Ranges HOT 1
- WaterML1.1 Depreciated? HOT 2
- SSL certificate problem HOT 6
- How to pull all site data from an entire state from readNWISsite HOT 4
- readNWISsite HOT 2
- Problem with the function readNWISdata HOT 2
- Need to escape WQP site IDs with spaces in them or NLDI queries.
- readNWISdata returning more parameter codes than requested HOT 3
- Enable Caching of data HOT 12
- broken web services link in whatNWISdata documentation
- Timeout error when attempting to retrieve data HOT 5
- POST in WQP not working? HOT 2
- Add citation guidance to tutorial HOT 2
- Site services w/qw output
- Consider being smarter about providers in WQP HOT 1
- How do I know what flow_cd column means and it's values? HOT 2
- allow data frame as input to importWQP HOT 1
- Drainage area retrieval from sites HOT 1
- Unexpected warning when providing duplicate pcodes to `pcode_to_name`
- retrieve water year summary statistics? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dataretrieval.