, default_quality_flag=None)[source]

Extracts a variable from an observation DataFrame and formats it into a JSON payload for posting to the Solar Forecast Arbiter API.

  • observation_df (DataFrame) – Dataframe of observation data. Must contain a tz-aware DateTimeIndex and a ‘value’ column. May contain a column of data quality flags labeled ‘quality_flag’.
  • default_quality_flag (int) – If ‘quality_flag’ is not a column, the quality flag for each row is set to this value.

string – SolarForecastArbiter API JSON payload for posting to the observation endpoint. See Notes section for example.


Function returns an object in the following format:

  'values': [
      “timestamp”: “2018-11-22T12:01:48Z”, # ISO 8601 datetime in UTC
      “value”: 10.23, # floating point value of observation
      “quality_flag”: 0
Raises:KeyError – When ‘value’ is missing from the columns or ‘quality_flag’ is missing and default_quality_flag is None