OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022

Public Member Functions

def __init__ (self, filename, mask_missing=True, mask_above_detection_limit=True, mask_below_detection_limit=True, no_warn=False)
 
def fd_datetime (self)
 
def addDataToOutput (self, irow, var_name, units, var_value, overwrite)
 
def writeSBfile (self, ofile)
 

Public Attributes

 filename
 
 headers
 
 comments
 
 variables
 
 data
 
 missing
 
 adl
 
 bdl
 
 pi
 
 length
 
 empty_col
 
 data_use_warning
 
 err_suffixes
 

Detailed Description

Read an FCHECK-verified SeaBASS formatted data file.

    Returned data structures:
    .filename  = name of data file
    .headers   = dictionary of header entry and value, keyed by header entry
    .comments  = list of strings containing the comment lines from the header information
    .missing   = fill value as a float used for missing data, read from header
    .variables = dictionary of field name and unit, keyed by field name
    .data      = dictionary of data values, keyed by field name, returned as a list
    .length    = number of rows in the data matrix (i.e. the length of each list in data)
    .bdl       = fill value as a float used for below detection limit, read from header (empty if missing or N/A)
    .adl       = fill value as a float used for above detection limit, read from header (empty if missing or N/A)

    Returned sub-functions:
    .fd_datetime()                                  - Converts date and time information from the file's data matrix to a Python
                                                      list of datetime objects
    .addDataToOutput(irow,var_name,units,var_value) - Adds or appends single data point to data matrix given row index, field name,
                                                      field units, and data value, handling fields & units headers and missing values
    .writeSBfile(ofile)                             - Writes headers, comments, and data into a SeaBASS file specified by ofile

Definition at line 93 of file SB_support.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  filename,
  mask_missing = True,
  mask_above_detection_limit = True,
  mask_below_detection_limit = True,
  no_warn = False 
)
Required arguments:
filename = name of SeaBASS input file (string)

Optional arguments:
mask_missing               = flag to set missing values to NaN, default set to True
mask_above_detection_limit = flag to set above_detection_limit values to NaN, default set to True
mask_below_detection_limit = flag to set below_detection_limit values to NaN, default set to True
no_warn                    = flag to suppress warnings, default set to False

Definition at line 115 of file SB_support.py.

Member Function Documentation

◆ addDataToOutput()

def addDataToOutput (   self,
  irow,
  var_name,
  units,
  var_value,
  overwrite 
)

Definition at line 694 of file SB_support.py.

◆ fd_datetime()

def fd_datetime (   self)
Convert date and time information from the file's data to a Python list of datetime objects.

    Returned data structure:
    dt = a list of Python datetime objects

    Looks for these fields in this order:
date/time,
year/month/day/hour/minute/second,
year/month/day/time,
date/hour/minute/second,
date_time,
year/sdy/hour/minute/second,
year/sdy/time,
year/month/day/hour/minute,
date/hour/minute,
year/sdy/hour/minute,
year/month/day/hour,
date/hour,
year/sdy/hour,
year/month/day,
date,
year/sdy,
start_date/start_time (headers),
start_date (headers)
    in the SELF Python structure.

Definition at line 314 of file SB_support.py.

◆ writeSBfile()

def writeSBfile (   self,
  ofile 
)
writeSBfile writes out an SeaBASS file
given an output file name
syntax: SELF.writeSBfile(ofile)

Definition at line 745 of file SB_support.py.

Member Data Documentation

◆ adl

adl

Definition at line 132 of file SB_support.py.

◆ bdl

bdl

Definition at line 133 of file SB_support.py.

◆ comments

comments

Definition at line 128 of file SB_support.py.

◆ data

data

Definition at line 130 of file SB_support.py.

◆ data_use_warning

data_use_warning

Definition at line 137 of file SB_support.py.

◆ empty_col

empty_col

Definition at line 136 of file SB_support.py.

◆ err_suffixes

err_suffixes

Definition at line 138 of file SB_support.py.

◆ filename

filename

Definition at line 126 of file SB_support.py.

◆ headers

headers

Definition at line 127 of file SB_support.py.

◆ length

length

Definition at line 135 of file SB_support.py.

◆ missing

missing

Definition at line 131 of file SB_support.py.

◆ pi

pi

Definition at line 134 of file SB_support.py.

◆ variables

variables

Definition at line 129 of file SB_support.py.


The documentation for this class was generated from the following file:
  • /gfs-oceanweb/web/ocssw/ocssw_src/src/matchup_tools/seabass/SB_support.py