NOAA-OWP / hydrotools

Suite of tools for retrieving USGS NWIS observations and evaluating National Water Model (NWM) data.
Other
53 stars 12 forks source link

NWPS API Available #250

Open jarq6c opened 3 months ago

jarq6c commented 3 months ago

The National Water Prediction Service will replace AHPS this summer and includes APIs that serve observations and forecasts of streamflow and stage. We might consider adding a client tool to support this.

https://api.water.noaa.gov/nwps/v1/docs/#/

jarq6c commented 3 months ago

@aaraney any thoughts?

jarq6c commented 3 months ago

Looks like this can serve as a sophisticated crosswalk.

https://api.water.noaa.gov/nwps/v1/gauges/01013500

{
  "lid": "FIHM1",
  "usgsId": "01013500",
  "reachId": "724696",
  "name": "Fish River at Fort Kent",
  "description": "",
  "rfc": {
    "abbreviation": "NERFC",
    "name": "Northeast River Forecast Center"
  },
  "wfo": {
    "abbreviation": "",
    "name": ""
  },
  "state": {
    "abbreviation": "ME",
    "name": "Maine"
  },
  "county": "Aroostook",
  "timeZone": "EST5EDT",
  "latitude": 47.2375,
  "longitude": -68.58277778,
  "datum": {
    "elevation": 531.8
  },
  "pedts": {
    "observed": "HGIRG",
    "forecast": "HGIFF"
  },
  "status": {
    "observed": {
      "primary": 4.56,
      "primaryUnit": "ft",
      "secondary": 1.43,
      "secondaryUnit": "kcfs",
      "floodCategory": "no_flooding",
      "validTime": "2024-03-28T11:45:00Z"
    },
    "forecast": {
      "primary": -999,
      "primaryUnit": "",
      "secondary": -999,
      "secondaryUnit": "",
      "floodCategory": "fcst_not_current",
      "validTime": "0001-01-01T00:00:00Z"
    }
  },
  "flood": {
    "stageUnits": "ft",
    "flowUnits": "cfs",
    "categories": {
      "major": {
        "stage": 13,
        "flow": -9999
      },
      "moderate": {
        "stage": 12,
        "flow": 16586
      },
      "minor": {
        "stage": 11,
        "flow": 13892
      },
      "action": {
        "stage": 10,
        "flow": 11379
      }
    },
    "lro": {
      "minorCS": "< 0.05",
      "moderateCS": "< 0.05",
      "majorCS": "< 0.05",
      "producedTime": "2024-03-25T14:59:27Z",
      "interval": "MAM"
    },
    "crests": {
      "historic": [
        {
          "occurredTime": "2008-04-30T21:15:00Z",
          "stage": 13.93,
          "flow": 18300,
          "preliminary": "R",
          "olddatum": false
        },
        {
          "occurredTime": "1973-04-30T00:00:00Z",
          "stage": 12.43,
          "flow": 17800,
          "preliminary": "O",
          "olddatum": false
        },
        {
          "occurredTime": "2018-05-03T22:15:00Z",
          "stage": 12.02,
          "flow": 16200,
          "preliminary": "O",
          "olddatum": false
        },
        {
          "occurredTime": "1983-04-26T00:00:00Z",
          "stage": 11.75,
          "flow": 15900,
          "preliminary": "O",
          "olddatum": false
        },
        {
          "occurredTime": "1961-05-16T00:00:00Z",
          "stage": 11.49,
          "flow": 15200,
          "preliminary": "O",
          "olddatum": false
        },
        {
          "occurredTime": "2019-04-28T22:02:00Z",
          "stage": 11.2,
          "flow": 14400,
          "preliminary": "O",
          "olddatum": false
        },
        {
          "occurredTime": "1979-04-30T00:00:00Z",
          "stage": 11.11,
          "flow": 13100,
          "preliminary": "O",
          "olddatum": false
        },
        {
          "occurredTime": "1969-05-11T00:00:00Z",
          "stage": 10.88,
          "flow": 0,
          "preliminary": "O",
          "olddatum": false
        },
        {
          "occurredTime": "2005-05-01T00:00:00Z",
          "stage": 10.88,
          "flow": 0,
          "preliminary": "O",
          "olddatum": false
        },
        {
          "occurredTime": "1969-05-12T00:00:00Z",
          "stage": 10.82,
          "flow": 12500,
          "preliminary": "O",
          "olddatum": false
        }
      ],
      "recent": [
        {
          "occurredTime": "2019-04-28T22:02:00Z",
          "stage": 11.2,
          "flow": 14400,
          "preliminary": "O",
          "olddatum": false
        },
        {
          "occurredTime": "2018-05-03T22:15:00Z",
          "stage": 12.02,
          "flow": 16200,
          "preliminary": "O",
          "olddatum": false
        },
        {
          "occurredTime": "2008-04-30T21:15:00Z",
          "stage": 13.93,
          "flow": 18300,
          "preliminary": "R",
          "olddatum": false
        },
        {
          "occurredTime": "2005-05-01T00:00:00Z",
          "stage": 10.88,
          "flow": 0,
          "preliminary": "O",
          "olddatum": false
        },
        {
          "occurredTime": "1996-04-28T00:00:00Z",
          "stage": 10.01,
          "flow": 10900,
          "preliminary": "O",
          "olddatum": false
        },
        {
          "occurredTime": "1984-05-02T00:00:00Z",
          "stage": 10.43,
          "flow": 11600,
          "preliminary": "O",
          "olddatum": false
        },
        {
          "occurredTime": "1983-04-26T00:00:00Z",
          "stage": 11.75,
          "flow": 15900,
          "preliminary": "O",
          "olddatum": false
        },
        {
          "occurredTime": "1979-04-30T00:00:00Z",
          "stage": 11.11,
          "flow": 13100,
          "preliminary": "O",
          "olddatum": false
        },
        {
          "occurredTime": "1974-05-16T00:00:00Z",
          "stage": 10.04,
          "flow": 11000,
          "preliminary": "O",
          "olddatum": false
        },
        {
          "occurredTime": "1973-04-30T00:00:00Z",
          "stage": 12.43,
          "flow": 17800,
          "preliminary": "O",
          "olddatum": false
        }
      ]
    },
    "lowWaters": {
      "historic": [
        {
          "occurredTime": "1968-08-29T00:00:00Z",
          "stage": 2.75,
          "flow": 34,
          "statement": "Min Discharge"
        },
        {
          "occurredTime": "2020-09-27T00:00:00Z",
          "stage": 2.76,
          "flow": 34,
          "statement": "Tied Record Min Discharge of 33.5 cfs"
        },
        {
          "occurredTime": "2021-09-05T00:00:00Z",
          "stage": 2.81,
          "flow": 37,
          "statement": "37.5 cfs"
        },
        {
          "occurredTime": "2021-09-03T00:00:00Z",
          "stage": 2.83,
          "flow": 43,
          "statement": "42.6 cfs"
        },
        {
          "occurredTime": "2018-10-08T00:00:00Z",
          "stage": 3,
          "flow": 65,
          "statement": ""
        }
      ]
    },
    "impacts": [
      {
        "stage": 16.5,
        "statement": "Low sections of Bradbury Road are flooded. "
      },
      {
        "stage": 14,
        "statement": "Main Street Bridge inundated with high water."
      },
      {
        "stage": 13,
        "statement": "Major flooding. Dozens of homes or camps inundated from Portage Lake to Eagle Lake and downstream. River reaches the decking of the Main Street bridge in Fort Kent. The Blockhouse area and much of West Main Street in Fort Kent inundated."
      },
      {
        "stage": 12,
        "statement": "Moderate flooding. Homes in the Soldier Pond area of Wallagrass threatened. West approach of Soldier Pond Bridge inundated with bridge closed."
      },
      {
        "stage": 11,
        "statement": "Minor flooding. Water reaches the bottom of the Main Street bridge in Fort Kent. Camps and some homes threatened on the Fish River chain of lakes"
      },
      {
        "stage": 10,
        "statement": "River approaches bankfull."
      }
    ]
  },
  "images": {
    "probability": {
      "weekint": {
        "stage": "https://water.noaa.gov/resources/probabilistic/exceedance/FIHM1.SSTG.prob.weekint.gif",
        "flow": "https://water.noaa.gov/resources/probabilistic/exceedance/FIHM1.QINE.prob.weekint.gif",
        "volume": "https://water.noaa.gov/resources/probabilistic/exceedance/FIHM1.volume.prob.weekint.gif"
      },
      "entperiod": {
        "stage": "https://water.noaa.gov/resources/probabilistic/exceedance/FIHM1.SSTG.exceed.90day.gif",
        "flow": "https://water.noaa.gov/resources/probabilistic/exceedance/FIHM1.QINE.exceed.90day.gif",
        "volume": ""
      },
      "shortrange": "https://water.noaa.gov/resources/probabilistic/short_term/FIHM1.shortrange.hefs.png"
    },
    "hydrograph": {
      "default": "https://water.noaa.gov/resources/hydrographs/fihm1_hg.png",
      "floodcat": "https://water.noaa.gov/resources/hydrographs/fihm1_record.png"
    },
    "photos": [
      {
        "id": "5493892431117095406",
        "type": "Feature",
        "geometry": {
          "type": "Point",
          "coordinates": [
            47.2375,
            -68.58277778
          ]
        },
        "properties": {
          "image": "https://water.noaa.gov/resources/photos/fihm1/5493892431117095406.jpeg",
          "caption": "Fish River on 4/30/2008 flooded at 13.8 feet"
        }
      },
      {
        "id": "6558182088660881902",
        "type": "Feature",
        "geometry": {
          "type": "Point",
          "coordinates": [
            47.2375,
            -68.58277778
          ]
        },
        "properties": {
          "image": "https://water.noaa.gov/resources/photos/fihm1/6558182088660881902.jpeg",
          "caption": "Fish River Gage from Bradbury Rd Upstream"
        }
      },
      {
        "id": "17764551293561868782",
        "type": "Feature",
        "geometry": {
          "type": "Point",
          "coordinates": [
            47.2375,
            -68.58277778
          ]
        },
        "properties": {
          "image": "https://water.noaa.gov/resources/photos/fihm1/17764551293561868782.jpeg",
          "caption": "Fish River Gage from Bradbury Rd Downstream"
        }
      },
      {
        "id": "17851533422212026862",
        "type": "Feature",
        "geometry": {
          "type": "Point",
          "coordinates": [
            47.2375,
            -68.58277778
          ]
        },
        "properties": {
          "image": "https://water.noaa.gov/resources/photos/fihm1/17851533422212026862.jpeg",
          "caption": "Fish River Gage from Bradbury Rd"
        }
      },
      {
        "id": "6592480464831320558",
        "type": "Feature",
        "geometry": {
          "type": "Point",
          "coordinates": [
            47.2375,
            -68.58277778
          ]
        },
        "properties": {
          "image": "https://water.noaa.gov/resources/photos/fihm1/6592480464831320558.jpeg",
          "caption": "Gage House Facing Downstream"
        }
      },
      {
        "id": "6697667894697333230",
        "type": "Feature",
        "geometry": {
          "type": "Point",
          "coordinates": [
            47.2375,
            -68.58277778
          ]
        },
        "properties": {
          "image": "https://water.noaa.gov/resources/photos/fihm1/6697667894697333230.jpeg",
          "caption": "Gage House Facing Upstream"
        }
      }
    ]
  },
  "dataAttribution": [
    {
      "abbrev": "US Geological Survey",
      "text": "USGS--Water Resources of the United States",
      "title": "US Geological Survey",
      "url": "https://waterdata.usgs.gov/nwis"
    },
    {
      "abbrev": "USGS",
      "text": "01013500",
      "title": "Observations courtesy of U.S. Geological Survey",
      "url": "https://waterdata.usgs.gov/nwis/inventory/?site_no=01013500"
    }
  ],
  "impactsLowWaters": [],
  "normalThreshold": {
    "value": 0,
    "units": "ft"
  },
  "hydronotes": [
    {
      "statement": "Gauge reading may be affected by ice.",
      "effective": "0101",
      "expiration": "1231"
    }
  ],
  "datums": {
    "vertical": {
      "value": [
        {
          "label": "National Geodetic Vertical Datum of 1929",
          "abbrev": "NGVD29",
          "description": "A fixed reference adopted as a standard geodetic datum for elevations determined by leveling. The datum was derived for surveys from a general adjustment of the first-order leveling nets of both the United States and Canada. In the adjustment, mean sea level was held fixed as observed at 21 tide stations in the United States and 5 in Canada. The year indicates the time of the general adjustment. A synonym for Sea-level Datum of 1929. The geodetic datum is fixed and does not take into account the changing stands of sea level. Because there are many variables affecting sea level, and because the geodetic datum represents a best fit over a broad area, the relationship between the geodetic datum and local mean sea level is not consistent from one location to another in either time or space. For this reason, the National Geodetic Vertical Datum should not be confused with mean sea level. See North American Vertical Datum of 1988 (NAVD 88). NGVD 29 should not be used as Mean Sea Level. NGVD 29 is no longer supported by NGS.",
          "value": 511.38
        }
      ]
    },
    "horizontal": {
      "value": []
    },
    "notes": {
      "value": []
    }
  },
  "inundation": {
    "enabled": false,
    "url": "",
    "zeroDatum": null,
    "downloads": null,
    "siteSpecificInfo": "",
    "dataAttribution": []
  },
  "upstreamLid": "",
  "downstreamLid": "FTKM1",
  "inService": {
    "enabled": true,
    "message": ""
  },
  "lowThreshold": null,
  "forecastReliability": "Forecasts are issued routinely year-round.",
  "TruncateObs": "-1",
  "TruncateFcst": "3"
}
aaraney commented 3 months ago

Thanks for pinging me, @jarq6c! At first glance, this seems like something we should prioritize developing a client for. I've not done much in terms of digging to see what capabilities there are and of those capabilities which we would choose to support, but I will block of some time to explore this more. This is really exciting stuff!

aaraney commented 3 months ago

In the meantime, you should be able to generate a client library for interacting with these apis using something like openapi-generator.