shakemap.utils.dataframe

shakemap.utils.dataframe.dataframe_to_xml(df, xmlfile, reference=None)[source]

Write an MMI dataframe to ShakeMap XML format.

This method accepts a dataframe with this structure:
  • STATION: Station code (REQUIRED)

  • LAT: Station latitude. (REQUIRED)

  • LON: Station longitude. (REQUIRED)

  • DISTANCE: Distance (km) from station to origin.

  • NETID: Network ID

  • SOURCE: Description of data contributor.

  • INTENSITY: MMI intensity.

  • NRESP: Number of responses for aggregated intensity.

Parameters:
  • df (DataFrame) – Pandas dataframe, as described in read_excel.

  • xmlfile (str) – Path to file where XML file should be written.