|
51 | 51 | "source": [ |
52 | 52 | "### Basic Usage\n", |
53 | 53 | "\n", |
54 | | - "The dataretrieval package has several functions that allow you to retrieve data from different web services. This example uses the `get_samples()` function to retrieve water quality sample data for USGS monitoring locations from Samples. The following arguments are supported:\n", |
| 54 | + "The dataretrieval package has several functions that allow you to retrieve data from different web services. This example uses the `get_samples()` function to retrieve water quality sample data for USGS monitoring locations from Samples. The allowable values for the categorical arguments below come from `waterdata.get_codes()` (see the *Discrete water-quality samples* notebook). The following arguments are supported:\n", |
55 | 55 | "\n", |
56 | 56 | "* **ssl_check** : boolean, optional\n", |
57 | 57 | " Check the SSL certificate.\n", |
|
72 | 72 | " organizations - \"organization\", \"count\"\n", |
73 | 73 | "* **activityMediaName** : string or list of strings, optional\n", |
74 | 74 | " Name or code indicating environmental medium in which sample was taken.\n", |
75 | | - " Check the `activityMediaName_lookup()` function in this module for all\n", |
76 | | - " possible inputs.\n", |
| 75 | + " Use `get_codes(code_service=\"samplemedia\")` for all possible inputs.\n", |
77 | 76 | " Example: \"Water\".\n", |
78 | 77 | "* **activityStartDateLower** : string, optional\n", |
79 | 78 | " The start date if using a date range. Takes the format YYYY-MM-DD.\n", |
|
90 | 89 | " Example: \"Sample-Routine, regular\".\n", |
91 | 90 | "* **characteristicGroup** : string or list of strings, optional\n", |
92 | 91 | " Characteristic group is a broad category of characteristics\n", |
93 | | - " describing one or more results. Check the `characteristicGroup_lookup()`\n", |
94 | | - " function in this module for all possible inputs.\n", |
| 92 | + " describing one or more results. Use\n", |
| 93 | + " `get_codes(code_service=\"characteristicgroup\")` for all possible inputs.\n", |
95 | 94 | " Example: \"Organics, PFAS\"\n", |
96 | 95 | "* **characteristic** : string or list of strings, optional\n", |
97 | 96 | " Characteristic is a specific category describing one or more results.\n", |
98 | | - " Check the `characteristic_lookup()` function in this module for all\n", |
99 | | - " possible inputs.\n", |
| 97 | + " Use `get_codes(code_service=\"characteristics\")` for all possible inputs.\n", |
100 | 98 | " Example: \"Suspended Sediment Discharge\"\n", |
101 | 99 | "* **characteristicUserSupplied** : string or list of strings, optional\n", |
102 | 100 | " A user supplied characteristic name describing one or more results.\n", |
| 101 | + " Use `get_codes(code_service=\"observedproperty\")` for all possible inputs.\n", |
103 | 102 | "* **boundingBox**: list of four floats, optional\n", |
104 | 103 | " Filters on the the associated monitoring location's point location\n", |
105 | 104 | " by checking if it is located within the specified geographic area. \n", |
|
116 | 115 | "* **countryFips** : string or list of strings, optional\n", |
117 | 116 | " Example: \"US\" (United States)\n", |
118 | 117 | "* **stateFips** : string or list of strings, optional\n", |
119 | | - " Check the `stateFips_lookup()` function in this module for all\n", |
120 | | - " possible inputs.\n", |
121 | 118 | " Example: \"US:15\" (United States: Hawaii)\n", |
122 | 119 | "* **countyFips** : string or list of strings, optional\n", |
123 | | - " Check the `countyFips_lookup()` function in this module for all\n", |
124 | | - " possible inputs.\n", |
125 | 120 | " Example: \"US:15:001\" (United States: Hawaii, Hawaii County)\n", |
126 | 121 | "* **siteTypeCode** : string or list of strings, optional\n", |
127 | | - " An abbreviation for a certain site type. Check the `siteType_lookup()`\n", |
128 | | - " function in this module for all possible inputs.\n", |
| 122 | + " An abbreviation for a certain site type. Use\n", |
| 123 | + " `get_codes(code_service=\"sitetype\")` for all possible inputs.\n", |
129 | 124 | " Example: \"GW\" (Groundwater site)\n", |
130 | 125 | "* **siteTypeName** : string or list of strings, optional\n", |
131 | | - " A full name for a certain site type. Check the `siteType_lookup()`\n", |
132 | | - " function in this module for all possible inputs.\n", |
| 126 | + " A full name for a certain site type. Use\n", |
| 127 | + " `get_codes(code_service=\"sitetype\")` for all possible inputs.\n", |
133 | 128 | " Example: \"Well\"\n", |
134 | 129 | "* **usgsPCode** : string or list of strings, optional\n", |
135 | 130 | " 5-digit number used in the US Geological Survey computerized\n", |
136 | 131 | " data system, National Water Information System (NWIS), to\n", |
137 | | - " uniquely identify a specific constituent. Check the \n", |
138 | | - " `characteristic_lookup()` function in this module for all possible\n", |
139 | | - " inputs.\n", |
| 132 | + " uniquely identify a specific constituent. Use\n", |
| 133 | + " `get_codes(code_service=\"characteristics\")` for all possible inputs.\n", |
140 | 134 | " Example: \"00060\" (Discharge, cubic feet per second)\n", |
141 | 135 | "* **hydrologicUnit** : string or list of strings, optional\n", |
142 | 136 | " Max 12-digit number used to describe a hydrologic unit.\n", |
|
300 | 294 | "source": [ |
301 | 295 | "#### Example 4: Retrieve water quality sample data for one site and convert to a wide format\n", |
302 | 296 | "\n", |
303 | | - "Note that the USGS Samples database returns multiple parameters in a \"long\" format: each row in the resulting table represents a single observation of a single parameter. Furthermore, every observation has 181 fields of metadata. However, if you wanted to place your water quality data into a \"wide\" format, where each column represents a water quality parameter code, the code below details one solution." |
| 297 | + "Note that the USGS Samples database returns multiple parameters in a \"long\" format: each row in the resulting table represents a single observation of a single parameter. Furthermore, every observation comes with more than 180 fields of metadata (the default `fullphyschem` profile returns 187 columns). However, if you wanted to place your water quality data into a \"wide\" format, where each column represents a water quality parameter code, the code below details one solution." |
304 | 298 | ] |
305 | 299 | }, |
306 | 300 | { |
|
0 commit comments