This page was created by the IDL library routine `mk_html_help2`.

Last modified: Wed Nov 5 03:16:59 2025.

# Directory Listing of Routines

# projects/SPP/fields/util/misc

- PSP_FLD_COMMON
- PSP_FLD_EXTEND_EPOCH
- PSP_FLD_QF_FILTER

# Routine Descriptions

## PSP_FLD_COMMON

[Next Routine] [List of Routines]

    NAME: PSP_FLD_COMMON

    DESCRIPTION:
      Common variables used in PSP/FIELDS/UTIL/MISC routines

    CREATED BY: Ayris Narock (ADNET/GSFC) 2020

     $LastChangedBy: anarock $
     $LastChangedDate: 2020-11-03 08:57:10 -0800 (Tue, 03 Nov 2020) $
     $LastChangedRevision: 29319 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/SPP/fields/util/misc/psp_fld_common.pro $

(See projects/SPP/fields/util/misc/psp_fld_common.pro)

## PSP_FLD_EXTEND_EPOCH

[Previous Routine] [Next Routine] [List of Routines]

    NAME: PSP_FLD_EXTEND_EPOCH

    DESCRIPTION:
      Helper to psp_load_fields routine.  Extends the quality_flag variable to
      match the time resolution target.  Results valid only if the source epochs
      and target epochs cover the same time period.

      Points in the target epoch falling before the source epoch start time will
      contain the quality flag of the earliest entry in the quality flag variable.

      Points in the target epoch falling after the source epoch end time will
      contain the quality flag of the last entry in the quality flag variable.

    INPUT:
      DQF: Tplot variable name string or number of the quality flag variable
           that will be matched to a new time resolution
      EPOCH_TARGET: (DOUBLE) 1D array holding target epoch times as found
                     from a tplot variable data.x field.
      TAG: (STRING) Tplot variable name suffix for new quality flag variable

    KEYWORD OUTPUT:
      ERROR: Optional named variable to hold error status.
             0 for nominal execution
             1 if the source and target epoch ranges are completely disjoint
               or do not overlap by at least 90% of the target time range.
               No new tplot variables are created in this instance.

    EXAMPLE:
      fname = 'psp_fld_l2_mag_rtn_4_sa_per_cyc_20181111_v01.cdf'
      cdf2tplot,files=fname,varformat="*"
      get_data, 'psp_fld_l2_mag_RTN_4_Sa_per_Cyc', data=d
      psp_fld_extend_epoch, 'psp_fld_l2_quality_flags', d.x, "_4per"

    CREATED BY: Ayris Narock (ADNET/GSFC) 2020

     $LastChangedBy: anarock $
     $LastChangedDate: 2021-01-29 10:50:47 -0800 (Fri, 29 Jan 2021) $
     $LastChangedRevision: 29634 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/SPP/fields/util/misc/psp_fld_extend_epoch.pro $

(See projects/SPP/fields/util/misc/psp_fld_extend_epoch.pro)

## PSP_FLD_QF_FILTER

[Previous Routine] [List of Routines]

    NAME: PSP_FLD_QF_FILTER

    DESCRIPTION:
     Removed flagged values from PSP FIELDS magnetometer tplot variables based
     on selected quality flags.  See usage notes and available flag definitions
     by calling with the /HELP keyword.

     For each TVAR passed in a new tplot variable is created with the filtered
     data.  The new name is of the form:  <tvarname>_XXXXXX
     where each 'XXX' is a 0 padded flag indicator sorted from lowest to highest.

     So, psp_fld_qf_filter,'mag_RTN_1min_x',[4,16] results in tvar named "mag_RTN_1min_x_004016"
     Or, psp_fld_qf_filter,'mag_RTN_1min',0 results in tvar named "mag_RTN_1min_000"

     Valid for variables of type:
        '...psp_fld_l2_mag_...' (full res, 1 minute, or 4 Sa per cycle)
        '...psp_fld_l2_rfs_...' (lfr and hfr)

    INPUT:
     TVARS:    (string/strarr) Elements are data handle names
                 OR (int/intarr) tplot variable reference numbers
     DQFLAG:   (int/intarr) Elements indicate which of the data quality flags
                 to filter on. From the set {0,1,2,4,8,16,32,64,128}
                 Note: if using 0 or -1, no other flags should be selected for filter
                 -1: Keep cases with no set flags or only the 128 flag set
                 0: No set flags. (default)
                 1: FIELDS antenna bias sweep
                 2: PSP thruster firing
                 4: SCM Calibration
                 8: PSP rotations for MAG calibration (MAG rolls)
                 16: FIELDS MAG calibration sequence
                 32: SWEAP SPC in electron mode
                 64: PSP Solar limb sensor (SLS) test
                 128: PSP spacecraft is off umbra pointing

    KEYWORDS:
     HELP:   If set, print a listing of the available data quality flags and
             their meaning.
     VERBOSE:     Integer indicating the desired verbosity level. Default = 2

    OUTPUTS:
     NAMES_OUT:  Named variable holding the tplot variable names created
                 from this filter. Order corresponds to the input array of tvar
                 names, so that tvar[i] filtered is in names_out[i]

    EXAMPLE:
       psp_fld_qf_filter,'psp_fld_l2_mag_RTN_1min',0
       psp_fld_qf_filter,'psp_fld_l2_mag_RTN_1min',[16,32]

    CREATED BY: Ayris Narock (ADNET/GSFC) 2020

     $LastChangedBy: anarock $
     $LastChangedDate: 2021-01-29 11:52:15 -0800 (Fri, 29 Jan 2021) $
     $LastChangedRevision: 29636 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/SPP/fields/util/misc/psp_fld_qf_filter.pro $

(See projects/SPP/fields/util/misc/psp_fld_qf_filter.pro)