cdf2df

heliopy.data.helper.cdf2df(cdf, index_key, keys=None, dtimeindex=True, badvalues=None)

Converts a cdf file to a pandas dataframe.

Parameters:
  • cdf (cdf) – Opened cdf file
  • index_key (string) – The key to use as indexing in the output dataframe
  • keys (dict, optional) – A dictionary that maps keys in the cdf file to the corresponding desired keys in the ouput dataframe. If a particular cdf key has multiple columns, the mapped keys must be in a list.
  • dtimeindex (bool, optional) – If True, DataFrame index is parsed as a datetime. Default is True.
  • badvalues (dict, optional) – A dictionary that maps the new DataFrame keys to a list of bad values to replace with nans.
Returns:

df – Data frame with read in data

Return type:

pandas.DataFrame