From f9df46f922f1287de86ba8d1cc5335cca9ec2713 Mon Sep 17 00:00:00 2001 From: Elise Hinman Date: Tue, 25 Mar 2025 17:04:14 -0500 Subject: [PATCH 01/21] add initial samples data info --- dataretrieval/samples.py | 213 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 213 insertions(+) create mode 100644 dataretrieval/samples.py diff --git a/dataretrieval/samples.py b/dataretrieval/samples.py new file mode 100644 index 00000000..ce4d32e9 --- /dev/null +++ b/dataretrieval/samples.py @@ -0,0 +1,213 @@ +""" +Tool for downloading data from the Water Quality Portal (https://waterqualitydata.us) + +See https://waterqualitydata.us/webservices_documentation for API reference + +.. todo:: + + - implement other services like Organization, Activity, etc. + +""" + +from __future__ import annotations + +import warnings +from io import StringIO +from typing import TYPE_CHECKING + +import pandas as pd + +#from .utils import BaseMetadata, query + +if TYPE_CHECKING: + from pandas import DataFrame + +BASE_URL = "https://api.waterdata.usgs.gov/samples-data/" + +services_dict = { + "results" : ["fullphyschem", "basicphyschem", + "fullbio", "basicbio", "narrow", + "resultdetectionquantitationlimit", + "labsampleprep", "count"], + "locations" : ["site", "count"], + "activities" : ["sampact", "actmetric", + "actgroup", "count"], + "projects" : ["project", "projectmonitoringlocationweight"], + "organizations" : ["organization", "count"] +} + + +def _check_profiles( + service, + profile +): + """Check that services are paired correctly with profile in + a service call. + + Parameters + ---------- + service : string + One of the service names from the "services" list. + profile : string + One of the profile names from "results_profiles", + "locations_profiles", "activities_profiles", + "projects_profiles" or "organizations_profiles". + """ + + if service not in services_dict.keys(): + raise TypeError( + f"{service} is not a Samples service. " + f"Valid options are {list(services_dict.keys())}." + ) + if profile not in services_dict[service]: + raise TypeError( + f"{profile} is not a profile associated with " + f"the {service} service. Valid options are " + f"{services_dict[service]}." + ) + +def get_USGS_samples( + service="results", + profile="fullphyschem", + activityMediaName=None, + activityStartDateLower=None, + activityStartDateUpper=None, + activityTypeCode=None, + characteristicGroup=None, + characteristc=None, + characteristicUserSupplied=None, + boundingBox=None, + countryFips=None, + stateFips=None, + countyFips=None, + siteTypeCode=None, + siteTypeName=None, + usgsPCode=None, + hydrologicUnit=None, + monitoringLocationIdentifier=None, + organizationIdentifier=None, + pointLocationLatitude=None, + pointLocationLongitude=None, + pointLocationWithinMiles=None, + projectIdentifier=None, + recordIdentifierUserSupplied=None +): + """Search Samples database for USGS water quality data. + This is a wrapper function for the Samples database API. All potential + filters are provided as arguments to the function, but please do not + populate all possible filters; leave as many as feasible with their default + value (None). This is important because overcomplicated web service queries + can bog down the database's ability to return an applicable dataset before + it times out. + + The web GUI for the Samples database can be found here: + https://waterdata.usgs.gov/download-samples/#dataProfile=site + + If you would like more details on feasible query parameters (complete with + examples), please visit the Samples database swagger docs, here: + https://api.waterdata.usgs.gov/samples-data/docs#/ + + Parameters + ---------- + service : string + One of the available Samples services: "results", "locations", "activities", + "projects", or "organizations". Defaults to "results". + profile : string + One of the available profiles associated with a service. Options for each + service are: + "results" - "fullphyschem", "basicphyschem", + "fullbio", "basicbio", "narrow", + "resultdetectionquantitationlimit", + "labsampleprep", "count" + "locations" - "site", "count" + "activities" - "sampact", "actmetric", + "actgroup", "count" + "projects" - "project", "projectmonitoringlocationweight" + "organizations" - "organization", "count" + activityMediaName : string or list of strings, optional + Name or code indicating environmental medium sample was taken. + Example: "Water". + activityStartDateLower : string, optional + The start date if using a date range. Takes the format YYYY-MM-DD. + The logic is inclusive, i.e. it will also return results that + match the date. + activityStartDateUpper : string, optional + The end date if using a date range. Takes the format YYYY-MM-DD. + The logic is inclusive, i.e. it will also return results that + match the date. If left as None, will pull all data before + activityStartDateLower up to the most recent available results. + activityTypeCode : string or list of strings, optional + Text code that describes type of field activity performed. + Example: "Sample-Routine, regular". + characteristicGroup : string or list of strings, optional + Characteristic group is a broad category describing one or more + of results. + Example: "Organics, PFAS" + characteristc : string or list of strings, optional + Characteristic is a specific category describing one or more results. + Example: "Suspended Sediment Discharge" + characteristicUserSupplied : string or list of strings, optional + A user supplied characteristic name describing one or more results. + boundingBox: list of four floats, optional + Filters on the the associated monitoring location's point location + by checking if it is located within the specified geographic area. + The logic is inclusive, i.e. it will include locations that overlap + with the edge of the bounding box. Values are separated by commas, + expressed in decimal degrees, NAD83, and longitudes west of Greenwich + are negative. + The format is a string consisting of: + - Western-most longitude + - Southern-most latitude + - Eastern-most longitude + - Northern-most longitude + Example: [-92.8,44.2,-88.9,46.0] + countryFips : string or list of strings, optional + Example: "US" (United States) + stateFips : string or list of strings, optional + Check out the code service for FIPS codes: + https://api.waterdata.usgs.gov/samples-data/codeservice/docs#/ + Example: "US:15" (United States: Hawaii) + countyFips : string or list of strings, optional + Check out the code service for FIPS codes: + https://api.waterdata.usgs.gov/samples-data/codeservice/docs#/ + Example: "US:15:001" (United States: Hawaii, Hawaii County) + siteTypeCode : string or list of strings, optional + An abbreviation for a certain site type. + Example: "GW" (Groundwater site) + siteTypeName : string or list of strings, optional + A full name for a certain site type. + Example: "Well" + usgsPCode : string or list of strings, optional + 5-digit number used in the US Geological Survey computerized + data system, National Water Information System (NWIS), to + uniquely identify a specific constituent + Example: "00060" (Discharge, cubic feet per second) + hydrologicUnit : string or list of strings, optional + Max 12-digit number used to describe a hydrologic unit. + Example: "070900020502" + monitoringLocationIdentifier : string or list of strings, optional + A monitoring location identifier has two parts: the agency code + and the location number, separated by a dash (-). + Example: "USGS-040851385" + organizationIdentifier : string or list of strings, optional + Designator used to uniquely identify a specific organization. + Currently only accepting the organization "USGS". + pointLocationLatitude : float, optional + Latitude for a point/radius query (decimal degrees). Must be used + with pointLocationLongitude and pointLocationWithinMiles. + pointLocationLongitude : float, optional + Longitude for a point/radius query (decimal degrees). Must be used + with pointLocationLatitude and pointLocationWithinMiles. + pointLocationWithinMiles : float, optional + Radius for a point/radius query. Must be used with + pointLocationLatitude and pointLocationLongitude + projectIdentifier : string or list of strings, optional + Designator used to uniquely id a data collection project in + organization context. + recordIdentifierUserSupplied : string or list of strings, optional + Internal AQS record identifier that returns 1 entry. Only available + for the "results" service. + """ + _check_profiles(service, profile) + + From 38c673f99f818dc813dc1ea86d2bc2e51635dccc Mon Sep 17 00:00:00 2001 From: Elise Hinman Date: Tue, 25 Mar 2025 17:47:43 -0500 Subject: [PATCH 02/21] edits to url building --- dataretrieval/samples.py | 211 +++++++++++++++++++++------------------ 1 file changed, 113 insertions(+), 98 deletions(-) diff --git a/dataretrieval/samples.py b/dataretrieval/samples.py index ce4d32e9..fe45e9d4 100644 --- a/dataretrieval/samples.py +++ b/dataretrieval/samples.py @@ -12,6 +12,7 @@ from __future__ import annotations import warnings +import requests from io import StringIO from typing import TYPE_CHECKING @@ -90,7 +91,8 @@ def get_USGS_samples( pointLocationLongitude=None, pointLocationWithinMiles=None, projectIdentifier=None, - recordIdentifierUserSupplied=None + recordIdentifierUserSupplied=None, + mimeType="text/csv" ): """Search Samples database for USGS water quality data. This is a wrapper function for the Samples database API. All potential @@ -109,105 +111,118 @@ def get_USGS_samples( Parameters ---------- - service : string + service : string One of the available Samples services: "results", "locations", "activities", "projects", or "organizations". Defaults to "results". - profile : string - One of the available profiles associated with a service. Options for each - service are: - "results" - "fullphyschem", "basicphyschem", - "fullbio", "basicbio", "narrow", - "resultdetectionquantitationlimit", - "labsampleprep", "count" - "locations" - "site", "count" - "activities" - "sampact", "actmetric", - "actgroup", "count" - "projects" - "project", "projectmonitoringlocationweight" - "organizations" - "organization", "count" - activityMediaName : string or list of strings, optional - Name or code indicating environmental medium sample was taken. - Example: "Water". - activityStartDateLower : string, optional - The start date if using a date range. Takes the format YYYY-MM-DD. - The logic is inclusive, i.e. it will also return results that - match the date. - activityStartDateUpper : string, optional - The end date if using a date range. Takes the format YYYY-MM-DD. - The logic is inclusive, i.e. it will also return results that - match the date. If left as None, will pull all data before - activityStartDateLower up to the most recent available results. - activityTypeCode : string or list of strings, optional - Text code that describes type of field activity performed. - Example: "Sample-Routine, regular". - characteristicGroup : string or list of strings, optional - Characteristic group is a broad category describing one or more - of results. - Example: "Organics, PFAS" - characteristc : string or list of strings, optional - Characteristic is a specific category describing one or more results. - Example: "Suspended Sediment Discharge" - characteristicUserSupplied : string or list of strings, optional - A user supplied characteristic name describing one or more results. - boundingBox: list of four floats, optional - Filters on the the associated monitoring location's point location - by checking if it is located within the specified geographic area. - The logic is inclusive, i.e. it will include locations that overlap - with the edge of the bounding box. Values are separated by commas, - expressed in decimal degrees, NAD83, and longitudes west of Greenwich - are negative. - The format is a string consisting of: - - Western-most longitude - - Southern-most latitude - - Eastern-most longitude - - Northern-most longitude - Example: [-92.8,44.2,-88.9,46.0] - countryFips : string or list of strings, optional - Example: "US" (United States) - stateFips : string or list of strings, optional - Check out the code service for FIPS codes: - https://api.waterdata.usgs.gov/samples-data/codeservice/docs#/ - Example: "US:15" (United States: Hawaii) - countyFips : string or list of strings, optional - Check out the code service for FIPS codes: - https://api.waterdata.usgs.gov/samples-data/codeservice/docs#/ - Example: "US:15:001" (United States: Hawaii, Hawaii County) - siteTypeCode : string or list of strings, optional - An abbreviation for a certain site type. - Example: "GW" (Groundwater site) - siteTypeName : string or list of strings, optional - A full name for a certain site type. - Example: "Well" - usgsPCode : string or list of strings, optional - 5-digit number used in the US Geological Survey computerized - data system, National Water Information System (NWIS), to - uniquely identify a specific constituent - Example: "00060" (Discharge, cubic feet per second) - hydrologicUnit : string or list of strings, optional - Max 12-digit number used to describe a hydrologic unit. - Example: "070900020502" - monitoringLocationIdentifier : string or list of strings, optional - A monitoring location identifier has two parts: the agency code - and the location number, separated by a dash (-). - Example: "USGS-040851385" - organizationIdentifier : string or list of strings, optional - Designator used to uniquely identify a specific organization. - Currently only accepting the organization "USGS". - pointLocationLatitude : float, optional - Latitude for a point/radius query (decimal degrees). Must be used - with pointLocationLongitude and pointLocationWithinMiles. - pointLocationLongitude : float, optional - Longitude for a point/radius query (decimal degrees). Must be used - with pointLocationLatitude and pointLocationWithinMiles. - pointLocationWithinMiles : float, optional - Radius for a point/radius query. Must be used with - pointLocationLatitude and pointLocationLongitude - projectIdentifier : string or list of strings, optional - Designator used to uniquely id a data collection project in - organization context. - recordIdentifierUserSupplied : string or list of strings, optional - Internal AQS record identifier that returns 1 entry. Only available - for the "results" service. + profile : string + One of the available profiles associated with a service. Options for each + service are: + "results" - "fullphyschem", "basicphyschem", + "fullbio", "basicbio", "narrow", + "resultdetectionquantitationlimit", + "labsampleprep", "count" + "locations" - "site", "count" + "activities" - "sampact", "actmetric", + "actgroup", "count" + "projects" - "project", "projectmonitoringlocationweight" + "organizations" - "organization", "count" + activityMediaName : string or list of strings, optional + Name or code indicating environmental medium sample was taken. + Example: "Water". + activityStartDateLower : string, optional + The start date if using a date range. Takes the format YYYY-MM-DD. + The logic is inclusive, i.e. it will also return results that + match the date. + activityStartDateUpper : string, optional + The end date if using a date range. Takes the format YYYY-MM-DD. + The logic is inclusive, i.e. it will also return results that + match the date. If left as None, will pull all data before + activityStartDateLower up to the most recent available results. + activityTypeCode : string or list of strings, optional + Text code that describes type of field activity performed. + Example: "Sample-Routine, regular". + characteristicGroup : string or list of strings, optional + Characteristic group is a broad category describing one or more + of results. + Example: "Organics, PFAS" + characteristc : string or list of strings, optional + Characteristic is a specific category describing one or more results. + Example: "Suspended Sediment Discharge" + characteristicUserSupplied : string or list of strings, optional + A user supplied characteristic name describing one or more results. + boundingBox: list of four floats, optional + Filters on the the associated monitoring location's point location + by checking if it is located within the specified geographic area. + The logic is inclusive, i.e. it will include locations that overlap + with the edge of the bounding box. Values are separated by commas, + expressed in decimal degrees, NAD83, and longitudes west of Greenwich + are negative. + The format is a string consisting of: + - Western-most longitude + - Southern-most latitude + - Eastern-most longitude + - Northern-most longitude + Example: [-92.8,44.2,-88.9,46.0] + countryFips : string or list of strings, optional + Example: "US" (United States) + stateFips : string or list of strings, optional + Check out the code service for FIPS codes: + https://api.waterdata.usgs.gov/samples-data/codeservice/docs#/ + Example: "US:15" (United States: Hawaii) + countyFips : string or list of strings, optional + Check out the code service for FIPS codes: + https://api.waterdata.usgs.gov/samples-data/codeservice/docs#/ + Example: "US:15:001" (United States: Hawaii, Hawaii County) + siteTypeCode : string or list of strings, optional + An abbreviation for a certain site type. + Example: "GW" (Groundwater site) + siteTypeName : string or list of strings, optional + A full name for a certain site type. + Example: "Well" + usgsPCode : string or list of strings, optional + 5-digit number used in the US Geological Survey computerized + data system, National Water Information System (NWIS), to + uniquely identify a specific constituent + Example: "00060" (Discharge, cubic feet per second) + hydrologicUnit : string or list of strings, optional + Max 12-digit number used to describe a hydrologic unit. + Example: "070900020502" + monitoringLocationIdentifier : string or list of strings, optional + A monitoring location identifier has two parts: the agency code + and the location number, separated by a dash (-). + Example: "USGS-040851385" + organizationIdentifier : string or list of strings, optional + Designator used to uniquely identify a specific organization. + Currently only accepting the organization "USGS". + pointLocationLatitude : float, optional + Latitude for a point/radius query (decimal degrees). Must be used + with pointLocationLongitude and pointLocationWithinMiles. + pointLocationLongitude : float, optional + Longitude for a point/radius query (decimal degrees). Must be used + with pointLocationLatitude and pointLocationWithinMiles. + pointLocationWithinMiles : float, optional + Radius for a point/radius query. Must be used with + pointLocationLatitude and pointLocationLongitude + projectIdentifier : string or list of strings, optional + Designator used to uniquely id a data collection project in + organization context. + recordIdentifierUserSupplied : string or list of strings, optional + Internal AQS record identifier that returns 1 entry. Only available + for the "results" service. + mimeType : string, optional + + """ _check_profiles(service, profile) - + # Get all not-None inputs + params = {key: value for key, value in locals().items() if value is not None and key not in ['service', 'profile']} + + # Build URL with service and profile + url = BASE_URL + service + "/" + profile + # Make a GET request with the filtered parameters + response = requests.get(url, params=params) + + return response + + From 72320eae97427195f94c5dce7f543073523425a5 Mon Sep 17 00:00:00 2001 From: Elise Hinman Date: Thu, 27 Mar 2025 13:26:30 -0500 Subject: [PATCH 03/21] add URL to call, etc. --- dataretrieval/samples.py | 120 +++++++++++++++++++++++++-------------- 1 file changed, 78 insertions(+), 42 deletions(-) diff --git a/dataretrieval/samples.py b/dataretrieval/samples.py index fe45e9d4..e6f204d3 100644 --- a/dataretrieval/samples.py +++ b/dataretrieval/samples.py @@ -1,11 +1,7 @@ """ -Tool for downloading data from the Water Quality Portal (https://waterqualitydata.us) +Tool for downloading data from the USGS Aquarius Samples database (https://waterqualitydata.us) -See https://waterqualitydata.us/webservices_documentation for API reference - -.. todo:: - - - implement other services like Organization, Activity, etc. +See https://api.waterdata.usgs.gov/samples-data/docs#/ for API reference """ @@ -13,12 +9,13 @@ import warnings import requests +from requests.models import PreparedRequest from io import StringIO from typing import TYPE_CHECKING import pandas as pd -#from .utils import BaseMetadata, query +from utils import BaseMetadata, query if TYPE_CHECKING: from pandas import DataFrame @@ -68,31 +65,32 @@ def _check_profiles( ) def get_USGS_samples( - service="results", - profile="fullphyschem", - activityMediaName=None, - activityStartDateLower=None, - activityStartDateUpper=None, - activityTypeCode=None, - characteristicGroup=None, - characteristc=None, - characteristicUserSupplied=None, - boundingBox=None, - countryFips=None, - stateFips=None, - countyFips=None, - siteTypeCode=None, - siteTypeName=None, - usgsPCode=None, - hydrologicUnit=None, - monitoringLocationIdentifier=None, - organizationIdentifier=None, - pointLocationLatitude=None, - pointLocationLongitude=None, - pointLocationWithinMiles=None, - projectIdentifier=None, - recordIdentifierUserSupplied=None, - mimeType="text/csv" + ssl_check=True, + service="results", + profile="fullphyschem", + activityMediaName=None, + activityStartDateLower=None, + activityStartDateUpper=None, + activityTypeCode=None, + characteristicGroup=None, + characteristc=None, + characteristicUserSupplied=None, + boundingBox=None, + countryFips=None, + stateFips=None, + countyFips=None, + siteTypeCode=None, + siteTypeName=None, + usgsPCode=None, + hydrologicUnit=None, + monitoringLocationIdentifier=None, + organizationIdentifier=None, + pointLocationLatitude=None, + pointLocationLongitude=None, + pointLocationWithinMiles=None, + projectIdentifier=None, + recordIdentifierUserSupplied=None, + mimeType="text/csv" ): """Search Samples database for USGS water quality data. This is a wrapper function for the Samples database API. All potential @@ -111,21 +109,23 @@ def get_USGS_samples( Parameters ---------- + ssl_check : bool, optional + Check the SSL certificate. service : string One of the available Samples services: "results", "locations", "activities", "projects", or "organizations". Defaults to "results". profile : string One of the available profiles associated with a service. Options for each service are: - "results" - "fullphyschem", "basicphyschem", + results - "fullphyschem", "basicphyschem", "fullbio", "basicbio", "narrow", "resultdetectionquantitationlimit", "labsampleprep", "count" - "locations" - "site", "count" - "activities" - "sampact", "actmetric", + locations - "site", "count" + activities - "sampact", "actmetric", "actgroup", "count" - "projects" - "project", "projectmonitoringlocationweight" - "organizations" - "organization", "count" + projects - "project", "projectmonitoringlocationweight" + organizations - "organization", "count" activityMediaName : string or list of strings, optional Name or code indicating environmental medium sample was taken. Example: "Water". @@ -150,7 +150,7 @@ def get_USGS_samples( Example: "Suspended Sediment Discharge" characteristicUserSupplied : string or list of strings, optional A user supplied characteristic name describing one or more results. - boundingBox: list of four floats, optional + boundingBox: string of four floats, optional Filters on the the associated monitoring location's point location by checking if it is located within the specified geographic area. The logic is inclusive, i.e. it will include locations that overlap @@ -162,7 +162,7 @@ def get_USGS_samples( - Southern-most latitude - Eastern-most longitude - Northern-most longitude - Example: [-92.8,44.2,-88.9,46.0] + Example: '-92.8,44.2,-88.9,46.0' countryFips : string or list of strings, optional Example: "US" (United States) stateFips : string or list of strings, optional @@ -210,19 +210,55 @@ def get_USGS_samples( Internal AQS record identifier that returns 1 entry. Only available for the "results" service. mimeType : string, optional + + Returns + ------- + df : ``pandas.DataFrame`` + Formatted data returned from the API query. + md : :obj:`dataretrieval.utils.Metadata` + Custom ``dataretrieval`` metadata object pertaining to the query. + + Examples + -------- + .. code:: + + >>> # Get PFAS results within a bounding box + >>> df, md = dataretrieval.samples.get_USGS_samples( + ... boundingBox="-90.2,42.6,-88.7,43.2", + ... characteristicGroup="Organics, PFAS" + ... ) + >>> # Get all activities for the Commonwealth of Virginia over a date range + >>> df, md = dataretrieval.samples.get_USGS_samples( + ... service="activities", + ... profile="sampact", + ... activityStartDateLower="2023-10-01", + ... activityStartDateUpper="2024-01-01", + ... stateFips="US:51") """ _check_profiles(service, profile) # Get all not-None inputs - params = {key: value for key, value in locals().items() if value is not None and key not in ['service', 'profile']} + params = {key: value for key, value in locals().items() if value is not None and key not in ['service', 'profile', 'ssl_check']} + + if len(params) == 1 and 'mimeType' in params: + raise TypeError("No filter parameters provided. You must add at least " + "one filter parameter beyond a service, profile, and format argument.") # Build URL with service and profile url = BASE_URL + service + "/" + profile + + # Print URL + req = PreparedRequest() + req.prepare_url(url, params=params) + print(f"Request: {req.url}") + # Make a GET request with the filtered parameters - response = requests.get(url, params=params) + response = query(url, params, delimiter=";", ssl_check=ssl_check) + + df = pd.read_csv(StringIO(response.text), delimiter=",") - return response + return df, BaseMetadata(response) From 7c2cdeb803db427354204203cbe671d9b0eaff34 Mon Sep 17 00:00:00 2001 From: Elise Hinman Date: Thu, 27 Mar 2025 17:23:02 -0500 Subject: [PATCH 04/21] get rid of semicolon delimiter --- dataretrieval/samples.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dataretrieval/samples.py b/dataretrieval/samples.py index e6f204d3..353b4f05 100644 --- a/dataretrieval/samples.py +++ b/dataretrieval/samples.py @@ -255,10 +255,11 @@ def get_USGS_samples( print(f"Request: {req.url}") # Make a GET request with the filtered parameters - response = query(url, params, delimiter=";", ssl_check=ssl_check) + response = query(url, params, ssl_check=ssl_check) df = pd.read_csv(StringIO(response.text), delimiter=",") - return df, BaseMetadata(response) + #return response + return df, BaseMetadata(response) From d3b44309c469e5d433dc41b0908b46167627f1dd Mon Sep 17 00:00:00 2001 From: Elise Hinman Date: Fri, 28 Mar 2025 10:46:56 -0500 Subject: [PATCH 05/21] edit samples request to handle lists --- dataretrieval/samples.py | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/dataretrieval/samples.py b/dataretrieval/samples.py index 353b4f05..75c1c558 100644 --- a/dataretrieval/samples.py +++ b/dataretrieval/samples.py @@ -10,12 +10,13 @@ import warnings import requests from requests.models import PreparedRequest +from typing import List, Optional, Tuple, Union from io import StringIO from typing import TYPE_CHECKING import pandas as pd -from utils import BaseMetadata, query +from utils import BaseMetadata, query, to_str if TYPE_CHECKING: from pandas import DataFrame @@ -89,9 +90,8 @@ def get_USGS_samples( pointLocationLongitude=None, pointLocationWithinMiles=None, projectIdentifier=None, - recordIdentifierUserSupplied=None, - mimeType="text/csv" -): + recordIdentifierUserSupplied=None +) -> Tuple[pd.DataFrame, BaseMetadata]: """Search Samples database for USGS water quality data. This is a wrapper function for the Samples database API. All potential filters are provided as arguments to the function, but please do not @@ -150,7 +150,7 @@ def get_USGS_samples( Example: "Suspended Sediment Discharge" characteristicUserSupplied : string or list of strings, optional A user supplied characteristic name describing one or more results. - boundingBox: string of four floats, optional + boundingBox: list of four floats, optional Filters on the the associated monitoring location's point location by checking if it is located within the specified geographic area. The logic is inclusive, i.e. it will include locations that overlap @@ -162,7 +162,7 @@ def get_USGS_samples( - Southern-most latitude - Eastern-most longitude - Northern-most longitude - Example: '-92.8,44.2,-88.9,46.0' + Example: [-92.8,44.2,-88.9,46.0] countryFips : string or list of strings, optional Example: "US" (United States) stateFips : string or list of strings, optional @@ -224,7 +224,7 @@ def get_USGS_samples( >>> # Get PFAS results within a bounding box >>> df, md = dataretrieval.samples.get_USGS_samples( - ... boundingBox="-90.2,42.6,-88.7,43.2", + ... boundingBox=[-90.2,42.6,-88.7,43.2], ... characteristicGroup="Organics, PFAS" ... ) @@ -242,9 +242,16 @@ def get_USGS_samples( # Get all not-None inputs params = {key: value for key, value in locals().items() if value is not None and key not in ['service', 'profile', 'ssl_check']} - if len(params) == 1 and 'mimeType' in params: + if len(params) == 0: raise TypeError("No filter parameters provided. You must add at least " "one filter parameter beyond a service, profile, and format argument.") + + # Add in file format (could be an input, too, though not sure about other formats) + params['mimeType'] = "text/csv" + + # Convert bounding box to a string + if "boundingBox" in params: + params['boundingBox'] = to_str(params['boundingBox']) # Build URL with service and profile url = BASE_URL + service + "/" + profile @@ -255,11 +262,12 @@ def get_USGS_samples( print(f"Request: {req.url}") # Make a GET request with the filtered parameters - response = query(url, params, ssl_check=ssl_check) + response = requests.get(url, params=params, verify=ssl_check) + + response.raise_for_status df = pd.read_csv(StringIO(response.text), delimiter=",") #return response return df, BaseMetadata(response) - From fb94aa0969f657a019d4ed63ecf917ed92e59f23 Mon Sep 17 00:00:00 2001 From: Elise Hinman Date: Fri, 28 Mar 2025 11:01:52 -0500 Subject: [PATCH 06/21] add example --- dataretrieval/samples.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dataretrieval/samples.py b/dataretrieval/samples.py index 75c1c558..1c849f99 100644 --- a/dataretrieval/samples.py +++ b/dataretrieval/samples.py @@ -236,6 +236,11 @@ def get_USGS_samples( ... activityStartDateUpper="2024-01-01", ... stateFips="US:51") + >>> # Get all pH samples for two sites in Utah + >>> df, md = dataretrieval.samples.get_USGS_samples( + ... monitoringLocationIdentifier=['USGS-393147111462301', 'USGS-393343111454101'], + ... usgsPCode='00400') + """ _check_profiles(service, profile) From 6027a32c28058b7e223c02a12d29b397b9bfb144 Mon Sep 17 00:00:00 2001 From: Elise Hinman Date: Fri, 28 Mar 2025 13:46:40 -0500 Subject: [PATCH 07/21] small documentation edits --- dataretrieval/samples.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dataretrieval/samples.py b/dataretrieval/samples.py index 1c849f99..1ea61869 100644 --- a/dataretrieval/samples.py +++ b/dataretrieval/samples.py @@ -3,6 +3,10 @@ See https://api.waterdata.usgs.gov/samples-data/docs#/ for API reference +Not sure about avilable site types, characteristics, state codes, or other +input parameters? Check out the samples data code service API reference: +https://api.waterdata.usgs.gov/samples-data/codeservice/docs + """ from __future__ import annotations @@ -127,16 +131,17 @@ def get_USGS_samples( projects - "project", "projectmonitoringlocationweight" organizations - "organization", "count" activityMediaName : string or list of strings, optional - Name or code indicating environmental medium sample was taken. + Name or code indicating environmental medium in which sample was taken. Example: "Water". activityStartDateLower : string, optional The start date if using a date range. Takes the format YYYY-MM-DD. The logic is inclusive, i.e. it will also return results that - match the date. + match the date. If left as None, will pull all data on or before + activityStartDateUpper, of populated. activityStartDateUpper : string, optional The end date if using a date range. Takes the format YYYY-MM-DD. The logic is inclusive, i.e. it will also return results that - match the date. If left as None, will pull all data before + match the date. If left as None, will pull all data after activityStartDateLower up to the most recent available results. activityTypeCode : string or list of strings, optional Text code that describes type of field activity performed. From dfef6546594762f68c90c02ac103f7f74deb32a3 Mon Sep 17 00:00:00 2001 From: Elise Hinman <121896266+ehinman@users.noreply.github.com> Date: Wed, 2 Apr 2025 08:30:53 -0500 Subject: [PATCH 08/21] Update dataretrieval/samples.py Co-authored-by: Joe Zemmels (he/him) --- dataretrieval/samples.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dataretrieval/samples.py b/dataretrieval/samples.py index 1ea61869..6a9d8e5d 100644 --- a/dataretrieval/samples.py +++ b/dataretrieval/samples.py @@ -3,7 +3,7 @@ See https://api.waterdata.usgs.gov/samples-data/docs#/ for API reference -Not sure about avilable site types, characteristics, state codes, or other +Not sure about available site types, characteristics, state codes, or other input parameters? Check out the samples data code service API reference: https://api.waterdata.usgs.gov/samples-data/codeservice/docs From 746f7837bd0186fd46cfd7ac4778ce9327ef1957 Mon Sep 17 00:00:00 2001 From: Elise Hinman Date: Wed, 2 Apr 2025 08:35:11 -0500 Subject: [PATCH 09/21] fix typos --- dataretrieval/samples.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dataretrieval/samples.py b/dataretrieval/samples.py index 6a9d8e5d..365d67d0 100644 --- a/dataretrieval/samples.py +++ b/dataretrieval/samples.py @@ -137,7 +137,7 @@ def get_USGS_samples( The start date if using a date range. Takes the format YYYY-MM-DD. The logic is inclusive, i.e. it will also return results that match the date. If left as None, will pull all data on or before - activityStartDateUpper, of populated. + activityStartDateUpper, if populated. activityStartDateUpper : string, optional The end date if using a date range. Takes the format YYYY-MM-DD. The logic is inclusive, i.e. it will also return results that @@ -147,10 +147,10 @@ def get_USGS_samples( Text code that describes type of field activity performed. Example: "Sample-Routine, regular". characteristicGroup : string or list of strings, optional - Characteristic group is a broad category describing one or more - of results. + Characteristic group is a broad category of characteristics + describing one or more results. Example: "Organics, PFAS" - characteristc : string or list of strings, optional + characteristic : string or list of strings, optional Characteristic is a specific category describing one or more results. Example: "Suspended Sediment Discharge" characteristicUserSupplied : string or list of strings, optional From 84b715bc51ce9fe97b803f4c8a51492a983d0dbe Mon Sep 17 00:00:00 2001 From: Elise Hinman Date: Wed, 2 Apr 2025 09:18:40 -0500 Subject: [PATCH 10/21] add project identifier example --- dataretrieval/samples.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dataretrieval/samples.py b/dataretrieval/samples.py index 365d67d0..3066c620 100644 --- a/dataretrieval/samples.py +++ b/dataretrieval/samples.py @@ -209,8 +209,9 @@ def get_USGS_samples( Radius for a point/radius query. Must be used with pointLocationLatitude and pointLocationLongitude projectIdentifier : string or list of strings, optional - Designator used to uniquely id a data collection project in - organization context. + Designator used to uniquely identify a data collection project. Project + identifiers are specific to an organization (e.g. USGS). + Example: "ZH003QW03" recordIdentifierUserSupplied : string or list of strings, optional Internal AQS record identifier that returns 1 entry. Only available for the "results" service. From f367bad0dd729b96dfb7d1e328350d24ba7df7ac Mon Sep 17 00:00:00 2001 From: Elise Hinman Date: Wed, 23 Apr 2025 15:21:00 -0500 Subject: [PATCH 11/21] add lookup tables --- dataretrieval/samples.py | 132 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) diff --git a/dataretrieval/samples.py b/dataretrieval/samples.py index 3066c620..0e58b74b 100644 --- a/dataretrieval/samples.py +++ b/dataretrieval/samples.py @@ -16,6 +16,7 @@ from requests.models import PreparedRequest from typing import List, Optional, Tuple, Union from io import StringIO +import json from typing import TYPE_CHECKING import pandas as pd @@ -69,6 +70,137 @@ def _check_profiles( f"{services_dict[service]}." ) +def _get_codeservice(input_name): + """Grab dataframe from Samples code service. + + Parameters + ---------- + input_name : string + One of the following options: "states", "counties", + "sitetype", "samplemedia", "characteristicgroup", + "characteristics", or "observedproperty" + """ + + url = "https://api.waterdata.usgs.gov/samples-data/codeservice/" + input_name + "?mimeType=application%2Fjson" + + response = requests.get(url) + + response.raise_for_status + + # Extract json + data_dict = json.loads(response.text) + + # Convert to list + data_list = data_dict['data'] + + # Create lookup dataFrame + df = pd.DataFrame(data_list) + + return df + +def stateFips_lookup(): + """Code service that returns a dataframe of all possible stateFips codes to be used + in `get_USGS_samples()` + + Parameters + ---------- + None, returns a standard pandas dataframe of all FIPS codes. + + """ + df = _get_codeservice(input_name="states") + + df['stateFips'] = "US:" + df['fipsCode'] + + df = df[['stateName', 'stateFips']] + + return df + +def countyFips_lookup(): + """Code service that returns a dataframe of all possible countyFips codes to be used + in `get_USGS_samples()` + + Parameters + ---------- + None, returns a standard pandas dataframe of all FIPS codes. + + """ + counties = _get_codeservice(input_name="counties") + states = _get_codeservice(input_name="states") + + county_states = pd.merge(counties[['countyCode', 'countyName', 'stateAbbrev']], states[['stateAbbrev', 'fipsCode', 'stateName']], on="stateAbbrev", how="left") + + county_states['countyFips'] = "US:" + county_states['fipsCode'] + ":" + county_states['countyCode'] + + df = county_states[['stateName', 'countyName', 'countyFips']] + + return df + +def siteType_lookup(): + """Code service that returns a dataframe of all possible siteType values and + siteTypeName values to be used in `get_USGS_samples()` + + Parameters + ---------- + None, returns a standard pandas dataframe of all FIPS codes. + + """ + df = _get_codeservice(input_name="sitetype") + + df.rename(columns={'typeCode': 'siteTypeCode', + 'typeName': 'siteTypeName'}, + inplace=True) + + df = df[['siteTypeCode', 'siteTypeName', 'typeDescription']] + + return df + +def activityMediaName_lookup(): + """Code service that returns a dataframe of all possible activityMediaName values + to be used in `get_USGS_samples()` + + Parameters + ---------- + None, returns a standard pandas dataframe of all activityMediaName values. + + """ + df = _get_codeservice(input_name="samplemedia") + + df.rename(columns={'activityMedia': 'activityMediaName'}, + inplace=True) + + df = df[['activityMediaName']] + + return df + +def characteristicGroup_lookup(): + """Code service that returns a dataframe of all possible characteristicGroup values + to be used in `get_USGS_samples()` + + Parameters + ---------- + None, returns a standard pandas dataframe of all characteristicGroup values. + + """ + df = _get_codeservice(input_name="characteristicgroup") + + return df + +def characteristic_lookup(): + """Code service that returns a dataframe of all possible characteristic values, + USGS pcodes, and their associated characteristicGroup to be used in `get_USGS_samples()` + + Parameters + ---------- + None, returns a standard pandas dataframe of all characteristic values. + + """ + df = _get_codeservice(input_name="characteristics") + + df.rename(columns={'parameterCode': 'usgsPCode'}, + inplace=True) + + return df + def get_USGS_samples( ssl_check=True, service="results", From 327484a80e821725345e5bc64ae083af484a6525 Mon Sep 17 00:00:00 2001 From: Elise Hinman Date: Wed, 23 Apr 2025 17:11:52 -0500 Subject: [PATCH 12/21] add samples to documentation --- dataretrieval/__init__.py | 1 + docs/source/reference/index.rst | 1 + docs/source/reference/samples.rst | 8 ++++++++ docs/source/userguide/dataportals.rst | 2 ++ 4 files changed, 12 insertions(+) create mode 100644 docs/source/reference/samples.rst diff --git a/dataretrieval/__init__.py b/dataretrieval/__init__.py index a52c04c3..ec3aacfa 100644 --- a/dataretrieval/__init__.py +++ b/dataretrieval/__init__.py @@ -6,6 +6,7 @@ from dataretrieval.utils import * from dataretrieval.waterwatch import * from dataretrieval.wqp import * +from dataretrieval.samples import * try: __version__ = version("dataretrieval") diff --git a/docs/source/reference/index.rst b/docs/source/reference/index.rst index 4a0d14fe..a2515073 100644 --- a/docs/source/reference/index.rst +++ b/docs/source/reference/index.rst @@ -9,6 +9,7 @@ API reference nadp nwis + samples streamstats utils wqp diff --git a/docs/source/reference/samples.rst b/docs/source/reference/samples.rst new file mode 100644 index 00000000..40f759da --- /dev/null +++ b/docs/source/reference/samples.rst @@ -0,0 +1,8 @@ +.. _samples + +dataretrieval.samples +------------------------- + +.. automodule:: dataretrieval.samples + :members: + :special-members: \ No newline at end of file diff --git a/docs/source/userguide/dataportals.rst b/docs/source/userguide/dataportals.rst index f39a764b..4bb475fd 100644 --- a/docs/source/userguide/dataportals.rst +++ b/docs/source/userguide/dataportals.rst @@ -17,6 +17,8 @@ provided below. +-----------------------------------+---------------------------------------------------------------+ | Mercury Deposition Network | https://nadp.slh.wisc.edu/networks/mercury-deposition-network | +-----------------------------------+---------------------------------------------------------------+ +| USGS Samples | https://waterdata.usgs.gov/download-samples/ | ++-----------------------------------+---------------------------------------------------------------+ | Streamstats | https://streamstats.usgs.gov | +-----------------------------------+---------------------------------------------------------------+ | Water Quality Portal | https://waterqualitydata.us | From 198c1327380a04f010c226b2168df5f2d5b8ab70 Mon Sep 17 00:00:00 2001 From: Elise Hinman Date: Wed, 23 Apr 2025 17:14:28 -0500 Subject: [PATCH 13/21] add some testing --- dataretrieval/samples.py | 2 +- tests/data/samples_results.txt | 68 ++++++++++++++++++++++++++++++++++ tests/samples_test.py | 57 ++++++++++++++++++++++++++++ 3 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 tests/data/samples_results.txt create mode 100755 tests/samples_test.py diff --git a/dataretrieval/samples.py b/dataretrieval/samples.py index 0e58b74b..ea17e3b5 100644 --- a/dataretrieval/samples.py +++ b/dataretrieval/samples.py @@ -21,7 +21,7 @@ import pandas as pd -from utils import BaseMetadata, query, to_str +from dataretrieval.utils import BaseMetadata, to_str if TYPE_CHECKING: from pandas import DataFrame diff --git a/tests/data/samples_results.txt b/tests/data/samples_results.txt new file mode 100644 index 00000000..ae97b4f6 --- /dev/null +++ b/tests/data/samples_results.txt @@ -0,0 +1,68 @@ +Org_Identifier,Org_FormalName,Project_Identifier,Project_Name,Project_QAPPApproved,Project_QAPPApprovalAgency,ProjectAttachment_FileName,ProjectAttachment_FileType,Location_Identifier,Location_Name,Location_Type,Location_Description,Location_State,Location_CountryName,Location_CountyName,Location_CountryCode,Location_StatePostalCode,Location_CountyCode,Location_HUCEightDigitCode,Location_HUCTwelveDigitCode,Location_TribalLandIndicator,Location_TribalLand,Location_Latitude,Location_Longitude,Location_HorzCoordReferenceSystemDatum,Location_LatitudeStandardized,Location_LongitudeStandardized,Location_HorzCoordStandardizedDatum,AlternateLocation_IdentifierCount,Activity_ActivityIdentifier,Activity_ActivityIdentifierUserSupplied,Activity_TypeCode,Activity_Media,Activity_MediaSubdivision,Activity_BottomDepthSamplingComponent,ActivityBiological_AssemblageSampled,ActivityBiological_ToxicityTestType,Activity_ConductingOrganization,Activity_Comment,ActivityLocation_Latitude,ActivityLocation_Longitude,ActivityLocation_HorzCoordReferenceSystemDatum,ActivityLocation_SourceMapScale,ActivityLocation_LatitudeStandardized,ActivityLocation_LongitudeStandardized,ActivityLocation_HorzCoordStandardizedDatum,ActivityLocation_HorzAccuracyMeasure,ActivityLocation_HorzAccuracyMeasureUnit,ActivityLocation_HorizontalAccuracyHorzCollectionMethod,ActivityLocation_Description,Activity_StartDate,Activity_StartTime,Activity_StartTimeZone,Activity_EndDate,Activity_EndTime,Activity_EndTimeZone,Activity_DepthHeightMeasure,Activity_DepthHeightMeasureUnit,Activity_BottomDepthAltitudeReferencePoint,Activity_ActivityRelativeDepth,Activity_TopDepthMeasure,Activity_TopDepthMeasureUnit,Activity_BottomDepthMeasure,Activity_BottomDepthMeasureUnit,SampleCollectionMethod_Identifier,SampleCollectionMethod_IdentifierContext,SampleCollectionMethod_Name,SampleCollectionMethod_QualifierTypeName,SampleCollectionMethod_Description,SampleCollectionMethod_EquipmentName,SampleCollectionMethod_EquipmentComment,SamplePrepMethod_Identifier,SamplePrepMethod_IdentifierContext,SamplePrepMethod_Name,SamplePrepMethod_QualifierType,SamplePrepMethod_Description,SamplePrepMethod_ContainerLabel,SamplePrepMethod_ContainerType,SamplePrepMethod_ContainerColor,SamplePrepMethod_ChemicalPreservativeUsed,SamplePrepMethod_ThermalPreservativeUsed,SamplePrepMethod_TransportStorageDescription,Activity_HydrologicCondition,Activity_HydrologicEvent,ActivityAttachment_FileName,ActivityAttachment_FileType,ActivityAttachment_FileDownload,Result_DataLoggerLine,Result_ResultDetectionCondition,Result_Characteristic,Result_CharacteristicUserSupplied,Result_CASNumber,Result_MethodSpeciation,Result_SampleFraction,ResultBiological_Intent,ResultBiological_IndividualIdentifier,ResultBiological_Taxon,ResultBiological_TaxonUserSupplied,ResultBiological_TaxonUserSuppliedReference,ResultBiological_UnidentifiedSpeciesIdentifier,ResultBiological_SampleTissueAnatomy,ResultBiological_GroupSummaryCount,GroupSummaryWeight_Measure,GroupSummaryWeight_MeasureUnit,ResultDepthHeight_Measure,ResultDepthHeight_MeasureUnit,ResultDepthHeight_AltitudeReferencePoint,ResultDepthHeight_SamplingPointName,ResultDepthHeight_SamplingPointType,ResultDepthHeight_SamplingPointPlaceInSeries,ResultDepthHeight_SamplingPointComment,ResultDepthHeight_RecordIdentifierUserSupplied,Result_MeasureIdentifier,Result_Measure,Result_MeasureUnit,Result_MeasureQualifierCode,Result_MeasureStatusIdentifier,Result_StatisticalBase,Result_StatisticalNValue,Result_MeasureType,Result_WeightBasis,Result_TimeBasis,Result_MeasureTemperatureBasis,Result_MeasureParticleSizeBasis,DataQuality_PrecisionValue,DataQuality_BiasValue,DataQuality_ConfidenceIntervalValue,DataQuality_UpperConfidenceLimitValue,DataQuality_LowerConfidenceLimitValue,DataQuality_ResultComment,DetectionLimit_TypeA,DetectionLimit_MeasureA,DetectionLimit_MeasureUnitA,DetectionLimit_CommentA,DetectionLimit_TypeB,DetectionLimit_MeasureB,DetectionLimit_MeasureUnitB,DetectionLimit_CommentB,LabInfo_LabSampleSplitRatio,LabInfo_LabAccreditationIndicator,LabInfo_LabAccreditationAuthority,LabInfo_TaxonAccreditationIndicator,LabInfo_TaxonAccreditationAuthority,ResultAnalyticalMethod_Identifier,ResultAnalyticalMethod_IdentifierContext,ResultAnalyticalMethod_Name,ResultAnalyticalMethod_QualifierType,ResultAnalyticalMethod_Description,Result_ComparableMethodIdentifier,Result_ComparableMethodIdentifierContext,Result_ComparableMethodModification,LabInfo_Name,LabInfo_AnalysisStartDate,LabInfo_AnalysisStartTime,LabInfo_AnalysisStartTimeZone,LabInfo_AnalysisEndDate,LabInfo_AnalysisEndTime,LabInfo_AnalysisEndTimeZone,LabInfo_LaboratoryComment,LabSamplePrepMethod_Identifier,LabSamplePrepMethod_IdentifierContext,LabSamplePrepMethod_Name,LabSamplePrepMethod_QualifierType,LabSamplePrepMethod_Description,LabSamplePrepMethod_StartDate,LabSamplePrepMethod_StartTime,LabSamplePrepMethod_StartTimeZone,LabSamplePrepMethod_EndDate,LabSamplePrepMethod_EndTime,LabSamplePrepMethod_EndTimeZone,LabSamplePrepMethod_DilutionFactor,ResultAttachment_FileName,ResultAttachment_FileType,ResultAttachment_FileDownload,ProviderName,Result_CharacteristicComparable,Result_CharacteristicGroup,Org_Type,LastChangeDate,USGSpcode,USGSSampleAquifer +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,3e391eba-82b6-4908-b748-c2530da5101a,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,Generated activity from observation import file file49fc4f806143_8aacbd2a-51b6-42d0-9902-2ba17d9c69e8.csv,,,,,,,,,,,,2023-08-22,08:50:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,"Stream flow, instantaneous","Discharge, instantaneous",,,,,,,,,,,,,,,,,,,,,,c9fc7217-d3c8-4fb8-a13e-6f3497c5f82f,42.0,ft3/sec,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Physical,Federal/US Government,2025-04-21,61, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,pH,"pH, water, unfiltered, field",,,Unfiltered,,,,,,,,,,,,,,,,,,,077af737-143f-4329-9153-bd1c31648b05,8.0,standard units,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Physical,Federal/US Government,2025-04-21,400, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,12456992-7a77-43f9-9f29-349704362650,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,"WATER MICROBIOLOGY SAMPLE RECEIVED WARM, COLLECTED SAME DAY. RESULTS VALID",,,,,,,,,,,,2023-06-20,09:25:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,"Acidity, (H+)","Hydrogen ion, water, unfiltered, calculated",12408-02-5,,Unfiltered,,,,,,,,,,,,,,,,,,,b652b25a-1c62-4a65-a412-0869d50033f3,1e-05,mg/L,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,ALGOR,USDOI/USGS,Computation by NWIS algorithm,,"DESCRIPTION: Computation by NWIS algorithm; CITATION(S): U.S. Geological Survey, [revised annually], Option 7 -- Display algorithm in reverse polish notation (RPN), in User's Manual for the National Water Information System of the U.S. Geological Survey--Water-Quality System: U.S. Geological Survey, accessed on June 26, 2012, at URL http://nwis.usgs.gov/currentdocs/index.html",,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,"Inorganics, Major, Non-metals",Federal/US Government,2025-04-21,191, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,"Acidity, (H+)","Hydrogen ion, water, unfiltered, calculated",12408-02-5,,Unfiltered,,,,,,,,,,,,,,,,,,,192805bc-c4db-4fea-b46b-70b926b970d9,1e-05,mg/L,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,ALGOR,USDOI/USGS,Computation by NWIS algorithm,,"DESCRIPTION: Computation by NWIS algorithm; CITATION(S): U.S. Geological Survey, [revised annually], Option 7 -- Display algorithm in reverse polish notation (RPN), in User's Manual for the National Water Information System of the U.S. Geological Survey--Water-Quality System: U.S. Geological Survey, accessed on June 26, 2012, at URL http://nwis.usgs.gov/currentdocs/index.html",,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,"Inorganics, Major, Non-metals",Federal/US Government,2025-04-21,191, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Dissolved oxygen (DO),"Dissolved oxygen (DO), water, unfiltered",7782-44-7,,Unfiltered,,,,,,,,,,,,,,,,,,,e19083d2-0c60-4e28-a207-caaee5422300,8.4,mg/L,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,"Inorganics, Major, Non-metals",Federal/US Government,2025-04-22,300, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,3e391eba-82b6-4908-b748-c2530da5101a,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,Generated activity from observation import file file49fc4f806143_8aacbd2a-51b6-42d0-9902-2ba17d9c69e8.csv,,,,,,,,,,,,2023-08-22,08:50:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Escherichia coli,"Escherichia coli (most probable number), water, defined substrate test method (DSTM)",,,,,,,,,,,,,,,,,,,,,,75472222-53b8-4e1e-a935-dbc1811485ac,490.0,MPN/100mL,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"State Laboratory of Hygiene, Wisconsin",2023-08-23,,,,,,,,,,,,,,,,,,,,,,USGS,,Microbiological,Federal/US Government,2025-04-21,50468, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Inorganic nitrogen (nitrate and nitrite),"Nitrate plus nitrite as nitrogen, water, filtered",,as N,Filtered field and/or lab,,,,,,,,,,,,,,,,,,,3ac17ab2-3836-4dff-b701-eb3cb22faa2b,2.73,mg/L,,Provisional,,,Actual,,,,,,,,,,Hold time parameters were exceeded during the collection to analysis phase of sample processing,,,,,Detection limit by DQCALC,0.04,mg/L,Quantitation limit value of the specified type,,,,,,RED01,USDOI/USGS,"NO3+NO2, wf, FCC,NaR, DA",,"DESCRIPTION: Nitrate + nitrite, filtered water, enzymatic reduction, Griess Reaction colorimetry, automated discrete analyzer, standard range; CITATION(S): Patton, C.J., and Kryskalla, J.R., 2011, Colorimetric determination of nitrate plus nitrite in water by enzymatic reduction, automated discrete analyzer methods: U.S. Geological Survey Techniques and Methods, book 5, chap. B8, 34 p. | USGS | I-2547-11",,,,"USGS-National Water Quality Lab, Denver, CO",2023-09-14,,,,,,[@ - holding time exceeded];[c - see result laboratory comment],,,,,,,,,,,,,,,,USGS,,Nutrient,Federal/US Government,2025-04-21,631, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Nitrite,"Nitrite as nitrite, water, filtered",14797-65-0,as NO2,Filtered field and/or lab,,,,,,,,,,,,,,,,,,,3a1b4502-97bc-4d2d-9947-f490e0507cd9,0.061,mg/L,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,ALGOR,USDOI/USGS,Computation by NWIS algorithm,,"DESCRIPTION: Computation by NWIS algorithm; CITATION(S): U.S. Geological Survey, [revised annually], Option 7 -- Display algorithm in reverse polish notation (RPN), in User's Manual for the National Water Information System of the U.S. Geological Survey--Water-Quality System: U.S. Geological Survey, accessed on June 26, 2012, at URL http://nwis.usgs.gov/currentdocs/index.html",,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Nutrient,Federal/US Government,2025-04-21,71856, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,3e391eba-82b6-4908-b748-c2530da5101a,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,Generated activity from observation import file file49fc4f806143_8aacbd2a-51b6-42d0-9902-2ba17d9c69e8.csv,,,,,,,,,,,,2023-08-22,08:50:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Chloride,"Chloride, water, filtered",16887-00-6,,Filtered field and/or lab,,,,,,,,,,,,,,,,,,,fb754112-b85a-48f5-9223-e96d95dc4806,30.0,mg/L,,Provisional,,,Actual,,,,,,,,,,,,,,,Detection limit by DQCALC,0.05,mg/L,Quantitation limit value of the specified type,,,,,,IC022,USDOI/USGS,"Anions, wf, IC",,"DESCRIPTION: Anions, filtered water, ion chromatography; CITATION(S): Fishman, M.J., ed., 1993, Methods of analysis by the U.S. Geological Survey National Water Quality Laboratory--Determination of inorganic and organic constituents in water and fluvial sediments: U.S. Geological Survey Open-File Report 93-125, p. 19-25. | USGS | I-2057-90 |<--->| American Public Health Association and American Water Works Association, 2012, Standard methods for the examination of water and wastewater (22d ed.): Washington, D.C., American Public Health Association, method 4110 B-2011, p. 4-5 through 4-7. | STDMETH | 4110 B-2011",,,,"USGS-National Water Quality Lab, Denver, CO",2023-09-07,,,,,,,,,,,,,,,,,,,,,,USGS,,"Inorganics, Major, Non-metals",Federal/US Government,2025-04-21,940, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Escherichia coli,"Escherichia coli (most probable number), water, defined substrate test method (DSTM)",,,,,,,,,,,,,,,,,,,,,,c993884a-c393-497a-a6e9-86941dab7f54,340.0,MPN/100mL,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"State Laboratory of Hygiene, Wisconsin",2023-07-26,,,,,,,,,,,,,,,,,,,,,,USGS,,Microbiological,Federal/US Government,2025-04-22,50468, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Nitrite,"Nitrite as nitrogen, water, filtered",14797-65-0,as N,Filtered field and/or lab,,,,,,,,,,,,,,,,,,,db3c7d88-df05-4860-ad81-8f70cdf34aec,0.019,mg/L,,Provisional,,,Actual,,,,,,,,,,,,,,,Detection limit by DQCALC,0.001,mg/L,Quantitation limit value of the specified type,,,,,,DZ001,USDOI/USGS,"Nitrite, wf, DA, diazo",,"DESCRIPTION: Nitrite, filtered water, discrete analyzer, diazotization and colorimetry (formerly Mcode 00049); CITATION(S): Fishman, M.J., ed., 1993, Methods of analysis by the U.S. Geological Survey National Water Quality Laboratory--Determination of inorganic and organic constituents in water and fluvial sediments: U.S. Geological Survey Open-File Report 93-125, 217 p., https://pubs.er.usgs.gov/publication/ofr93125 | USGS ",,,,"USGS-National Water Quality Lab, Denver, CO",2023-08-24,,,,,,,,,,,,,,,,,,,,,,USGS,,Nutrient,Federal/US Government,2025-04-22,613, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,Not Detected,Ammonia and ammonium,"Total ammonia (NH4+ and NH3) as ammonium, water, filtered",,as NH4,Filtered field and/or lab,,,,,,,,,,,,,,,,,,,135972a0-2073-45c8-8c57-f22751d6b7b0,,,,Provisional,,,Actual,,,,,,,,,,,Censoring Level,0.026,mg/L,Quantitation limit value associated with a < or > legacy remark code in USGS source data,,,,,,,,,,ALGOR,USDOI/USGS,Computation by NWIS algorithm,,"DESCRIPTION: Computation by NWIS algorithm; CITATION(S): U.S. Geological Survey, [revised annually], Option 7 -- Display algorithm in reverse polish notation (RPN), in User's Manual for the National Water Information System of the U.S. Geological Survey--Water-Quality System: U.S. Geological Survey, accessed on June 26, 2012, at URL http://nwis.usgs.gov/currentdocs/index.html",,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Nutrient,Federal/US Government,2025-04-22,71846, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,3e391eba-82b6-4908-b748-c2530da5101a,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,Generated activity from observation import file file49fc4f806143_8aacbd2a-51b6-42d0-9902-2ba17d9c69e8.csv,,,,,,,,,,,,2023-08-22,08:50:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Dissolved oxygen saturation,"Dissolved oxygen (DO) saturation, water, unfiltered",7782-44-7,,Unfiltered,,,,,,,,,,,,,,,,,,,22359e05-756b-4e34-b9cd-b8f9141b0825,88.0,%,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,ALGOR,USDOI/USGS,Computation by NWIS algorithm,,"DESCRIPTION: Computation by NWIS algorithm; CITATION(S): U.S. Geological Survey, [revised annually], Option 7 -- Display algorithm in reverse polish notation (RPN), in User's Manual for the National Water Information System of the U.S. Geological Survey--Water-Quality System: U.S. Geological Survey, accessed on June 26, 2012, at URL http://nwis.usgs.gov/currentdocs/index.html",,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,"Inorganics, Major, Non-metals",Federal/US Government,2025-04-21,301, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Specific conductance,"Specific conductance, water, unfiltered, normalized to 25 degrees Celsius",,,Unfiltered,,,,,,,,,,,,,,,,,,,0c34df79-5165-4797-8064-416ac97bd613,666.0,uS/cm,,Provisional,,,Actual,,,25 Deg C,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Physical,Federal/US Government,2025-04-21,95, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,3e391eba-82b6-4908-b748-c2530da5101a,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,Generated activity from observation import file file49fc4f806143_8aacbd2a-51b6-42d0-9902-2ba17d9c69e8.csv,,,,,,,,,,,,2023-08-22,08:50:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,"Acidity, (H+)","Hydrogen ion, water, unfiltered, calculated",12408-02-5,,Unfiltered,,,,,,,,,,,,,,,,,,,300c6a63-7e21-41d4-90a5-f2132c545df4,1e-05,mg/L,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,ALGOR,USDOI/USGS,Computation by NWIS algorithm,,"DESCRIPTION: Computation by NWIS algorithm; CITATION(S): U.S. Geological Survey, [revised annually], Option 7 -- Display algorithm in reverse polish notation (RPN), in User's Manual for the National Water Information System of the U.S. Geological Survey--Water-Quality System: U.S. Geological Survey, accessed on June 26, 2012, at URL http://nwis.usgs.gov/currentdocs/index.html",,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,"Inorganics, Major, Non-metals",Federal/US Government,2025-04-21,191, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,"Temperature, water","Temperature, water",,,,,,,,,,,,,,,,,,,,,,fcee0689-cf0a-4ff4-a94d-fdf02af206d0,16.2,deg C,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Physical,Federal/US Government,2025-04-21,10, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Orthophosphate,"Orthophosphate as phosphorus, water, filtered",14265-44-2,as P,Filtered field and/or lab,,,,,,,,,,,,,,,,,,,b9f56e62-3199-4717-b576-b7b9195dfd51,0.025,mg/L,,Provisional,,,Actual,,,,,,,,,,,,,,,Detection limit by DQCALC,0.004,mg/L,Quantitation limit value of the specified type,,,,,,PHM01,USDOI/USGS,"Ortho-PO4, wf, DA phos/mol(NWQL)",,"DESCRIPTION: Orthophosphate in filtered water by discrete analyzer phosphomolybdate formation and colorimetry (formerly Mcode 00048); CITATION(S): Fishman, M.J., ed., 1993, Methods of analysis by the U.S. Geological Survey National Water Quality Laboratory--Determination of inorganic and organic constituents in water and fluvial sediments: U.S. Geological Survey Open-File Report 93-125, p. 175-181 and 191-202. Method Numbers: I-2601-90, I-2606-89. [Note: Analytical platform change in 2006 at the USGS NWQL from automated air-segmented flow analyzer to automated discrete analyzer.] |<--->| Murphy, J., and Riley, J.P., 1962, A modified single-solution method for the determination of phosphorus in natural waters: Analytica Chimica Acta, v. 27, p. 31-36. |<--->| Pai, Su-Cheng, Yang, Chung-Cheng, and Riley, J.P., 1990, Effects of acidity and moplybdate concentration on the formation of the phosphoantimonyl-molydenum blue complex: Analytica Chimica Acta, v. 229, p. 115-120.",,,,"USGS-National Water Quality Lab, Denver, CO",2023-08-24,,,,,,,,,,,,,,,,,,,,,,USGS,,Nutrient,Federal/US Government,2025-04-21,671, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,3e391eba-82b6-4908-b748-c2530da5101a,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,Generated activity from observation import file file49fc4f806143_8aacbd2a-51b6-42d0-9902-2ba17d9c69e8.csv,,,,,,,,,,,,2023-08-22,08:50:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Suspended Sediment Load,Suspended sediment flux,,,Unfiltered,,,,,,,,,,,,,,,,,,,b86eaa9a-a825-48ac-898b-debbcfcaf0f0,0.89,tons/day,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,ALGOR,USDOI/USGS,Computation by NWIS algorithm,,"DESCRIPTION: Computation by NWIS algorithm; CITATION(S): U.S. Geological Survey, [revised annually], Option 7 -- Display algorithm in reverse polish notation (RPN), in User's Manual for the National Water Information System of the U.S. Geological Survey--Water-Quality System: U.S. Geological Survey, accessed on June 26, 2012, at URL http://nwis.usgs.gov/currentdocs/index.html",,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Sediment,Federal/US Government,2025-04-21,80155, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,Not Detected,Ammonia and ammonium,"Total ammonia (NH4+ and NH3) as nitrogen, water, filtered",,as N,Filtered field and/or lab,,,,,,,,,,,,,,,,,,,c8cf00b1-aecf-4ffd-92e4-eb18fbfe2f3d,,,,Provisional,,,Actual,,,,,,,,,,Hold time parameters were exceeded during the collection to analysis phase of sample processing,Censoring Level,0.02,mg/L,Quantitation limit value associated with a < or > legacy remark code in USGS source data,Detection limit by DQCALC,0.02,mg/L,Quantitation limit value of the specified type,,,,,,SHC02,USDOI/USGS,"Ammonia, wf, DA sal/hypo (NWQL)",,"DESCRIPTION: Ammonia in filtered water by discrete analyzer salicylate-hypochlorite reaction and colorimetry (formerly Mcode 00048; NWQL); CITATION(S): Fishman, M.J., ed., 1993, Methods of analysis by the U.S. Geological Survey National Water Quality Laboratory--Determination of inorganic and organic constituents in water and fluvial sediments: U.S. Geological Survey Open-File Report 93-125, p. 125-132. | USGS | I-2522-90 |<--->| Harfmann, R.G., and Crouch, J.D., 1989, Kinetic study of Berthelot reaction steps in the absence and presence of coupling reagents: Talanta, v. 36, p. 261-269. |<--->| Krom, M.D., 1980, Spectrophotometric determination of ammonia--A study of a modified Berthelot reaction using salicylate and dichloroisocyanurate: Analyst, v. 105, p. 305-316. |<--->| Patton, C.J., and Crouch, S.R., 1977, Spectrophotometric and kinetics investigation of the Berthelot reaction for the determination of ammonia: Analytical Chemistry, v. 49, p. 464-469.",,,,"USGS-National Water Quality Lab, Denver, CO",2023-08-24,,,,,,[@ - holding time exceeded];[c - see result laboratory comment],,,,,,,,,,,,,,,,USGS,,Nutrient,Federal/US Government,2025-04-21,608, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,12456992-7a77-43f9-9f29-349704362650,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,"WATER MICROBIOLOGY SAMPLE RECEIVED WARM, COLLECTED SAME DAY. RESULTS VALID",,,,,,,,,,,,2023-06-20,09:25:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,pH,"pH, water, unfiltered, field",,,Unfiltered,,,,,,,,,,,,,,,,,,,6ed6fa3d-e0ff-4204-816d-97d18ed35077,8.1,standard units,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Physical,Federal/US Government,2025-04-22,400, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,Not Detected,Organic Nitrogen,"Organic nitrogen as nitrogen, water, unfiltered",,as N,Unfiltered,,,,,,,,,,,,,,,,,,,031d8be0-45b4-45b5-b7a6-5af200f1581e,,,,Provisional,,,Actual,,,,,,,,,,,Censoring Level,0.22,mg/L,Quantitation limit value associated with a < or > legacy remark code in USGS source data,,,,,,,,,,ALGOR,USDOI/USGS,Computation by NWIS algorithm,,"DESCRIPTION: Computation by NWIS algorithm; CITATION(S): U.S. Geological Survey, [revised annually], Option 7 -- Display algorithm in reverse polish notation (RPN), in User's Manual for the National Water Information System of the U.S. Geological Survey--Water-Quality System: U.S. Geological Survey, accessed on June 26, 2012, at URL http://nwis.usgs.gov/currentdocs/index.html",,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Nutrient,Federal/US Government,2025-04-22,605, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Orthophosphate,"Orthophosphate as orthophosphate, water, filtered",14265-44-2,as PO4,Filtered field and/or lab,,,,,,,,,,,,,,,,,,,c4995f6d-87ab-4078-94e4-53b23d7e5b80,0.077,mg/L,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,ALGOR,USDOI/USGS,Computation by NWIS algorithm,,"DESCRIPTION: Computation by NWIS algorithm; CITATION(S): U.S. Geological Survey, [revised annually], Option 7 -- Display algorithm in reverse polish notation (RPN), in User's Manual for the National Water Information System of the U.S. Geological Survey--Water-Quality System: U.S. Geological Survey, accessed on June 26, 2012, at URL http://nwis.usgs.gov/currentdocs/index.html",,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Nutrient,Federal/US Government,2025-04-21,660, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,12456992-7a77-43f9-9f29-349704362650,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,"WATER MICROBIOLOGY SAMPLE RECEIVED WARM, COLLECTED SAME DAY. RESULTS VALID",,,,,,,,,,,,2023-06-20,09:25:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Chloride,"Chloride, water, filtered",16887-00-6,,Filtered field and/or lab,,,,,,,,,,,,,,,,,,,13d8adc1-276e-47dd-839b-1c197785c62a,28.5,mg/L,,Provisional,,,Actual,,,,,,,,,,,,,,,Detection limit by DQCALC,0.05,mg/L,Quantitation limit value of the specified type,,,,,,IC022,USDOI/USGS,"Anions, wf, IC",,"DESCRIPTION: Anions, filtered water, ion chromatography; CITATION(S): Fishman, M.J., ed., 1993, Methods of analysis by the U.S. Geological Survey National Water Quality Laboratory--Determination of inorganic and organic constituents in water and fluvial sediments: U.S. Geological Survey Open-File Report 93-125, p. 19-25. | USGS | I-2057-90 |<--->| American Public Health Association and American Water Works Association, 2012, Standard methods for the examination of water and wastewater (22d ed.): Washington, D.C., American Public Health Association, method 4110 B-2011, p. 4-5 through 4-7. | STDMETH | 4110 B-2011",,,,"USGS-National Water Quality Lab, Denver, CO",2023-06-29,,,,,,,,,,,,,,,,,,,,,,USGS,,"Inorganics, Major, Non-metals",Federal/US Government,2025-04-21,940, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Suspended Sediment Load,Suspended sediment flux,,,Unfiltered,,,,,,,,,,,,,,,,,,,bff162ce-7ed3-4f87-bbe2-fcb07ed3055b,0.65,tons/day,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,ALGOR,USDOI/USGS,Computation by NWIS algorithm,,"DESCRIPTION: Computation by NWIS algorithm; CITATION(S): U.S. Geological Survey, [revised annually], Option 7 -- Display algorithm in reverse polish notation (RPN), in User's Manual for the National Water Information System of the U.S. Geological Survey--Water-Quality System: U.S. Geological Survey, accessed on June 26, 2012, at URL http://nwis.usgs.gov/currentdocs/index.html",,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Sediment,Federal/US Government,2025-04-21,80155, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,12456992-7a77-43f9-9f29-349704362650,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,"WATER MICROBIOLOGY SAMPLE RECEIVED WARM, COLLECTED SAME DAY. RESULTS VALID",,,,,,,,,,,,2023-06-20,09:25:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,"Temperature, water","Temperature, water",,,,,,,,,,,,,,,,,,,,,,cdd29951-d62f-4633-9e73-e98b815ca7a9,15.4,deg C,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Physical,Federal/US Government,2025-04-21,10, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,"Stream flow, instantaneous","Discharge, instantaneous",,,,,,,,,,,,,,,,,,,,,,f09a6de7-f84e-475b-89a1-bb609d06dca0,1.1,m3/sec,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,ALGOR,USDOI/USGS,Computation by NWIS algorithm,,"DESCRIPTION: Computation by NWIS algorithm; CITATION(S): U.S. Geological Survey, [revised annually], Option 7 -- Display algorithm in reverse polish notation (RPN), in User's Manual for the National Water Information System of the U.S. Geological Survey--Water-Quality System: U.S. Geological Survey, accessed on June 26, 2012, at URL http://nwis.usgs.gov/currentdocs/index.html",,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Physical,Federal/US Government,2025-04-21,30209, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Phosphorus,"Phosphorus as phosphorus, water, unfiltered",7723-14-0,as P,Unfiltered,,,,,,,,,,,,,,,,,,,52e2bf3f-6228-4d19-be87-03d9e39d4795,0.045,mg/L,,Provisional,,,Actual,,,,,,,,,,,,,,,Detection limit by DQCALC,0.003,mg/L,Quantitation limit value of the specified type,,,,,,CL021,USDOI/USGS,"P, wu, WCA, persulfate CF color",,"DESCRIPTION: Phosphorus, unfiltered water, acidified, acid-persulfate digestion, continuous flow (CF) colorimetry; CITATION(S): USEPA | 365.1",,,,"USGS-National Water Quality Lab, Denver, CO",2023-08-23,,,,,,,,,,,,,,,,,,,,,,USGS,,Nutrient,Federal/US Government,2025-04-21,665, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,3e391eba-82b6-4908-b748-c2530da5101a,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,Generated activity from observation import file file49fc4f806143_8aacbd2a-51b6-42d0-9902-2ba17d9c69e8.csv,,,,,,,,,,,,2023-08-22,08:50:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,"Temperature, water","Temperature, water",,,,,,,,,,,,,,,,,,,,,,e3751e3f-aba6-40fa-b870-b8815a6ee0c4,16.0,deg C,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Physical,Federal/US Government,2025-04-21,10, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,12456992-7a77-43f9-9f29-349704362650,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,"WATER MICROBIOLOGY SAMPLE RECEIVED WARM, COLLECTED SAME DAY. RESULTS VALID",,,,,,,,,,,,2023-06-20,09:25:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Specific conductance,"Specific conductance, water, unfiltered, normalized to 25 degrees Celsius",,,Unfiltered,,,,,,,,,,,,,,,,,,,b63f900c-63a3-4db5-849a-5f180210669c,657.0,uS/cm,,Provisional,,,Actual,,,25 Deg C,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Physical,Federal/US Government,2025-04-21,95, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Barometric pressure,"Barometric pressure (BP), uncorrected",,,,,,,,,,,,,,,,,,,,,,0238f751-124d-4d68-a6f8-8942a6da6b94,741.0,mmHg,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Physical,Federal/US Government,2025-04-22,25, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Suspended Sediment Concentration (SSC),Suspended sediment concentration,,,Unfiltered,,,,,,,,,,,,,,,,,,,ff078cd5-e011-4116-b59f-16e036fb3733,6.0,mg/L,,Accepted,,,Actual,,,,,,,,,,,,,,,Method Detection Level,2.0,mg/L,Quantitation limit value of the specified type,,,,,,,,,,,,,,"State Laboratory of Hygiene, Wisconsin",2023-07-31,,,,,,,,,,,,,,,,,,,,,,USGS,,Sediment,Federal/US Government,2025-04-22,80154, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,"Temperature, air","Temperature, air",,,,,,,,,,,,,,,,,,,,,,f23b9602-b4e8-4719-9be4-71bb481f0aa1,26.1,deg C,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Physical,Federal/US Government,2025-04-22,20, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,12456992-7a77-43f9-9f29-349704362650,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,"WATER MICROBIOLOGY SAMPLE RECEIVED WARM, COLLECTED SAME DAY. RESULTS VALID",,,,,,,,,,,,2023-06-20,09:25:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Dissolved oxygen saturation,"Dissolved oxygen (DO) saturation, water, unfiltered",7782-44-7,,Unfiltered,,,,,,,,,,,,,,,,,,,67f162d2-38e3-43e7-baae-5c0b55fec5ef,95.0,%,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,ALGOR,USDOI/USGS,Computation by NWIS algorithm,,"DESCRIPTION: Computation by NWIS algorithm; CITATION(S): U.S. Geological Survey, [revised annually], Option 7 -- Display algorithm in reverse polish notation (RPN), in User's Manual for the National Water Information System of the U.S. Geological Survey--Water-Quality System: U.S. Geological Survey, accessed on June 26, 2012, at URL http://nwis.usgs.gov/currentdocs/index.html",,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,"Inorganics, Major, Non-metals",Federal/US Government,2025-04-21,301, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Chloride,"Chloride, water, filtered",16887-00-6,,Filtered field and/or lab,,,,,,,,,,,,,,,,,,,b725f452-b2fd-4ee0-9578-8daab29039d3,29.1,mg/L,,Provisional,,,Actual,,,,,,,,,,,,,,,Detection limit by DQCALC,0.05,mg/L,Quantitation limit value of the specified type,,,,,,IC022,USDOI/USGS,"Anions, wf, IC",,"DESCRIPTION: Anions, filtered water, ion chromatography; CITATION(S): Fishman, M.J., ed., 1993, Methods of analysis by the U.S. Geological Survey National Water Quality Laboratory--Determination of inorganic and organic constituents in water and fluvial sediments: U.S. Geological Survey Open-File Report 93-125, p. 19-25. | USGS | I-2057-90 |<--->| American Public Health Association and American Water Works Association, 2012, Standard methods for the examination of water and wastewater (22d ed.): Washington, D.C., American Public Health Association, method 4110 B-2011, p. 4-5 through 4-7. | STDMETH | 4110 B-2011",,,,"USGS-National Water Quality Lab, Denver, CO",2023-08-16,,,,,,,,,,,,,,,,,,,,,,USGS,,"Inorganics, Major, Non-metals",Federal/US Government,2025-04-21,940, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,12456992-7a77-43f9-9f29-349704362650,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,"WATER MICROBIOLOGY SAMPLE RECEIVED WARM, COLLECTED SAME DAY. RESULTS VALID",,,,,,,,,,,,2023-06-20,09:25:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Suspended Sediment Concentration (SSC),Suspended sediment concentration,,,Unfiltered,,,,,,,,,,,,,,,,,,,aba6b472-a473-4673-89e4-fa8e36e65f0d,3.0,mg/L,,Accepted,,,Actual,,,,,,,,,,,,,,,Method Detection Level,2.0,mg/L,Quantitation limit value of the specified type,,,,,,,,,,,,,,"State Laboratory of Hygiene, Wisconsin",2023-06-26,,,,,,,,,,,,,,,,,,,,,,USGS,,Sediment,Federal/US Government,2025-04-22,80154, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,3e391eba-82b6-4908-b748-c2530da5101a,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,Generated activity from observation import file file49fc4f806143_8aacbd2a-51b6-42d0-9902-2ba17d9c69e8.csv,,,,,,,,,,,,2023-08-22,08:50:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,"Temperature, air","Temperature, air",,,,,,,,,,,,,,,,,,,,,,2a301526-6375-4e93-a020-72c17e78f485,20.6,deg C,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Physical,Federal/US Government,2025-04-21,20, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,"Stream flow, instantaneous","Discharge, instantaneous",,,,,,,,,,,,,,,,,,,,,,7e128169-cafd-43f8-a8f0-cb4743250ad6,40.0,ft3/sec,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Physical,Federal/US Government,2025-04-21,61, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,3e391eba-82b6-4908-b748-c2530da5101a,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,Generated activity from observation import file file49fc4f806143_8aacbd2a-51b6-42d0-9902-2ba17d9c69e8.csv,,,,,,,,,,,,2023-08-22,08:50:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Suspended Sediment Concentration (SSC),Suspended sediment concentration,,,Unfiltered,,,,,,,,,,,,,,,,,,,8fbf9a25-f646-4ca7-b871-18c22c1fc593,8.0,mg/L,,Accepted,,,Actual,,,,,,,,,,,,,,,Method Detection Level,2.0,mg/L,Quantitation limit value of the specified type,,,,,,,,,,,,,,"State Laboratory of Hygiene, Wisconsin",2023-09-15,,,,,,,,,,,,,,,,,,,,,,USGS,,Sediment,Federal/US Government,2025-04-21,80154, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,3e391eba-82b6-4908-b748-c2530da5101a,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,Generated activity from observation import file file49fc4f806143_8aacbd2a-51b6-42d0-9902-2ba17d9c69e8.csv,,,,,,,,,,,,2023-08-22,08:50:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Barometric pressure,"Barometric pressure (BP), uncorrected",,,,,,,,,,,,,,,,,,,,,,73d4c542-d286-49ff-9f48-69d5c9d44426,744.0,mmHg,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Physical,Federal/US Government,2025-04-21,25, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,3e391eba-82b6-4908-b748-c2530da5101a,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,Generated activity from observation import file file49fc4f806143_8aacbd2a-51b6-42d0-9902-2ba17d9c69e8.csv,,,,,,,,,,,,2023-08-22,08:50:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,pH,"pH, water, unfiltered, field",,,Unfiltered,,,,,,,,,,,,,,,,,,,4e4092dd-42df-4220-9186-c9155b7c1f78,7.9,standard units,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Physical,Federal/US Government,2025-04-21,400, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,12456992-7a77-43f9-9f29-349704362650,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,"WATER MICROBIOLOGY SAMPLE RECEIVED WARM, COLLECTED SAME DAY. RESULTS VALID",,,,,,,,,,,,2023-06-20,09:25:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,"Temperature, air","Temperature, air",,,,,,,,,,,,,,,,,,,,,,bc0ef75f-8bb7-4b60-9cd8-84919213ca20,23.3,deg C,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Physical,Federal/US Government,2025-04-21,20, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Nitrate,"Nitrate as nitrogen, water, filtered",14797-55-8,as N,Filtered field and/or lab,,,,,,,,,,,,,,,,,,,31b1e511-50bf-46a9-bca0-f9ea218dac58,2.71,mg/L,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,ALGOR,USDOI/USGS,Computation by NWIS algorithm,,"DESCRIPTION: Computation by NWIS algorithm; CITATION(S): U.S. Geological Survey, [revised annually], Option 7 -- Display algorithm in reverse polish notation (RPN), in User's Manual for the National Water Information System of the U.S. Geological Survey--Water-Quality System: U.S. Geological Survey, accessed on June 26, 2012, at URL http://nwis.usgs.gov/currentdocs/index.html",,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Nutrient,Federal/US Government,2025-04-22,618, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,12456992-7a77-43f9-9f29-349704362650,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,"WATER MICROBIOLOGY SAMPLE RECEIVED WARM, COLLECTED SAME DAY. RESULTS VALID",,,,,,,,,,,,2023-06-20,09:25:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Barometric pressure,"Barometric pressure (BP), uncorrected",,,,,,,,,,,,,,,,,,,,,,3015d956-a3b4-4c2d-b5ad-3e31831af7dc,742.0,mmHg,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Physical,Federal/US Government,2025-04-22,25, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,12456992-7a77-43f9-9f29-349704362650,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,"WATER MICROBIOLOGY SAMPLE RECEIVED WARM, COLLECTED SAME DAY. RESULTS VALID",,,,,,,,,,,,2023-06-20,09:25:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,"Stream flow, instantaneous","Discharge, instantaneous",,,,,,,,,,,,,,,,,,,,,,245095cc-c981-4689-b627-49867ac0e19a,32.0,ft3/sec,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Physical,Federal/US Government,2025-04-22,61, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,12456992-7a77-43f9-9f29-349704362650,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,"WATER MICROBIOLOGY SAMPLE RECEIVED WARM, COLLECTED SAME DAY. RESULTS VALID",,,,,,,,,,,,2023-06-20,09:25:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Suspended Sediment Load,Suspended sediment flux,,,Unfiltered,,,,,,,,,,,,,,,,,,,e6202c86-a5e8-440a-a636-e282a3b5b983,0.27,tons/day,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,ALGOR,USDOI/USGS,Computation by NWIS algorithm,,"DESCRIPTION: Computation by NWIS algorithm; CITATION(S): U.S. Geological Survey, [revised annually], Option 7 -- Display algorithm in reverse polish notation (RPN), in User's Manual for the National Water Information System of the U.S. Geological Survey--Water-Quality System: U.S. Geological Survey, accessed on June 26, 2012, at URL http://nwis.usgs.gov/currentdocs/index.html",,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Sediment,Federal/US Government,2025-04-22,80155, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,12456992-7a77-43f9-9f29-349704362650,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,"WATER MICROBIOLOGY SAMPLE RECEIVED WARM, COLLECTED SAME DAY. RESULTS VALID",,,,,,,,,,,,2023-06-20,09:25:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Dissolved oxygen (DO),"Dissolved oxygen (DO), water, unfiltered",7782-44-7,,Unfiltered,,,,,,,,,,,,,,,,,,,5ba3b4b3-7bb0-40d4-b550-c5c6f497d797,9.2,mg/L,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,"Inorganics, Major, Non-metals",Federal/US Government,2025-04-22,300, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,3e391eba-82b6-4908-b748-c2530da5101a,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,Generated activity from observation import file file49fc4f806143_8aacbd2a-51b6-42d0-9902-2ba17d9c69e8.csv,,,,,,,,,,,,2023-08-22,08:50:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Specific conductance,"Specific conductance, water, unfiltered, normalized to 25 degrees Celsius",,,Unfiltered,,,,,,,,,,,,,,,,,,,95d8e8e9-2448-4c17-9640-4c7731343c0e,667.0,uS/cm,,Provisional,,,Actual,,,25 Deg C,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Physical,Federal/US Government,2025-04-22,95, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,12456992-7a77-43f9-9f29-349704362650,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,"WATER MICROBIOLOGY SAMPLE RECEIVED WARM, COLLECTED SAME DAY. RESULTS VALID",,,,,,,,,,,,2023-06-20,09:25:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Phosphorus,"Phosphorus as phosphorus, water, unfiltered",7723-14-0,as P,Unfiltered,,,,,,,,,,,,,,,,,,,617a6fce-4f22-4e54-89f3-c2393d7f4046,0.034,mg/L,,Provisional,,,Actual,,,,,,,,,,Hold time parameters were exceeded during the collection to analysis phase of sample processing.,,,,,Detection limit by DQCALC,0.003,mg/L,Quantitation limit value of the specified type,,,,,,CL021,USDOI/USGS,"P, wu, WCA, persulfate CF color",,"DESCRIPTION: Phosphorus, unfiltered water, acidified, acid-persulfate digestion, continuous flow (CF) colorimetry; CITATION(S): USEPA | 365.1",,,,"USGS-National Water Quality Lab, Denver, CO",2023-08-02,,,,,,[@ - holding time exceeded]; [* - sample was warm when received]; [c - see result laboratory comment],,,,,,,,,,,,,,,,USGS,,Nutrient,Federal/US Government,2025-04-21,665, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,12456992-7a77-43f9-9f29-349704362650,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,"WATER MICROBIOLOGY SAMPLE RECEIVED WARM, COLLECTED SAME DAY. RESULTS VALID",,,,,,,,,,,,2023-06-20,09:25:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Nitrite,"Nitrite as nitrogen, water, filtered",14797-65-0,as N,Filtered field and/or lab,,,,,,,,,,,,,,,,,,,91987fc6-0c0f-4101-b8af-1fa0015cd2ac,0.021,mg/L,,Provisional,,,Actual,,,,,,,,,,Hold time parameters were exceeded during the collection to analysis phase of sample processing.,,,,,Detection limit by DQCALC,0.001,mg/L,Quantitation limit value of the specified type,,,,,,DZ001,USDOI/USGS,"Nitrite, wf, DA, diazo",,"DESCRIPTION: Nitrite, filtered water, discrete analyzer, diazotization and colorimetry (formerly Mcode 00049); CITATION(S): Fishman, M.J., ed., 1993, Methods of analysis by the U.S. Geological Survey National Water Quality Laboratory--Determination of inorganic and organic constituents in water and fluvial sediments: U.S. Geological Survey Open-File Report 93-125, 217 p., https://pubs.er.usgs.gov/publication/ofr93125 | USGS ",,,,"USGS-National Water Quality Lab, Denver, CO",2023-07-27,,,,,,[@ - holding time exceeded]; [* - sample was warm when received]; [c - see result laboratory comment],,,,,,,,,,,,,,,,USGS,,Nutrient,Federal/US Government,2025-04-21,613, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,12456992-7a77-43f9-9f29-349704362650,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,"WATER MICROBIOLOGY SAMPLE RECEIVED WARM, COLLECTED SAME DAY. RESULTS VALID",,,,,,,,,,,,2023-06-20,09:25:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,"Nitrogen, mixed forms (NH3), (NH4), organic, (NO2) and (NO3)","Total nitrogen (nitrate + nitrite + total ammonia + organic nitrogen) as nitrogen, water, unfiltered",,as N,Unfiltered,,,,,,,,,,,,,,,,,,,ad39f92b-e5b0-4c71-b679-968793ee7155,3.27,mg/L,,Provisional,,,Actual,,,,,,,,,,Hold time parameters were exceeded during the collection to analysis phase of sample processing.,,,,,Detection limit by DQCALC,0.05,mg/L,Quantitation limit value of the specified type,,,,,,AKP01,USDOI/USGS,"Nutrients, wu, WCA,persulfate,CF",,"DESCRIPTION: Nutrients, unfiltered water, acidified, alkaline-persulfate digestion, continuous flow colorimetry; CITATION(S): Patton, C.J., Kryskalla. J.R., 2003, Methods of analysis by the U.S. Geological Survey National Water Quality Laboratory--Evaluation of alkaline persulfate digestion as an alternative to Kjeldahl digestion for determination of total and dissolved nitrogen and phosphorus in water: U.S. Geological Survey Water-Resources Investigations Report 03-4174, 33 p. | USGS | I-4650-03",,,,"USGS-National Water Quality Lab, Denver, CO",2024-03-13,,,,,,[@ - holding time exceeded]; [* - sample was warm when received]; [c - see result laboratory comment],,,,,,,,,,,,,,,,USGS,,Nutrient,Federal/US Government,2025-04-21,62855, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,12456992-7a77-43f9-9f29-349704362650,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,"WATER MICROBIOLOGY SAMPLE RECEIVED WARM, COLLECTED SAME DAY. RESULTS VALID",,,,,,,,,,,,2023-06-20,09:25:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Inorganic nitrogen (nitrate and nitrite),"Nitrate plus nitrite as nitrogen, water, filtered",,as N,Filtered field and/or lab,,,,,,,,,,,,,,,,,,,b52d1da2-9243-4395-820b-a56af06beded,2.91,mg/L,,Provisional,,,Actual,,,,,,,,,,Hold time parameters were exceeded during the collection to analysis phase of sample processing.,,,,,Detection limit by DQCALC,0.04,mg/L,Quantitation limit value of the specified type,,,,,,RED01,USDOI/USGS,"NO3+NO2, wf, FCC,NaR, DA",,"DESCRIPTION: Nitrate + nitrite, filtered water, enzymatic reduction, Griess Reaction colorimetry, automated discrete analyzer, standard range; CITATION(S): Patton, C.J., and Kryskalla, J.R., 2011, Colorimetric determination of nitrate plus nitrite in water by enzymatic reduction, automated discrete analyzer methods: U.S. Geological Survey Techniques and Methods, book 5, chap. B8, 34 p. | USGS | I-2547-11",,,,"USGS-National Water Quality Lab, Denver, CO",2023-08-31,,,,,,[@ - holding time exceeded]; [* - sample was warm when received]; [c - see result laboratory comment],,,,,,,,,,,,,,,,USGS,,Nutrient,Federal/US Government,2025-04-21,631, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,12456992-7a77-43f9-9f29-349704362650,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,"WATER MICROBIOLOGY SAMPLE RECEIVED WARM, COLLECTED SAME DAY. RESULTS VALID",,,,,,,,,,,,2023-06-20,09:25:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Orthophosphate,"Orthophosphate as phosphorus, water, filtered",14265-44-2,as P,Filtered field and/or lab,,,,,,,,,,,,,,,,,,,c22e649c-e198-4559-8955-375ca40c5017,0.009,mg/L,,Provisional,,,Actual,,,,,,,,,,Hold time parameters were exceeded during the collection to analysis phase of sample processing.,,,,,Detection limit by DQCALC,0.004,mg/L,Quantitation limit value of the specified type,,,,,,PHM01,USDOI/USGS,"Ortho-PO4, wf, DA phos/mol(NWQL)",,"DESCRIPTION: Orthophosphate in filtered water by discrete analyzer phosphomolybdate formation and colorimetry (formerly Mcode 00048); CITATION(S): Fishman, M.J., ed., 1993, Methods of analysis by the U.S. Geological Survey National Water Quality Laboratory--Determination of inorganic and organic constituents in water and fluvial sediments: U.S. Geological Survey Open-File Report 93-125, p. 175-181 and 191-202. Method Numbers: I-2601-90, I-2606-89. [Note: Analytical platform change in 2006 at the USGS NWQL from automated air-segmented flow analyzer to automated discrete analyzer.] |<--->| Murphy, J., and Riley, J.P., 1962, A modified single-solution method for the determination of phosphorus in natural waters: Analytica Chimica Acta, v. 27, p. 31-36. |<--->| Pai, Su-Cheng, Yang, Chung-Cheng, and Riley, J.P., 1990, Effects of acidity and moplybdate concentration on the formation of the phosphoantimonyl-molydenum blue complex: Analytica Chimica Acta, v. 229, p. 115-120.",,,,"USGS-National Water Quality Lab, Denver, CO",2023-07-27,,,,,,[@ - holding time exceeded]; [* - sample was warm when received]; [c - see result laboratory comment],,,,,,,,,,,,,,,,USGS,,Nutrient,Federal/US Government,2025-04-22,671, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,12456992-7a77-43f9-9f29-349704362650,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,"WATER MICROBIOLOGY SAMPLE RECEIVED WARM, COLLECTED SAME DAY. RESULTS VALID",,,,,,,,,,,,2023-06-20,09:25:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,Not Detected,Ammonia and ammonium,"Total ammonia (NH4+ and NH3) as nitrogen, water, filtered",,as N,Filtered field and/or lab,,,,,,,,,,,,,,,,,,,a1fce2a0-399c-409c-8d68-7e264228b3e4,,,,Provisional,,,Actual,,,,,,,,,,Hold time parameters were exceeded during the collection to analysis phase of sample processing.,Censoring Level,0.02,mg/L,Quantitation limit value associated with a < or > legacy remark code in USGS source data,Detection limit by DQCALC,0.02,mg/L,Quantitation limit value of the specified type,,,,,,SHC02,USDOI/USGS,"Ammonia, wf, DA sal/hypo (NWQL)",,"DESCRIPTION: Ammonia in filtered water by discrete analyzer salicylate-hypochlorite reaction and colorimetry (formerly Mcode 00048; NWQL); CITATION(S): Fishman, M.J., ed., 1993, Methods of analysis by the U.S. Geological Survey National Water Quality Laboratory--Determination of inorganic and organic constituents in water and fluvial sediments: U.S. Geological Survey Open-File Report 93-125, p. 125-132. | USGS | I-2522-90 |<--->| Harfmann, R.G., and Crouch, J.D., 1989, Kinetic study of Berthelot reaction steps in the absence and presence of coupling reagents: Talanta, v. 36, p. 261-269. |<--->| Krom, M.D., 1980, Spectrophotometric determination of ammonia--A study of a modified Berthelot reaction using salicylate and dichloroisocyanurate: Analyst, v. 105, p. 305-316. |<--->| Patton, C.J., and Crouch, S.R., 1977, Spectrophotometric and kinetics investigation of the Berthelot reaction for the determination of ammonia: Analytical Chemistry, v. 49, p. 464-469.",,,,"USGS-National Water Quality Lab, Denver, CO",2023-07-27,,,,,,[@ - holding time exceeded]; [* - sample was warm when received]; [c - see result laboratory comment],,,,,,,,,,,,,,,,USGS,,Nutrient,Federal/US Government,2025-04-22,608, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,3e391eba-82b6-4908-b748-c2530da5101a,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,Generated activity from observation import file file49fc4f806143_8aacbd2a-51b6-42d0-9902-2ba17d9c69e8.csv,,,,,,,,,,,,2023-08-22,08:50:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Phosphorus,"Phosphorus as phosphorus, water, unfiltered",7723-14-0,as P,Unfiltered,,,,,,,,,,,,,,,,,,,22f1b884-c6a5-4905-b98f-98c1dc5e88ae,0.051,mg/L,,Provisional,,,Actual,,,,,,,,,,,,,,,Detection limit by DQCALC,0.003,mg/L,Quantitation limit value of the specified type,,,,,,CL021,USDOI/USGS,"P, wu, WCA, persulfate CF color",,"DESCRIPTION: Phosphorus, unfiltered water, acidified, acid-persulfate digestion, continuous flow (CF) colorimetry; CITATION(S): USEPA | 365.1",,,,"USGS-National Water Quality Lab, Denver, CO",2023-09-18,,,,,,[* - sample was warm when received],,,,,,,,,,,,,,,,USGS,,Nutrient,Federal/US Government,2025-04-22,665, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,3e391eba-82b6-4908-b748-c2530da5101a,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,Generated activity from observation import file file49fc4f806143_8aacbd2a-51b6-42d0-9902-2ba17d9c69e8.csv,,,,,,,,,,,,2023-08-22,08:50:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Inorganic nitrogen (nitrate and nitrite),"Nitrate plus nitrite as nitrogen, water, filtered",,as N,Filtered field and/or lab,,,,,,,,,,,,,,,,,,,7ed33789-3a3a-4369-8653-3954a53de8c2,2.96,mg/L,,Provisional,,,Actual,,,,,,,,,,Hold time parameters were exceeded during the collection to analysis phase of sample processing.,,,,,Detection limit by DQCALC,0.04,mg/L,Quantitation limit value of the specified type,,,,,,RED01,USDOI/USGS,"NO3+NO2, wf, FCC,NaR, DA",,"DESCRIPTION: Nitrate + nitrite, filtered water, enzymatic reduction, Griess Reaction colorimetry, automated discrete analyzer, standard range; CITATION(S): Patton, C.J., and Kryskalla, J.R., 2011, Colorimetric determination of nitrate plus nitrite in water by enzymatic reduction, automated discrete analyzer methods: U.S. Geological Survey Techniques and Methods, book 5, chap. B8, 34 p. | USGS | I-2547-11",,,,"USGS-National Water Quality Lab, Denver, CO",2023-09-29,,,,,,[@ - holding time exceeded]; [* - sample was warm when received]; [c - see result laboratory comment],,,,,,,,,,,,,,,,USGS,,Nutrient,Federal/US Government,2025-04-21,631, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,3e391eba-82b6-4908-b748-c2530da5101a,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,Generated activity from observation import file file49fc4f806143_8aacbd2a-51b6-42d0-9902-2ba17d9c69e8.csv,,,,,,,,,,,,2023-08-22,08:50:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Orthophosphate,"Orthophosphate as phosphorus, water, filtered",14265-44-2,as P,Filtered field and/or lab,,,,,,,,,,,,,,,,,,,db5caaf3-d89a-428c-a952-1bf188bbe4e8,0.037,mg/L,,Provisional,,,Actual,,,,,,,,,,Hold time parameters were exceeded during the collection to analysis phase of sample processing.,,,,,Detection limit by DQCALC,0.004,mg/L,Quantitation limit value of the specified type,,,,,,PHM01,USDOI/USGS,"Ortho-PO4, wf, DA phos/mol(NWQL)",,"DESCRIPTION: Orthophosphate in filtered water by discrete analyzer phosphomolybdate formation and colorimetry (formerly Mcode 00048); CITATION(S): Fishman, M.J., ed., 1993, Methods of analysis by the U.S. Geological Survey National Water Quality Laboratory--Determination of inorganic and organic constituents in water and fluvial sediments: U.S. Geological Survey Open-File Report 93-125, p. 175-181 and 191-202. Method Numbers: I-2601-90, I-2606-89. [Note: Analytical platform change in 2006 at the USGS NWQL from automated air-segmented flow analyzer to automated discrete analyzer.] |<--->| Murphy, J., and Riley, J.P., 1962, A modified single-solution method for the determination of phosphorus in natural waters: Analytica Chimica Acta, v. 27, p. 31-36. |<--->| Pai, Su-Cheng, Yang, Chung-Cheng, and Riley, J.P., 1990, Effects of acidity and moplybdate concentration on the formation of the phosphoantimonyl-molydenum blue complex: Analytica Chimica Acta, v. 229, p. 115-120.",,,,"USGS-National Water Quality Lab, Denver, CO",2023-09-28,,,,,,[@ - holding time exceeded]; [* - sample was warm when received]; [c - see result laboratory comment],,,,,,,,,,,,,,,,USGS,,Nutrient,Federal/US Government,2025-04-22,671, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,3e391eba-82b6-4908-b748-c2530da5101a,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,Generated activity from observation import file file49fc4f806143_8aacbd2a-51b6-42d0-9902-2ba17d9c69e8.csv,,,,,,,,,,,,2023-08-22,08:50:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Nitrite,"Nitrite as nitrogen, water, filtered",14797-65-0,as N,Filtered field and/or lab,,,,,,,,,,,,,,,,,,,0d3e0136-1622-4457-964c-1cf452b3e61d,0.018,mg/L,,Provisional,,,Actual,,,,,,,,,,Hold time parameters were exceeded during the collection to analysis phase of sample processing.,,,,,Detection limit by DQCALC,0.001,mg/L,Quantitation limit value of the specified type,,,,,,DZ001,USDOI/USGS,"Nitrite, wf, DA, diazo",,"DESCRIPTION: Nitrite, filtered water, discrete analyzer, diazotization and colorimetry (formerly Mcode 00049); CITATION(S): Fishman, M.J., ed., 1993, Methods of analysis by the U.S. Geological Survey National Water Quality Laboratory--Determination of inorganic and organic constituents in water and fluvial sediments: U.S. Geological Survey Open-File Report 93-125, 217 p., https://pubs.er.usgs.gov/publication/ofr93125 | USGS ",,,,"USGS-National Water Quality Lab, Denver, CO",2023-09-28,,,,,,[@ - holding time exceeded]; [* - sample was warm when received]; [c - see result laboratory comment],,,,,,,,,,,,,,,,USGS,,Nutrient,Federal/US Government,2025-04-22,613, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,3e391eba-82b6-4908-b748-c2530da5101a,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,Generated activity from observation import file file49fc4f806143_8aacbd2a-51b6-42d0-9902-2ba17d9c69e8.csv,,,,,,,,,,,,2023-08-22,08:50:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,"Nitrogen, mixed forms (NH3), (NH4), organic, (NO2) and (NO3)","Total nitrogen (nitrate + nitrite + total ammonia + organic nitrogen) as nitrogen, water, unfiltered",,as N,Unfiltered,,,,,,,,,,,,,,,,,,,61ca14b6-6ac2-49b0-a3e2-e72175fb51de,3.37,mg/L,,Provisional,,,Actual,,,,,,,,,,Hold time parameters were exceeded during the collection to analysis phase of sample processing.,,,,,Detection limit by DQCALC,0.05,mg/L,Quantitation limit value of the specified type,,,,,,AKP01,USDOI/USGS,"Nutrients, wu, WCA,persulfate,CF",,"DESCRIPTION: Nutrients, unfiltered water, acidified, alkaline-persulfate digestion, continuous flow colorimetry; CITATION(S): Patton, C.J., Kryskalla. J.R., 2003, Methods of analysis by the U.S. Geological Survey National Water Quality Laboratory--Evaluation of alkaline persulfate digestion as an alternative to Kjeldahl digestion for determination of total and dissolved nitrogen and phosphorus in water: U.S. Geological Survey Water-Resources Investigations Report 03-4174, 33 p. | USGS | I-4650-03",,,,"USGS-National Water Quality Lab, Denver, CO",2024-04-18,,,,,,[@ - holding time exceeded]; [* - sample was warm when received]; [c - see result laboratory comment],,,,,,,,,,,,,,,,USGS,,Nutrient,Federal/US Government,2025-04-21,62855, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,3e391eba-82b6-4908-b748-c2530da5101a,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,Generated activity from observation import file file49fc4f806143_8aacbd2a-51b6-42d0-9902-2ba17d9c69e8.csv,,,,,,,,,,,,2023-08-22,08:50:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Dissolved oxygen (DO),"Dissolved oxygen (DO), water, unfiltered",7782-44-7,,Unfiltered,,,,,,,,,,,,,,,,,,,d1d4c6c0-f474-4727-a2d3-618c2d0fdafa,8.5,mg/L,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,"Inorganics, Major, Non-metals",Federal/US Government,2025-04-21,300, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,3e391eba-82b6-4908-b748-c2530da5101a,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,Generated activity from observation import file file49fc4f806143_8aacbd2a-51b6-42d0-9902-2ba17d9c69e8.csv,,,,,,,,,,,,2023-08-22,08:50:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Calcium,"Calcium, wet atmospheric deposition, unfiltered, recoverable",7440-70-2,,Unfiltered,,,,,,,,,,,,,,,,,,,05a4b2b5-6654-4cfa-b1ed-eb55334dff63,70.0,mg/L,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,"Inorganics, Major, Metals",Federal/US Government,2025-04-21,82938, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,3e391eba-82b6-4908-b748-c2530da5101a,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,Generated activity from observation import file file49fc4f806143_8aacbd2a-51b6-42d0-9902-2ba17d9c69e8.csv,,,,,,,,,,,,2023-08-22,08:50:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,"Stream flow, instantaneous","Discharge, instantaneous",,,,,,,,,,,,,,,,,,,,,,181b3834-eaa1-4f94-9dc9-00af9f8faa42,1.2,m3/sec,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,ALGOR,USDOI/USGS,Computation by NWIS algorithm,,"DESCRIPTION: Computation by NWIS algorithm; CITATION(S): U.S. Geological Survey, [revised annually], Option 7 -- Display algorithm in reverse polish notation (RPN), in User's Manual for the National Water Information System of the U.S. Geological Survey--Water-Quality System: U.S. Geological Survey, accessed on June 26, 2012, at URL http://nwis.usgs.gov/currentdocs/index.html",,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Physical,Federal/US Government,2025-04-21,30209, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Nitrate,"Nitrate as nitrate, water, filtered",14797-55-8,as NO3,Filtered field and/or lab,,,,,,,,,,,,,,,,,,,1fc1315b-7675-4793-bc21-f9b46906033f,12.0,mg/L,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,ALGOR,USDOI/USGS,Computation by NWIS algorithm,,"DESCRIPTION: Computation by NWIS algorithm; CITATION(S): U.S. Geological Survey, [revised annually], Option 7 -- Display algorithm in reverse polish notation (RPN), in User's Manual for the National Water Information System of the U.S. Geological Survey--Water-Quality System: U.S. Geological Survey, accessed on June 26, 2012, at URL http://nwis.usgs.gov/currentdocs/index.html",,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Nutrient,Federal/US Government,2025-04-21,71851, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,3e391eba-82b6-4908-b748-c2530da5101a,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,Generated activity from observation import file file49fc4f806143_8aacbd2a-51b6-42d0-9902-2ba17d9c69e8.csv,,,,,,,,,,,,2023-08-22,08:50:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Ammonia and ammonium,"Total ammonia (NH4+ and NH3) as nitrogen, water, filtered",,as N,Filtered field and/or lab,,,,,,,,,,,,,,,,,,,e356de94-c432-416b-a3ac-d2e4c424121f,0.02,mg/L,,Provisional,,,Actual,,,,,,,,,,Hold time parameters were exceeded during the collection to analysis phase of sample processing.,,,,,Detection limit by DQCALC,0.02,mg/L,Quantitation limit value of the specified type,,,,,,SHC02,USDOI/USGS,"Ammonia, wf, DA sal/hypo (NWQL)",,"DESCRIPTION: Ammonia in filtered water by discrete analyzer salicylate-hypochlorite reaction and colorimetry (formerly Mcode 00048; NWQL); CITATION(S): Fishman, M.J., ed., 1993, Methods of analysis by the U.S. Geological Survey National Water Quality Laboratory--Determination of inorganic and organic constituents in water and fluvial sediments: U.S. Geological Survey Open-File Report 93-125, p. 125-132. | USGS | I-2522-90 |<--->| Harfmann, R.G., and Crouch, J.D., 1989, Kinetic study of Berthelot reaction steps in the absence and presence of coupling reagents: Talanta, v. 36, p. 261-269. |<--->| Krom, M.D., 1980, Spectrophotometric determination of ammonia--A study of a modified Berthelot reaction using salicylate and dichloroisocyanurate: Analyst, v. 105, p. 305-316. |<--->| Patton, C.J., and Crouch, S.R., 1977, Spectrophotometric and kinetics investigation of the Berthelot reaction for the determination of ammonia: Analytical Chemistry, v. 49, p. 464-469.",,,,"USGS-National Water Quality Lab, Denver, CO",2023-09-28,,,,,,[@ - holding time exceeded]; [* - sample was warm when received]; [n - below the reporting level but at or above the detection level],,,,,,,,,,,,,,,,USGS,,Nutrient,Federal/US Government,2025-04-21,608, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,12456992-7a77-43f9-9f29-349704362650,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,"WATER MICROBIOLOGY SAMPLE RECEIVED WARM, COLLECTED SAME DAY. RESULTS VALID",,,,,,,,,,,,2023-06-20,09:25:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Escherichia coli,"Escherichia coli (most probable number), water, defined substrate test method (DSTM)",,,,,,,,,,,,,,,,,,,,,,f1aea72f-cadb-41f6-bb37-d8b95e6c2a97,390.0,MPN/100mL,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"State Laboratory of Hygiene, Wisconsin",2023-06-21,,,,,,,,,,,,,,,,,,,,,,USGS,,Microbiological,Federal/US Government,2025-04-21,50468, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,"Nitrogen, mixed forms (NH3), (NH4), organic, (NO2) and (NO3)","Total nitrogen (nitrate + nitrite + total ammonia + organic nitrogen) as nitrogen, water, unfiltered",,as N,Unfiltered,,,,,,,,,,,,,,,,,,,e995ef65-b148-458a-97ec-108afa1f9532,2.95,mg/L,,Provisional,,,Actual,,,,,,,,,,Hold time parameters were exceeded during the collection to analysis phase of sample processing,,,,,Detection limit by DQCALC,0.05,mg/L,Quantitation limit value of the specified type,,,,,,AKP01,USDOI/USGS,"Nutrients, wu, WCA,persulfate,CF",,"DESCRIPTION: Nutrients, unfiltered water, acidified, alkaline-persulfate digestion, continuous flow colorimetry; CITATION(S): Patton, C.J., Kryskalla. J.R., 2003, Methods of analysis by the U.S. Geological Survey National Water Quality Laboratory--Evaluation of alkaline persulfate digestion as an alternative to Kjeldahl digestion for determination of total and dissolved nitrogen and phosphorus in water: U.S. Geological Survey Water-Resources Investigations Report 03-4174, 33 p. | USGS | I-4650-03",,,,"USGS-National Water Quality Lab, Denver, CO",2023-11-21,,,,,,[@ - holding time exceeded];[c - see result laboratory comment],,,,,,,,,,,,,,,,USGS,,Nutrient,Federal/US Government,2025-04-21,62855, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,e249deec-c851-4c36-ba62-690db8eff70e,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,WATER MICROBIOLOGY SAMPLE RECEIVED PARTIALLY FROZEN. RESULTS UNCERTAIN,,,,,,,,,,,,2023-07-25,09:00:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,Dissolved oxygen saturation,"Dissolved oxygen (DO) saturation, water, unfiltered",7782-44-7,,Unfiltered,,,,,,,,,,,,,,,,,,,6141614e-bcba-41bf-9f35-6d485568b02c,88.0,%,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,ALGOR,USDOI/USGS,Computation by NWIS algorithm,,"DESCRIPTION: Computation by NWIS algorithm; CITATION(S): U.S. Geological Survey, [revised annually], Option 7 -- Display algorithm in reverse polish notation (RPN), in User's Manual for the National Water Information System of the U.S. Geological Survey--Water-Quality System: U.S. Geological Survey, accessed on June 26, 2012, at URL http://nwis.usgs.gov/currentdocs/index.html",,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,"Inorganics, Major, Non-metals",Federal/US Government,2025-04-22,301, +USGS,U.S. Geological Survey,"[""USGS"",""LZD0200""]",,,,,,USGS-05406500,"BLACK EARTH CREEK AT BLACK EARTH, WI",Stream,,Wisconsin,United States of America,Dane County,US,WI,,7070005,70700050502,,,43.1341666666667,-89.7322222222222,NAD83,43.1341666666667,-89.7322222222222,NAD83,,12456992-7a77-43f9-9f29-349704362650,,"Sample - Routine, regular",Water,Surface water,,,,U.S. Geological Survey-Water Resources Discipline,"WATER MICROBIOLOGY SAMPLE RECEIVED WARM, COLLECTED SAME DAY. RESULTS VALID",,,,,,,,,,,,2023-06-20,09:25:00,CDT,,,,,,,,,,,,70,USDOI/USGS,Grab/dip,,Point / Grab: Grab sample (dip),,,,,,,,,,,,,,"Stable, normal stage",Routine sample,,,,,,"Stream flow, instantaneous","Discharge, instantaneous",,,,,,,,,,,,,,,,,,,,,,bf3b9eaf-47de-461e-8a57-005db6497920,0.91,m3/sec,,Provisional,,,Actual,,,,,,,,,,,,,,,,,,,,,,,,ALGOR,USDOI/USGS,Computation by NWIS algorithm,,"DESCRIPTION: Computation by NWIS algorithm; CITATION(S): U.S. Geological Survey, [revised annually], Option 7 -- Display algorithm in reverse polish notation (RPN), in User's Manual for the National Water Information System of the U.S. Geological Survey--Water-Quality System: U.S. Geological Survey, accessed on June 26, 2012, at URL http://nwis.usgs.gov/currentdocs/index.html",,,,,,,,,,,,,,,,,,,,,,,,,,,USGS,,Physical,Federal/US Government,2025-04-21,30209, diff --git a/tests/samples_test.py b/tests/samples_test.py new file mode 100755 index 00000000..cef19db8 --- /dev/null +++ b/tests/samples_test.py @@ -0,0 +1,57 @@ +import datetime + +import pytest +from pandas import DataFrame + +from dataretrieval.samples import ( + _check_profiles, + get_USGS_samples +) + +def mock_request(requests_mock, request_url, file_path): + with open(file_path) as text: + requests_mock.get( + request_url, text=text.read(), headers={"mock_header": "value"} + ) + +def test_mock_get_USGS_samples(requests_mock): + """Tests USGS Samples query""" + request_url = ( + "https://api.waterdata.usgs.gov/samples-data/results/fullphyschem?" + "activityMediaName=Water&activityStartDateLower=2020-01-01" + "&activityStartDateUpper=2024-12-31&monitoringLocationIdentifier=USGS-05406500&mimeType=text%2Fcsv" + ) + response_file_path = "data/samples_results.txt" + mock_request(requests_mock, request_url, response_file_path) + df, md = get_USGS_samples( + service="results", + profile="fullphyschem", + activityMediaName="Water", + activityStartDateLower="2020-01-01", + activityStartDateUpper="2024-12-31", + monitoringLocationIdentifier="USGS-05406500" + ) + assert type(df) is DataFrame + assert df.size == 12127 + assert md.url == request_url + assert isinstance(md.query_time, datetime.timedelta) + assert md.header == {"mock_header": "value"} + assert md.comment is None + +def test_check_profiles(): + """Tests that correct errors are raised for invalid profiles.""" + with pytest.raises(TypeError): + _check_profiles(service="foo", profile="bar") + with pytest.raises(TypeError): + _check_profiles(service="results", profile="foo") + +def test_samples_activity(): + """Test activity call for proper columns""" + df,_ = get_USGS_samples( + service="activities", + profile="sampact", + monitoringLocationIdentifier="USGS-06719505" + ) + assert len(df) > 0 + assert len(df.columns) == 95 + assert "Location_HUCTwelveDigitCode" in df.columns From bc5d17749b7eac8231327e16d988bd38b94f08da Mon Sep 17 00:00:00 2001 From: Elise Hinman Date: Thu, 24 Apr 2025 09:35:02 -0500 Subject: [PATCH 14/21] update documentation with lookup tables --- dataretrieval/samples.py | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/dataretrieval/samples.py b/dataretrieval/samples.py index ea17e3b5..6804fa71 100644 --- a/dataretrieval/samples.py +++ b/dataretrieval/samples.py @@ -264,6 +264,8 @@ def get_USGS_samples( organizations - "organization", "count" activityMediaName : string or list of strings, optional Name or code indicating environmental medium in which sample was taken. + Check the `activityMediaName_lookup()` function in this module for all + possible inputs. Example: "Water". activityStartDateLower : string, optional The start date if using a date range. Takes the format YYYY-MM-DD. @@ -280,10 +282,13 @@ def get_USGS_samples( Example: "Sample-Routine, regular". characteristicGroup : string or list of strings, optional Characteristic group is a broad category of characteristics - describing one or more results. + describing one or more results. Check the `characteristicGroup_lookup()` + function in this module for all possible inputs. Example: "Organics, PFAS" characteristic : string or list of strings, optional Characteristic is a specific category describing one or more results. + Check the `characteristic_lookup()` function in this module for all + possible inputs. Example: "Suspended Sediment Discharge" characteristicUserSupplied : string or list of strings, optional A user supplied characteristic name describing one or more results. @@ -303,23 +308,27 @@ def get_USGS_samples( countryFips : string or list of strings, optional Example: "US" (United States) stateFips : string or list of strings, optional - Check out the code service for FIPS codes: - https://api.waterdata.usgs.gov/samples-data/codeservice/docs#/ + Check the `stateFips_lookup()` function in this module for all + possible inputs. Example: "US:15" (United States: Hawaii) countyFips : string or list of strings, optional - Check out the code service for FIPS codes: - https://api.waterdata.usgs.gov/samples-data/codeservice/docs#/ + Check the `countyFips_lookup()` function in this module for all + possible inputs. Example: "US:15:001" (United States: Hawaii, Hawaii County) siteTypeCode : string or list of strings, optional - An abbreviation for a certain site type. + An abbreviation for a certain site type. Check the `siteType_lookup()` + function in this module for all possible inputs. Example: "GW" (Groundwater site) siteTypeName : string or list of strings, optional - A full name for a certain site type. + A full name for a certain site type. Check the `siteType_lookup()` + function in this module for all possible inputs. Example: "Well" usgsPCode : string or list of strings, optional 5-digit number used in the US Geological Survey computerized data system, National Water Information System (NWIS), to - uniquely identify a specific constituent + uniquely identify a specific constituent. Check the + `characteristic_lookup()` function in this module for all possible + inputs. Example: "00060" (Discharge, cubic feet per second) hydrologicUnit : string or list of strings, optional Max 12-digit number used to describe a hydrologic unit. @@ -347,7 +356,6 @@ def get_USGS_samples( recordIdentifierUserSupplied : string or list of strings, optional Internal AQS record identifier that returns 1 entry. Only available for the "results" service. - mimeType : string, optional Returns ------- From c9cbe679de7032ab41d6ef746e0b9a595cdf9108 Mon Sep 17 00:00:00 2001 From: Elise Hinman Date: Thu, 24 Apr 2025 11:56:53 -0500 Subject: [PATCH 15/21] add more samples tests --- tests/samples_test.py | 48 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tests/samples_test.py b/tests/samples_test.py index cef19db8..eac04aef 100755 --- a/tests/samples_test.py +++ b/tests/samples_test.py @@ -9,6 +9,7 @@ ) def mock_request(requests_mock, request_url, file_path): + """Mock request code""" with open(file_path) as text: requests_mock.get( request_url, text=text.read(), headers={"mock_header": "value"} @@ -45,6 +46,18 @@ def test_check_profiles(): with pytest.raises(TypeError): _check_profiles(service="results", profile="foo") +def test_samples_results(): + """Test results call for proper columns""" + df,_ = get_USGS_samples( + service="results", + profile="narrow", + monitoringLocationIdentifier="USGS-05288705", + activityStartDateLower="2024-10-01", + activityStartDateUpper="2025-04-24" + ) + assert all(col in df.columns for col in ["Location_Identifier", "Activity_ActivityIdentifier"]) + assert len(df) > 0 + def test_samples_activity(): """Test activity call for proper columns""" df,_ = get_USGS_samples( @@ -55,3 +68,38 @@ def test_samples_activity(): assert len(df) > 0 assert len(df.columns) == 95 assert "Location_HUCTwelveDigitCode" in df.columns + +def test_samples_locations(): + """Test locations call for proper columns""" + df,_ = get_USGS_samples( + service="locations", + profile="site", + stateFips="US:55", + activityStartDateLower="2024-10-01", + activityStartDateUpper="2025-04-24", + usgsPCode="00010" + ) + assert all(col in df.columns for col in ["Location_Identifier", "Location_Latitude"]) + assert len(df) > 0 + +def test_samples_projects(): + """Test projects call for proper columns""" + df,_ = get_USGS_samples( + service="projects", + profile="project", + stateFips="US:15", + activityStartDateLower="2024-10-01", + activityStartDateUpper="2025-04-24" + ) + assert all(col in df.columns for col in ["Org_Identifier", "Project_Identifier"]) + assert len(df) > 0 + +def test_samples_organizations(): + """Test organizations call for proper columns""" + df,_ = get_USGS_samples( + service="organizations", + profile="count", + stateFips="US:01" + ) + assert len(df) == 1 + assert df.size == 3 From 45f54fa2efef1ac9b2c16afeb55757073387e6f2 Mon Sep 17 00:00:00 2001 From: thodson-usgs Date: Fri, 25 Apr 2025 16:25:21 -0500 Subject: [PATCH 16/21] Refactor samples --- dataretrieval/__init__.py | 2 +- dataretrieval/samples.py | 344 ++++++++++++++------------------------ 2 files changed, 131 insertions(+), 215 deletions(-) diff --git a/dataretrieval/__init__.py b/dataretrieval/__init__.py index ec3aacfa..200b0182 100644 --- a/dataretrieval/__init__.py +++ b/dataretrieval/__init__.py @@ -2,11 +2,11 @@ from dataretrieval.nadp import * from dataretrieval.nwis import * +from dataretrieval.samples import * from dataretrieval.streamstats import * from dataretrieval.utils import * from dataretrieval.waterwatch import * from dataretrieval.wqp import * -from dataretrieval.samples import * try: __version__ = version("dataretrieval") diff --git a/dataretrieval/samples.py b/dataretrieval/samples.py index 6804fa71..7fc125a0 100644 --- a/dataretrieval/samples.py +++ b/dataretrieval/samples.py @@ -1,234 +1,124 @@ -""" -Tool for downloading data from the USGS Aquarius Samples database (https://waterqualitydata.us) +"""Functions for downloading data from the USGS Aquarius Samples database (https://waterqualitydata.us) See https://api.waterdata.usgs.gov/samples-data/docs#/ for API reference -Not sure about available site types, characteristics, state codes, or other -input parameters? Check out the samples data code service API reference: -https://api.waterdata.usgs.gov/samples-data/codeservice/docs - """ from __future__ import annotations -import warnings -import requests -from requests.models import PreparedRequest -from typing import List, Optional, Tuple, Union -from io import StringIO import json -from typing import TYPE_CHECKING +from io import StringIO +from typing import TYPE_CHECKING, Literal, get_args import pandas as pd +import requests +from requests.models import PreparedRequest from dataretrieval.utils import BaseMetadata, to_str if TYPE_CHECKING: - from pandas import DataFrame + from typing import Tuple -BASE_URL = "https://api.waterdata.usgs.gov/samples-data/" - -services_dict = { - "results" : ["fullphyschem", "basicphyschem", - "fullbio", "basicbio", "narrow", - "resultdetectionquantitationlimit", - "labsampleprep", "count"], - "locations" : ["site", "count"], - "activities" : ["sampact", "actmetric", - "actgroup", "count"], - "projects" : ["project", "projectmonitoringlocationweight"], - "organizations" : ["organization", "count"] -} + from pandas import DataFrame -def _check_profiles( - service, - profile -): - """Check that services are paired correctly with profile in - a service call. +BASE_URL = "https://api.waterdata.usgs.gov/samples-data" + +_SERVICES = Literal["activites", "locations", "organizations", "projects", "results"] + +_PROFILES = { + "activities": Literal["sampact", "actmetric", "actgroup", "count"], + "locations": Literal["site", "count"], + "organizations": Literal["organization", "count"], + "projects": Literal["project", "projectmonitoringlocationweight"], + "results": Literal[ + "fullphyschem", + "basicphyschem", + "fullbio", + "basicbio", + "narrow", + "resultdetectionquantitationlimit", + "labsampleprep", + "count", + ], +} +_ALL_PROFILES = Literal[*[v for k,v in _PROFILES.items()]] + +_CODE_SERVICES = Literal[ + "characteristicgroup", + "characteristics", + "counties", + "countries" + "observedproperty", + "samplemedia", + "sitetype", + "states", +] + +_SAMPLES_KWARGS = Literal[ + "activityMediaName", + "activityStartDateLower", + "activityStartDateUpper", + "activityTypeCode", + "boundingBox", + "characteristic", + "characteristicGroup", + "characteristicUserSupplied", + "countyFips", + "countryFips", + "hydrologicUnit", + "monitoringLocationIdentifier", + "organizationIdentifier", + "pointLocationLatitude", + "pointLocationLongitude", + "pointLocationWithinMiles", + "projectIdentifier", + "recordIdentifierUserSupplied", + "siteTypeCode", + "siteTypeName", + "stateFips", + "usgsPCode", +] + +def get_codes(code_service: _CODE_SERVICES) -> DataFrame: + """Return codes from a Samples code service. + Parameters ---------- - service : string - One of the service names from the "services" list. - profile : string - One of the profile names from "results_profiles", - "locations_profiles", "activities_profiles", - "projects_profiles" or "organizations_profiles". + code_service : string + One of the following options: "states", "counties", "countries" + "sitetype", "samplemedia", "characteristicgroup", "characteristics", + or "observedproperty" """ - - if service not in services_dict.keys(): - raise TypeError( - f"{service} is not a Samples service. " - f"Valid options are {list(services_dict.keys())}." - ) - if profile not in services_dict[service]: - raise TypeError( - f"{profile} is not a profile associated with " - f"the {service} service. Valid options are " - f"{services_dict[service]}." + valid_code_services = get_args(_CODE_SERVICES) + if code_service not in valid_code_services: + raise ValueError( + f"Invalid code service: '{code_service}'. " + f"Valid options are: {valid_code_services}." ) -def _get_codeservice(input_name): - """Grab dataframe from Samples code service. - - Parameters - ---------- - input_name : string - One of the following options: "states", "counties", - "sitetype", "samplemedia", "characteristicgroup", - "characteristics", or "observedproperty" - """ - - url = "https://api.waterdata.usgs.gov/samples-data/codeservice/" + input_name + "?mimeType=application%2Fjson" + url = f"{BASE_URL}/codeservice/{code_service}?mimeType=application%2Fjson" response = requests.get(url) response.raise_for_status - # Extract json data_dict = json.loads(response.text) - - # Convert to list data_list = data_dict['data'] - # Create lookup dataFrame df = pd.DataFrame(data_list) return df - -def stateFips_lookup(): - """Code service that returns a dataframe of all possible stateFips codes to be used - in `get_USGS_samples()` - - Parameters - ---------- - None, returns a standard pandas dataframe of all FIPS codes. - - """ - df = _get_codeservice(input_name="states") - - df['stateFips'] = "US:" + df['fipsCode'] - - df = df[['stateName', 'stateFips']] - - return df - -def countyFips_lookup(): - """Code service that returns a dataframe of all possible countyFips codes to be used - in `get_USGS_samples()` - - Parameters - ---------- - None, returns a standard pandas dataframe of all FIPS codes. - - """ - counties = _get_codeservice(input_name="counties") - states = _get_codeservice(input_name="states") - - county_states = pd.merge(counties[['countyCode', 'countyName', 'stateAbbrev']], states[['stateAbbrev', 'fipsCode', 'stateName']], on="stateAbbrev", how="left") - - county_states['countyFips'] = "US:" + county_states['fipsCode'] + ":" + county_states['countyCode'] - - df = county_states[['stateName', 'countyName', 'countyFips']] - - return df - -def siteType_lookup(): - """Code service that returns a dataframe of all possible siteType values and - siteTypeName values to be used in `get_USGS_samples()` - - Parameters - ---------- - None, returns a standard pandas dataframe of all FIPS codes. - - """ - df = _get_codeservice(input_name="sitetype") - - df.rename(columns={'typeCode': 'siteTypeCode', - 'typeName': 'siteTypeName'}, - inplace=True) - - df = df[['siteTypeCode', 'siteTypeName', 'typeDescription']] - - return df - -def activityMediaName_lookup(): - """Code service that returns a dataframe of all possible activityMediaName values - to be used in `get_USGS_samples()` - - Parameters - ---------- - None, returns a standard pandas dataframe of all activityMediaName values. - - """ - df = _get_codeservice(input_name="samplemedia") - - df.rename(columns={'activityMedia': 'activityMediaName'}, - inplace=True) - - df = df[['activityMediaName']] - - return df - -def characteristicGroup_lookup(): - """Code service that returns a dataframe of all possible characteristicGroup values - to be used in `get_USGS_samples()` - - Parameters - ---------- - None, returns a standard pandas dataframe of all characteristicGroup values. - - """ - df = _get_codeservice(input_name="characteristicgroup") - - return df - -def characteristic_lookup(): - """Code service that returns a dataframe of all possible characteristic values, - USGS pcodes, and their associated characteristicGroup to be used in `get_USGS_samples()` - - Parameters - ---------- - None, returns a standard pandas dataframe of all characteristic values. - - """ - df = _get_codeservice(input_name="characteristics") - - df.rename(columns={'parameterCode': 'usgsPCode'}, - inplace=True) - - return df -def get_USGS_samples( +def get_usgs_samples( ssl_check=True, - service="results", - profile="fullphyschem", - activityMediaName=None, - activityStartDateLower=None, - activityStartDateUpper=None, - activityTypeCode=None, - characteristicGroup=None, - characteristc=None, - characteristicUserSupplied=None, - boundingBox=None, - countryFips=None, - stateFips=None, - countyFips=None, - siteTypeCode=None, - siteTypeName=None, - usgsPCode=None, - hydrologicUnit=None, - monitoringLocationIdentifier=None, - organizationIdentifier=None, - pointLocationLatitude=None, - pointLocationLongitude=None, - pointLocationWithinMiles=None, - projectIdentifier=None, - recordIdentifierUserSupplied=None -) -> Tuple[pd.DataFrame, BaseMetadata]: + service: _SERVICES = "results", + profile= "fullphyschem", + **kwargs, + ) -> Tuple[DataFrame, BaseMetadata]: """Search Samples database for USGS water quality data. + This is a wrapper function for the Samples database API. All potential filters are provided as arguments to the function, but please do not populate all possible filters; leave as many as feasible with their default @@ -253,13 +143,10 @@ def get_USGS_samples( profile : string One of the available profiles associated with a service. Options for each service are: - results - "fullphyschem", "basicphyschem", - "fullbio", "basicbio", "narrow", - "resultdetectionquantitationlimit", - "labsampleprep", "count" + results - "fullphyschem", "basicphyschem", "fullbio", "basicbio", "narrow", + "resultdetectionquantitationlimit", "labsampleprep", "count" locations - "site", "count" - activities - "sampact", "actmetric", - "actgroup", "count" + activities - "sampact", "actmetric", "actgroup", "count" projects - "project", "projectmonitoringlocationweight" organizations - "organization", "count" activityMediaName : string or list of strings, optional @@ -390,35 +277,64 @@ def get_USGS_samples( """ _check_profiles(service, profile) - # Get all not-None inputs - params = {key: value for key, value in locals().items() if value is not None and key not in ['service', 'profile', 'ssl_check']} + valid_kwargs = get_args(_SAMPLES_KWARGS) + if not all(key in valid_kwargs for key in kwargs): + raise ValueError( + f"Invalid keyword arguments. Valid options are: {valid_kwargs}." + ) - if len(params) == 0: - raise TypeError("No filter parameters provided. You must add at least " - "one filter parameter beyond a service, profile, and format argument.") + if len(kwargs) == 0: + raise TypeError( + "No filter parameters provided. You must add at least " + "one filter parameter beyond a service, profile, and format argument." + ) - # Add in file format (could be an input, too, though not sure about other formats) - params['mimeType'] = "text/csv" + params = {"mimeType": "text/csv"} + params.update(kwargs) - # Convert bounding box to a string if "boundingBox" in params: params['boundingBox'] = to_str(params['boundingBox']) - # Build URL with service and profile - url = BASE_URL + service + "/" + profile + url = f"{BASE_URL}/{service}/{profile}" - # Print URL req = PreparedRequest() req.prepare_url(url, params=params) print(f"Request: {req.url}") - # Make a GET request with the filtered parameters response = requests.get(url, params=params, verify=ssl_check) response.raise_for_status df = pd.read_csv(StringIO(response.text), delimiter=",") - #return response - return df, BaseMetadata(response) + +def _check_profiles( + service: str, + profile: str, +) -> None: + """Check whether a service profile is valid. + + Parameters + ---------- + service : string + One of the service names from the "services" list. + profile : string + One of the profile names from "results_profiles", + "locations_profiles", "activities_profiles", + "projects_profiles" or "organizations_profiles". + """ + valid_services = get_args(_SERVICES) + if service not in valid_services: + raise ValueError( + f"Invalid service: '{service}'. " + f"Valid options are: {valid_services}." + ) + + valid_profiles = get_args(_PROFILES[service]) + if profile not in valid_profiles: + raise ValueError( + f"Invalid profile: '{profile}' for service '{service}'. " + f"Valid options are: {valid_profiles}." + ) + From fa7b5f70e73529b3a332a796c7c0f5d231b88a29 Mon Sep 17 00:00:00 2001 From: thodson-usgs Date: Fri, 25 Apr 2025 16:55:31 -0500 Subject: [PATCH 17/21] Fix typos --- dataretrieval/samples.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dataretrieval/samples.py b/dataretrieval/samples.py index 7fc125a0..85964930 100644 --- a/dataretrieval/samples.py +++ b/dataretrieval/samples.py @@ -24,7 +24,7 @@ BASE_URL = "https://api.waterdata.usgs.gov/samples-data" -_SERVICES = Literal["activites", "locations", "organizations", "projects", "results"] +_SERVICES = Literal["activities", "locations", "organizations", "projects", "results"] _PROFILES = { "activities": Literal["sampact", "actmetric", "actgroup", "count"], @@ -49,7 +49,7 @@ "characteristicgroup", "characteristics", "counties", - "countries" + "countries", "observedproperty", "samplemedia", "sitetype", @@ -102,7 +102,7 @@ def get_codes(code_service: _CODE_SERVICES) -> DataFrame: response = requests.get(url) - response.raise_for_status + response.raise_for_status() data_dict = json.loads(response.text) data_list = data_dict['data'] @@ -303,7 +303,7 @@ def get_usgs_samples( response = requests.get(url, params=params, verify=ssl_check) - response.raise_for_status + response.raise_for_status() df = pd.read_csv(StringIO(response.text), delimiter=",") From 01adcc4e054d3f3e778f94e23e7da75a814a17c1 Mon Sep 17 00:00:00 2001 From: thodson-usgs Date: Sat, 26 Apr 2025 13:20:08 -0500 Subject: [PATCH 18/21] Refactor service lookup and add type hints --- dataretrieval/samples.py | 159 +++++++++++++++++++++------------------ 1 file changed, 85 insertions(+), 74 deletions(-) diff --git a/dataretrieval/samples.py b/dataretrieval/samples.py index 85964930..dea359ce 100644 --- a/dataretrieval/samples.py +++ b/dataretrieval/samples.py @@ -1,7 +1,7 @@ -"""Functions for downloading data from the USGS Aquarius Samples database (https://waterqualitydata.us) +"""Functions for downloading data from the USGS Aquarius Samples database +(https://waterdata.usgs.gov/download-samples/#dataProfile=site). See https://api.waterdata.usgs.gov/samples-data/docs#/ for API reference - """ from __future__ import annotations @@ -17,21 +17,51 @@ from dataretrieval.utils import BaseMetadata, to_str if TYPE_CHECKING: - from typing import Tuple + from typing import Optional, Tuple, Union from pandas import DataFrame -BASE_URL = "https://api.waterdata.usgs.gov/samples-data" +_BASE_URL = "https://api.waterdata.usgs.gov/samples-data" + +_CODE_SERVICES = Literal[ + "characteristicgroup", + "characteristics", + "counties", + "countries", + "observedproperty", + "samplemedia", + "sitetype", + "states", +] + _SERVICES = Literal["activities", "locations", "organizations", "projects", "results"] -_PROFILES = { - "activities": Literal["sampact", "actmetric", "actgroup", "count"], - "locations": Literal["site", "count"], - "organizations": Literal["organization", "count"], - "projects": Literal["project", "projectmonitoringlocationweight"], - "results": Literal[ +_PROFILES = Literal[ + "actgroup", + "actmetric", + "basicbio", + "basicphyschem", + "count", + "fullbio", + "fullphyschem", + "labsampleprep", + "narrow", + "organization", + "project", + "projectmonitoringlocationweight", + "resultdetectionquantitationlimit", + "sampact", + "site", +] + +_PROFILE_LOOKUP = { + "activities": ["sampact", "actmetric", "actgroup", "count"], + "locations": ["site", "count"], + "organizations": ["organization", "count"], + "projects": ["project", "projectmonitoringlocationweight"], + "results": [ "fullphyschem", "basicphyschem", "fullbio", @@ -43,44 +73,7 @@ ], } -_ALL_PROFILES = Literal[*[v for k,v in _PROFILES.items()]] - -_CODE_SERVICES = Literal[ - "characteristicgroup", - "characteristics", - "counties", - "countries", - "observedproperty", - "samplemedia", - "sitetype", - "states", -] - -_SAMPLES_KWARGS = Literal[ - "activityMediaName", - "activityStartDateLower", - "activityStartDateUpper", - "activityTypeCode", - "boundingBox", - "characteristic", - "characteristicGroup", - "characteristicUserSupplied", - "countyFips", - "countryFips", - "hydrologicUnit", - "monitoringLocationIdentifier", - "organizationIdentifier", - "pointLocationLatitude", - "pointLocationLongitude", - "pointLocationWithinMiles", - "projectIdentifier", - "recordIdentifierUserSupplied", - "siteTypeCode", - "siteTypeName", - "stateFips", - "usgsPCode", -] - + def get_codes(code_service: _CODE_SERVICES) -> DataFrame: """Return codes from a Samples code service. @@ -98,7 +91,7 @@ def get_codes(code_service: _CODE_SERVICES) -> DataFrame: f"Valid options are: {valid_code_services}." ) - url = f"{BASE_URL}/codeservice/{code_service}?mimeType=application%2Fjson" + url = f"{_BASE_URL}/codeservice/{code_service}?mimeType=application%2Fjson" response = requests.get(url) @@ -112,13 +105,33 @@ def get_codes(code_service: _CODE_SERVICES) -> DataFrame: return df def get_usgs_samples( - ssl_check=True, - service: _SERVICES = "results", - profile= "fullphyschem", - **kwargs, - ) -> Tuple[DataFrame, BaseMetadata]: + ssl_check: bool = True, + service: _SERVICES = "results", + profile: _PROFILES = "fullphyschem", + activityMediaName: Optional[Union[str, list[str]]] = None, + activityStartDateLower: Optional[str] = None, + activityStartDateUpper: Optional[str] = None, + activityTypeCode: Optional[Union[str, list[str]]] = None, + characteristicGroup: Optional[Union[str, list[str]]] = None, + characteristic: Optional[Union[str, list[str]]] = None, + characteristicUserSupplied: Optional[Union[str, list[str]]] = None, + boundingBox: Optional[list[float]] = None, + countryFips: Optional[Union[str, list[str]]] = None, + stateFips: Optional[Union[str, list[str]]] = None, + countyFips: Optional[Union[str, list[str]]] = None, + siteTypeCode: Optional[Union[str, list[str]]] = None, + siteTypeName: Optional[Union[str, list[str]]] = None, + usgsPCode: Optional[Union[str, list[str]]] = None, + hydrologicUnit: Optional[Union[str, list[str]]] = None, + monitoringLocationIdentifier: Optional[Union[str, list[str]]] = None, + organizationIdentifier: Optional[Union[str, list[str]]] = None, + pointLocationLatitude: Optional[float] = None, + pointLocationLongitude: Optional[float] = None, + pointLocationWithinMiles: Optional[float] = None, + projectIdentifier: Optional[Union[str, list[str]]] = None, + recordIdentifierUserSupplied: Optional[Union[str, list[str]]] = None, +) -> Tuple[DataFrame, BaseMetadata]: """Search Samples database for USGS water quality data. - This is a wrapper function for the Samples database API. All potential filters are provided as arguments to the function, but please do not populate all possible filters; leave as many as feasible with their default @@ -143,10 +156,13 @@ def get_usgs_samples( profile : string One of the available profiles associated with a service. Options for each service are: - results - "fullphyschem", "basicphyschem", "fullbio", "basicbio", "narrow", - "resultdetectionquantitationlimit", "labsampleprep", "count" + results - "fullphyschem", "basicphyschem", + "fullbio", "basicbio", "narrow", + "resultdetectionquantitationlimit", + "labsampleprep", "count" locations - "site", "count" - activities - "sampact", "actmetric", "actgroup", "count" + activities - "sampact", "actmetric", + "actgroup", "count" projects - "project", "projectmonitoringlocationweight" organizations - "organization", "count" activityMediaName : string or list of strings, optional @@ -275,27 +291,22 @@ def get_usgs_samples( ... usgsPCode='00400') """ + _check_profiles(service, profile) - valid_kwargs = get_args(_SAMPLES_KWARGS) - if not all(key in valid_kwargs for key in kwargs): - raise ValueError( - f"Invalid keyword arguments. Valid options are: {valid_kwargs}." - ) + params = { + k: v for k, v in locals().items() + if k not in ["ssl_check", "service", "profile"] + and v is not None + } - if len(kwargs) == 0: - raise TypeError( - "No filter parameters provided. You must add at least " - "one filter parameter beyond a service, profile, and format argument." - ) - - params = {"mimeType": "text/csv"} - params.update(kwargs) + + params.update({"mimeType": "text/csv"}) if "boundingBox" in params: - params['boundingBox'] = to_str(params['boundingBox']) + params["boundingBox"] = to_str(params["boundingBox"]) - url = f"{BASE_URL}/{service}/{profile}" + url = f"{_BASE_URL}/{service}/{profile}" req = PreparedRequest() req.prepare_url(url, params=params) @@ -331,7 +342,7 @@ def _check_profiles( f"Valid options are: {valid_services}." ) - valid_profiles = get_args(_PROFILES[service]) + valid_profiles = _PROFILE_LOOKUP[service] if profile not in valid_profiles: raise ValueError( f"Invalid profile: '{profile}' for service '{service}'. " From b6753a2cc8d19aea224c3114a062ed59b915486d Mon Sep 17 00:00:00 2001 From: thodson-usgs Date: Tue, 29 Apr 2025 15:03:15 -0500 Subject: [PATCH 19/21] Update samples tests --- dataretrieval/samples.py | 4 ++-- tests/samples_test.py | 34 +++++++++++++++++----------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/dataretrieval/samples.py b/dataretrieval/samples.py index dea359ce..89e526a2 100644 --- a/dataretrieval/samples.py +++ b/dataretrieval/samples.py @@ -321,8 +321,8 @@ def get_usgs_samples( return df, BaseMetadata(response) def _check_profiles( - service: str, - profile: str, + service: _SERVICES, + profile: _PROFILES, ) -> None: """Check whether a service profile is valid. diff --git a/tests/samples_test.py b/tests/samples_test.py index eac04aef..c3e2a995 100755 --- a/tests/samples_test.py +++ b/tests/samples_test.py @@ -5,7 +5,7 @@ from dataretrieval.samples import ( _check_profiles, - get_USGS_samples + get_usgs_samples ) def mock_request(requests_mock, request_url, file_path): @@ -15,7 +15,7 @@ def mock_request(requests_mock, request_url, file_path): request_url, text=text.read(), headers={"mock_header": "value"} ) -def test_mock_get_USGS_samples(requests_mock): +def test_mock_get_usgs_samples(requests_mock): """Tests USGS Samples query""" request_url = ( "https://api.waterdata.usgs.gov/samples-data/results/fullphyschem?" @@ -24,14 +24,14 @@ def test_mock_get_USGS_samples(requests_mock): ) response_file_path = "data/samples_results.txt" mock_request(requests_mock, request_url, response_file_path) - df, md = get_USGS_samples( - service="results", - profile="fullphyschem", - activityMediaName="Water", - activityStartDateLower="2020-01-01", - activityStartDateUpper="2024-12-31", - monitoringLocationIdentifier="USGS-05406500" - ) + df, md = get_usgs_samples( + service="results", + profile="fullphyschem", + activityMediaName="Water", + activityStartDateLower="2020-01-01", + activityStartDateUpper="2024-12-31", + monitoringLocationIdentifier="USGS-05406500", + ) assert type(df) is DataFrame assert df.size == 12127 assert md.url == request_url @@ -41,14 +41,14 @@ def test_mock_get_USGS_samples(requests_mock): def test_check_profiles(): """Tests that correct errors are raised for invalid profiles.""" - with pytest.raises(TypeError): + with pytest.raises(ValueError): _check_profiles(service="foo", profile="bar") - with pytest.raises(TypeError): + with pytest.raises(ValueError): _check_profiles(service="results", profile="foo") def test_samples_results(): """Test results call for proper columns""" - df,_ = get_USGS_samples( + df,_ = get_usgs_samples( service="results", profile="narrow", monitoringLocationIdentifier="USGS-05288705", @@ -60,7 +60,7 @@ def test_samples_results(): def test_samples_activity(): """Test activity call for proper columns""" - df,_ = get_USGS_samples( + df,_ = get_usgs_samples( service="activities", profile="sampact", monitoringLocationIdentifier="USGS-06719505" @@ -71,7 +71,7 @@ def test_samples_activity(): def test_samples_locations(): """Test locations call for proper columns""" - df,_ = get_USGS_samples( + df,_ = get_usgs_samples( service="locations", profile="site", stateFips="US:55", @@ -84,7 +84,7 @@ def test_samples_locations(): def test_samples_projects(): """Test projects call for proper columns""" - df,_ = get_USGS_samples( + df,_ = get_usgs_samples( service="projects", profile="project", stateFips="US:15", @@ -96,7 +96,7 @@ def test_samples_projects(): def test_samples_organizations(): """Test organizations call for proper columns""" - df,_ = get_USGS_samples( + df,_ = get_usgs_samples( service="organizations", profile="count", stateFips="US:01" From e1b50b4ca86638b5d51fa6d7be01cca33100a2af Mon Sep 17 00:00:00 2001 From: Timothy Hodson <34148978+thodson-usgs@users.noreply.github.com> Date: Tue, 29 Apr 2025 15:35:38 -0500 Subject: [PATCH 20/21] Update dataretrieval/samples.py Co-authored-by: Elise Hinman <121896266+ehinman@users.noreply.github.com> --- dataretrieval/samples.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dataretrieval/samples.py b/dataretrieval/samples.py index 89e526a2..8ca217a4 100644 --- a/dataretrieval/samples.py +++ b/dataretrieval/samples.py @@ -1,5 +1,5 @@ """Functions for downloading data from the USGS Aquarius Samples database -(https://waterdata.usgs.gov/download-samples/#dataProfile=site). +(https://waterdata.usgs.gov/download-samples/). See https://api.waterdata.usgs.gov/samples-data/docs#/ for API reference """ From a4f71e348c7a2b2911d310080d723a20d4662a42 Mon Sep 17 00:00:00 2001 From: thodson-usgs Date: Tue, 6 May 2025 12:06:59 -0500 Subject: [PATCH 21/21] Rename examples to --- dataretrieval/samples.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dataretrieval/samples.py b/dataretrieval/samples.py index 8ca217a4..eb3a614f 100644 --- a/dataretrieval/samples.py +++ b/dataretrieval/samples.py @@ -272,13 +272,13 @@ def get_usgs_samples( .. code:: >>> # Get PFAS results within a bounding box - >>> df, md = dataretrieval.samples.get_USGS_samples( + >>> df, md = dataretrieval.samples.get_usgs_samples( ... boundingBox=[-90.2,42.6,-88.7,43.2], ... characteristicGroup="Organics, PFAS" ... ) >>> # Get all activities for the Commonwealth of Virginia over a date range - >>> df, md = dataretrieval.samples.get_USGS_samples( + >>> df, md = dataretrieval.samples.get_usgs_samples( ... service="activities", ... profile="sampact", ... activityStartDateLower="2023-10-01", @@ -286,7 +286,7 @@ def get_usgs_samples( ... stateFips="US:51") >>> # Get all pH samples for two sites in Utah - >>> df, md = dataretrieval.samples.get_USGS_samples( + >>> df, md = dataretrieval.samples.get_usgs_samples( ... monitoringLocationIdentifier=['USGS-393147111462301', 'USGS-393343111454101'], ... usgsPCode='00400')