slv.inversion.config.build_location_site_map#
- slv.inversion.config.build_location_site_map(location_ids, site_config)[source]#
Build location mapper from STILT location IDs to site names.
Parses location IDs (format: “lon_lat_height”) and matches them to sites in the site_config: within 1e-5 deg (~1 m) in lat/lon and 0.5 m in height. (
np.isclose’s default relative tolerance allowed ~0.0011 deg of longitude, ~95 m.)- Parameters:
- Returns:
Mapping from location ID to site name. Unmapped IDs are omitted from the result.
- Return type:
Examples
>>> loc_ids = ["-111.847672_40.766189_35", "-111.884505_40.902945_4"] >>> site_config = load_site_config() >>> mapper = build_location_site_map(loc_ids, site_config) >>> mapper["-111.847672_40.766189_35"] 'wbb'