pvdeg.weather.write#

pvdeg.weather.write(data_df, metadata, savefile='WeatherFile.csv')[source]#

Save dataframe with weather data and any associated meta data in an *.csv format.

The metadata will be formatted on the first two lines with the first being the descriptor and the second line being the value. Then the meterological, time and other data series headers on on the third line with all the subsequent data on the remaining lines. This format can be read by the PVDeg software.

Parameters:
  • data_df (pandas.DataFrame) – timeseries data.

  • metdata (dictionary) – Dictionary with ‘latitude’, ‘longitude’, ‘altitude’, ‘source’, ‘tz’ for timezone, and other meta data.

  • savefile (str) – Name of file to save output as. Name of file to save output as.

  • standardSAM (boolean) – This checks the dataframe to avoid having a leap day, then averages it to SAM style (closed to the right), and fills the years so it starst on YEAR/1/1 0:0 and ends on YEAR/12/31 23:00.

  • Bool (includeminute ;) –

    For hourly data, if SAM input does not have Minutes, it calculates the sun position 30 minutes prior to the hour (i.e. 12 timestamp means sun

    position at 11:30).

    If minutes are included, it will calculate the sun position at the time of the timestamp (12:00 at 12:00) Set to true if resolution of data is sub-hourly. Name of file to save output as.

  • standardSAM – This checks the dataframe to avoid having a leap day, then averages it to SAM style (closed to the right), and fills the years so it starst on YEAR/1/1 0:0 and ends on YEAR/12/31 23:00.

  • Bool

    For hourly data, if SAM input does not have Minutes, it calculates the sun position 30 minutes prior to the hour (i.e. 12 timestamp means sun

    position at 11:30).

    If minutes are included, it will calculate the sun position at the time of the timestamp (12:00 at 12:00) Set to true if resolution of data is sub-hourly.

Returns:

Nothing, it just writes the file.