# spacepy.datamodel.toCDF

`spacepy.datamodel.``toCDF`(fname, SDobject, **kwargs)

  Create a CDF file from a SpacePy datamodel representation

  Parameters: | fname : str Filename to write to SDobject : spacepy.datamodel.SpaceData SpaceData with associated attributes and variables in dmarrays
  Returns: | None
  Other Parameters:
  | skeleton : str (optional) create new CDF from a skeleton file (default ‘’) flatten : bool (optional) flatten incoming datamodel - if SpaceData objects are nested (default False) overwrite : bool (optional) allow overwrite of an existing target file (default False) autoNRV : bool (optional) attempt automatic identification of non-record varying entries in CDF backward : bool (optional) create CDF in backward-compatible format (default is v3+ compatibility only) TT2000 : bool (optional) write variables beginning with ‘Epoch’ as datatype CDF_TT2000 (default is automatic selection of EPOCH or EPOCH16) verbose : bool (optional) verbosity flag