spacepy.datamodel.writeJSONMetadata

spacepy.datamodel.writeJSONMetadata(fname, insd, depend0=None, order=None, verbose=False, returnString=False)[source]

Scrape metadata from SpaceData object and make a JSON header

Parameters
fnamestr

Filename to write to (can also use a file-like object) None can be given in conjunction with the returnString keyword to skip writing output

insdspacepy.datamodel.SpaceData

SpaceData with associated attributes and variables in dmarrays

Returns
None (unless returnString keyword is True)
Other Parameters
depend0str (optional)

variable name to use to indicate parameter on which other data depend (e.g. Time)

orderlist (optional)

list of key names in order of start column in output JSON file

verbose: bool (optional)

verbose output

returnString: bool (optional)

return JSON header as string instead of returning None