Skip to content

HmsGaugeData

Compatibility facade for gauge-first metadata, basin, HUC, and pour-point primitives.

hms_commander.HmsGaugeData

Gauge-first hydrology primitives.

This is a thin compatibility facade over HmsHydrologyContext so older code can keep importing HmsGaugeData while the actual implementation lives in the study module.

HmsGaugeData

Primitive-first USGS/NLDI gauge and gauge-driven context helpers.

Source code in hms_commander/HmsGaugeData.py
class HmsGaugeData:
    """Primitive-first USGS/NLDI gauge and gauge-driven context helpers."""

    @staticmethod
    def normalize_site_id(site_id: Any) -> str:
        """Normalize a USGS site id."""
        return HmsHydrologyContext.normalize_site_id(site_id)

    @staticmethod
    def get_nldi_feature_id(site_id: Any) -> str:
        """Return the NLDI feature id for a site."""
        return HmsHydrologyContext.get_nldi_feature_id(site_id)

    @staticmethod
    def get_usgs_gauge_metadata(site_id: Any, session: Optional[Any] = None) -> Dict[str, Any]:
        """Fetch combined NLDI and NWIS metadata for a gauge."""
        return HmsHydrologyContext.get_usgs_gauge_metadata(site_id, session=session)

    @staticmethod
    def get_usgs_gauge_point_feature(
        site_id: Optional[Any] = None,
        gauge_metadata: Optional[Mapping[str, Any]] = None,
        session: Optional[Any] = None,
    ) -> Dict[str, Any]:
        """Build a point FeatureCollection for a gauge site."""
        return HmsHydrologyContext.get_usgs_gauge_point_feature(
            site_id=site_id,
            gauge_metadata=gauge_metadata,
            session=session,
        )

    @staticmethod
    def get_nldi_basin_from_gauge(site_id: Any, session: Optional[Any] = None) -> Dict[str, Any]:
        """Fetch the NLDI basin for a gauge."""
        return HmsHydrologyContext.get_nldi_basin_from_gauge(site_id, session=session)

    @staticmethod
    def get_nhdplus_upstream_flowlines_from_gauge(
        site_id: Any,
        distance_km: float = 25.0,
        session: Optional[Any] = None,
    ) -> Dict[str, Any]:
        """Fetch upstream flowlines for a gauge."""
        return HmsHydrologyContext.get_nhdplus_upstream_flowlines_from_gauge(
            site_id,
            distance_km=distance_km,
            session=session,
        )

    @staticmethod
    def get_nhd_huc_boundary_from_gauge(
        site_id: Any,
        huc_level: str = "huc12",
        session: Optional[Any] = None,
    ) -> Dict[str, Any]:
        """Fetch the containing HUC boundary for a gauge location."""
        return HmsHydrologyContext.get_nhd_huc_boundary_from_gauge(
            site_id,
            huc_level=huc_level,
            session=session,
        )

    @staticmethod
    def get_nhd_huc8_boundary_from_gauge(site_id: Any, session: Optional[Any] = None) -> Dict[str, Any]:
        """Convenience wrapper for HUC8 context."""
        return HmsHydrologyContext.get_nhd_huc8_boundary_from_gauge(site_id, session=session)

    @staticmethod
    def get_nhd_huc12_boundary_from_gauge(site_id: Any, session: Optional[Any] = None) -> Dict[str, Any]:
        """Convenience wrapper for HUC12 context."""
        return HmsHydrologyContext.get_nhd_huc12_boundary_from_gauge(site_id, session=session)

    @staticmethod
    def build_pour_point_feature(
        coordinates: Optional[Sequence[float]] = None,
        gauge_metadata: Optional[Mapping[str, Any]] = None,
        properties: Optional[Mapping[str, Any]] = None,
    ) -> Dict[str, Any]:
        """Build a TauDEM-style pour point FeatureCollection."""
        return HmsHydrologyContext.build_pour_point_feature(
            coordinates=coordinates,
            gauge_metadata=gauge_metadata,
            properties=properties,
        )

normalize_site_id(site_id) staticmethod

Normalize a USGS site id.

Source code in hms_commander/HmsGaugeData.py
@staticmethod
def normalize_site_id(site_id: Any) -> str:
    """Normalize a USGS site id."""
    return HmsHydrologyContext.normalize_site_id(site_id)

get_nldi_feature_id(site_id) staticmethod

Return the NLDI feature id for a site.

Source code in hms_commander/HmsGaugeData.py
@staticmethod
def get_nldi_feature_id(site_id: Any) -> str:
    """Return the NLDI feature id for a site."""
    return HmsHydrologyContext.get_nldi_feature_id(site_id)

get_usgs_gauge_metadata(site_id, session=None) staticmethod

Fetch combined NLDI and NWIS metadata for a gauge.

Source code in hms_commander/HmsGaugeData.py
@staticmethod
def get_usgs_gauge_metadata(site_id: Any, session: Optional[Any] = None) -> Dict[str, Any]:
    """Fetch combined NLDI and NWIS metadata for a gauge."""
    return HmsHydrologyContext.get_usgs_gauge_metadata(site_id, session=session)

get_usgs_gauge_point_feature(site_id=None, gauge_metadata=None, session=None) staticmethod

Build a point FeatureCollection for a gauge site.

Source code in hms_commander/HmsGaugeData.py
@staticmethod
def get_usgs_gauge_point_feature(
    site_id: Optional[Any] = None,
    gauge_metadata: Optional[Mapping[str, Any]] = None,
    session: Optional[Any] = None,
) -> Dict[str, Any]:
    """Build a point FeatureCollection for a gauge site."""
    return HmsHydrologyContext.get_usgs_gauge_point_feature(
        site_id=site_id,
        gauge_metadata=gauge_metadata,
        session=session,
    )

get_nldi_basin_from_gauge(site_id, session=None) staticmethod

Fetch the NLDI basin for a gauge.

Source code in hms_commander/HmsGaugeData.py
@staticmethod
def get_nldi_basin_from_gauge(site_id: Any, session: Optional[Any] = None) -> Dict[str, Any]:
    """Fetch the NLDI basin for a gauge."""
    return HmsHydrologyContext.get_nldi_basin_from_gauge(site_id, session=session)

get_nhdplus_upstream_flowlines_from_gauge(site_id, distance_km=25.0, session=None) staticmethod

Fetch upstream flowlines for a gauge.

Source code in hms_commander/HmsGaugeData.py
@staticmethod
def get_nhdplus_upstream_flowlines_from_gauge(
    site_id: Any,
    distance_km: float = 25.0,
    session: Optional[Any] = None,
) -> Dict[str, Any]:
    """Fetch upstream flowlines for a gauge."""
    return HmsHydrologyContext.get_nhdplus_upstream_flowlines_from_gauge(
        site_id,
        distance_km=distance_km,
        session=session,
    )

get_nhd_huc_boundary_from_gauge(site_id, huc_level='huc12', session=None) staticmethod

Fetch the containing HUC boundary for a gauge location.

Source code in hms_commander/HmsGaugeData.py
@staticmethod
def get_nhd_huc_boundary_from_gauge(
    site_id: Any,
    huc_level: str = "huc12",
    session: Optional[Any] = None,
) -> Dict[str, Any]:
    """Fetch the containing HUC boundary for a gauge location."""
    return HmsHydrologyContext.get_nhd_huc_boundary_from_gauge(
        site_id,
        huc_level=huc_level,
        session=session,
    )

get_nhd_huc8_boundary_from_gauge(site_id, session=None) staticmethod

Convenience wrapper for HUC8 context.

Source code in hms_commander/HmsGaugeData.py
@staticmethod
def get_nhd_huc8_boundary_from_gauge(site_id: Any, session: Optional[Any] = None) -> Dict[str, Any]:
    """Convenience wrapper for HUC8 context."""
    return HmsHydrologyContext.get_nhd_huc8_boundary_from_gauge(site_id, session=session)

get_nhd_huc12_boundary_from_gauge(site_id, session=None) staticmethod

Convenience wrapper for HUC12 context.

Source code in hms_commander/HmsGaugeData.py
@staticmethod
def get_nhd_huc12_boundary_from_gauge(site_id: Any, session: Optional[Any] = None) -> Dict[str, Any]:
    """Convenience wrapper for HUC12 context."""
    return HmsHydrologyContext.get_nhd_huc12_boundary_from_gauge(site_id, session=session)

build_pour_point_feature(coordinates=None, gauge_metadata=None, properties=None) staticmethod

Build a TauDEM-style pour point FeatureCollection.

Source code in hms_commander/HmsGaugeData.py
@staticmethod
def build_pour_point_feature(
    coordinates: Optional[Sequence[float]] = None,
    gauge_metadata: Optional[Mapping[str, Any]] = None,
    properties: Optional[Mapping[str, Any]] = None,
) -> Dict[str, Any]:
    """Build a TauDEM-style pour point FeatureCollection."""
    return HmsHydrologyContext.build_pour_point_feature(
        coordinates=coordinates,
        gauge_metadata=gauge_metadata,
        properties=properties,
    )
CLB Engineering Corporation  ·  LLM Forward Engineering
HMS Commander is a free and open-source project maintained by CLB Engineering Corporation. For agencies and firms seeking to modernize H&H workflows with LLM Forward approaches, contact CLB to partner with the engineers who wrote the automation.