sensortoolkit.reference._ref_api_query.modify_ref_method_str

modify_ref_method_str(df, param)[source]

Subroutine for Ref_API_Query tha replaces various characters in data columns containing text, including the method name and the parameter units.

Instrument Method names retrieved from the method code lookup table are specified in all upper case characters. These are converted to title cased characters (e.g., This Is Title Cased Text). While this imrpoves legibility some phrases (particularly acronyms, conjunctions, prepositions, ect.) should not be title cased. This function replaces specific phrases with the expected format.

In addition, abbreviated unit names (used by AirNow) are converted to long format text to ensure consistency for reference data retreived from AQS, AirNow, and AirNowTech, and also to improve legibility.

Parameters
  • df (pandas DataFrame) – Dataframe resulting from API query.

  • param (str) – The evaluation parameter.

Returns

Modified dataframe with method and unit strings corrected.

Return type

df (pandas DataFrame)