# spacepy.pycdf.istp.fillval

spacepy.pycdf.istp.fillval(v, ret=False)

  Set ISTP-compliant FILLVAL on a variable

  Sets or returns a CDF variable’s FILLVAL attribute to the value required by ISTP (based on variable type).

  Parameters:
    v `Var`

      CDF variable to update

  Returns:
    various

      If `ret` is True, returns the correct value for variable type (which may be of various Python types). Otherwise sets the value and returns `None`.

  Other Parameters:
    ret boolean

      If True, return the value instead of setting it (Default False, set).

  Examples

      >>> import spacepy.pycdf
      >>> import spacepy.pycdf.istp
      >>> f = spacepy.pycdf.CDF('foo.cdf', create=True)
      >>> v = f.new('Var', data=[1, 2, 3])
      >>> spacepy.pycdf.istp.fillval(v)
      >>> v.attrs['FILLVAL']
      -128