dataframe_to_netcdf

This function encodes an existing Dataframe into a NetCDF file following CF & in-situ conventions

libinsitu.dataframe_to_netcdf(data, out_filename, station_name, network_name=None, latitude=None, longitude=None, elevation=None, process_qc=True, close=True, network_props={}, station_props={}, custom_cdl=None)

Transforms a Dataframe of solar irradiance to a well encoded NetCDF file.

Parameters
  • data – The dataframe. It should contain GHI, DHI, BNI columns in W.m-2 and be indexed by UTC time (Datetime index)

  • out_filename – Name of output file

  • station_name – Station name. Can also be passed as ‘Name’ in station properties

  • network_name – Network name. Can also be passed as ‘Name’ in network properties

  • latitude – Station latitude. Can also be passed as ‘Latitude’ in station properties

  • longitude – Station longitude. Can also be passed as ‘Longitude’ in station properties

  • elevation – Station elevation. Can also be passed as ‘Elevation’ in station properties

  • process_qc – Process and embed QC flags (true be default)

  • close – Close netcdf file at the end of process

  • network_props – Dict of additional network properties (without Network_ prefix), as used in base.cdl

  • station_props – Dict of additional station properties (without Station_ prefix) as used in base.cdl

  • custom_cdl – File path to custom schema.cdl file