add_station_lat_lon¶
-
metpy.io.
add_station_lat_lon
(df, stn_var)[source]¶ Lookup station information to add the station latitude and longitude to the DataFrame.
This function will add two columns to the DataFrame (‘latitude’ and ‘longitude’) after looking up all unique station identifiers available in the DataFrame.
- Parameters
df (
pandas.DataFrame
) – The DataFrame that contains the station observationsstn_var (str) – The string of the variable name that represents the station in the DataFrame. Common examples are ‘station’, ‘stid’, and ‘station_id’
- Returns
pandas.DataFrame
that contains original Dataframe now with the latitude and longitudevalues for each location found in
station_info
.