spacepy.datamodel.readJSONheadedASCII

spacepy.datamodel.readJSONheadedASCII(fname, mdata=None, comment='#', convert=False, restrict=None)[source]

read JSON-headed ASCII data files into a SpacePy datamodel

Parameters:
fnamestr or list

Filename(s) to read data from

Changed in version 0.5.0: Filename can now be a .gz to indicate the file is gzipped

Returns:
mdata: spacepy.datamodel.SpaceData

SpaceData with the data and metadata from the file

Other Parameters:
mdataspacepy.datamodel.SpaceData (optional)

supply metadata object, otherwise is read from fname (default None)

comment: str (optional)

comment string in file to be read; lines starting with comment are ignored (default ‘#’)

convert: bool or dict-like (optional)

If True, uses common names to try conversion from string. If a dict- like then uses the functions specified as the dict values to convert each element of ‘key’ to a non-string

restrict: list of strings (optional)

If present, restrict the variables stored to only those on this list