class_docstr: Writer producing NetCDF/CF compatible datasets.
class_docstr_tok: ["Writer","producing","NetCDF\/CF","compatible","datasets","."]
docstr: Convert the dataarray to something cf-compatible.
  
  Args:
      dataarray (xr.DataArray):
          The data array to be converted.
      epoch (str):
          Reference time for encoding of time coordinates.
          If None, the default reference time is defined using `from satpy.cf.coords import EPOCH`
      flatten_attrs (bool):
          If True, flatten dict-type attributes.
      exclude_attrs (list):
          List of dataset attributes to be excluded.
      include_orig_name (bool):
          Include the original dataset name in the netcdf variable attributes.
      numeric_name_prefix (str):
          Prepend dataset name with this if starting with a digit.
docstr_tok: ["Convert","the","dataarray","to","something","cf-compatible",".","Args",":","dataarray","(","xr.DataArray",")",":","The","data","array","to","be","converted",".","epoch","(","str",")",":","Reference","time","for","encoding","of","time","coordinates",".","If","None",",","the","default","reference","time","is","defined","using","`","from","satpy.cf.coords","import","EPOCH","`","flatten_attrs","(","bool",")",":","If","True",",","flatten","dict-type","attributes",".","exclude_attrs","(","list",")",":","List","of","dataset","attributes","to","be","excluded",".","include_orig_name","(","bool",")",":","Include","the","original","dataset","name","in","the","netcdf","variable","attributes",".","numeric_name_prefix","(","str",")",":","Prepend","dataset","name","with","this","if","starting","with","a","digit","."]
code: def da2cf(
      dataarray,
      epoch=None,
      flatten_attrs=False,
      exclude_attrs=None,
      include_orig_name=True,
      numeric_name_prefix="CHANNEL_",
  ):
      """Convert the dataarray to something cf-compatible.
  
      Args:
          dataarray (xr.DataArray):
              The data array to be converted.
          epoch (str):
              Reference time for encoding of time coordinates.
              If None, the default reference time is defined using `from satpy.cf.coords import EPOCH`
          flatten_attrs (bool):
              If True, flatten dict-type attributes.
          exclude_attrs (list):
              List of dataset attributes to be excluded.
          include_orig_name (bool):
              Include the original dataset name in the netcdf variable attributes.
          numeric_name_prefix (str):
              Prepend dataset name with this if starting with a digit.
      """
      from satpy.cf.data_array import make_cf_data_array
  
      warnings.warn(
          "CFWriter.da2cf is deprecated."
          "Use satpy.cf.dataarray.make_cf_data_array instead.",
          DeprecationWarning,
          stacklevel=3,
      )
      return make_cf_data_array(
          dataarray=dataarray,
          epoch=epoch,
          flatten_attrs=flatten_attrs,
          exclude_attrs=exclude_attrs,
          include_orig_name=include_orig_name,
          numeric_name_prefix=numeric_name_prefix,
      )
  
file_path: satpy/satpy/writers/cf_writer.py
imports: import copy
  import logging
  import warnings
  import numpy
  import xarray
  from packaging.version import Version
  from satpy.cf.coords import EPOCH
  from satpy.writers import Writer
label_desc: Use image node_id 3 for calling the CFWriter obj's underlying member method code with example usage: obj.da2cf(dataarray, epoch, flatten_attrs, exclude_attrs, include_orig_name, numeric_name_prefix) and returns: make_cf_data_array