wgtFct
index
/users/schrei_f/src/py4CAtS/lite/src/wgtFct.py

wgtFct
 
functions to read, write or plot weighting functions (e.g., to reformat, truncate, or interpolate).

 
Classes
       
numpy.ndarray(builtins.object)
wfArray

 
class wfArray(numpy.ndarray)
    A subclassed numpy array of weighting functions with xLimits, sGrid, ... attributes added.
 
Furthermore, some convenience functions are implemented:
*  dx:       return wavenumber grid point spacing
*  grid:     return a numpy array with the uniform wavenumber grid
*  regrid:   return a wfArray with the wf data interpolated to a new grid (same xLimits!)
#  truncate: return a wfArray with the wavenumber range (xLimits) truncated
 
 
Method resolution order:
wfArray
numpy.ndarray
builtins.object

Methods defined here:
__array_finalize__(self, obj)
None.
__str__(self)
Return str(self).
convolve(self, hwhm=1.0, srf='Box')
Return weighting function convolved with a spectral response function of half width @ half maximum
dx(self)
Return wavenumber grid point spacing.
grid(self)
Setup a uniform, equidistant wavenumber grid of len(self).
info(self)
Return basic information (z, p, T, wavenumber and radiance range).
regrid(self, new, method='l', yOnly=False)
Interpolate weighting functions to (usually denser) uniform, equidistant wavenumber grid.
truncate(self, xLimits)
Return weighting functions in a truncated (smaller) wavenumber interval.
zTruncate(self, zToA)
Return weighting functions in a truncated (smaller) altitude interval, i.e. top removed.

 
Functions
       
ceil(...)
ceil(x)
 
Return the ceiling of x as an Integral.
This is the smallest integer >= x.
wfPeakHeight(wgtFct, verbose=False)
Locate the maximum altitude of the weighting function.
wfPlot(wgtFct, wavenumber=None, nLevels=None, verbose=False)
Plot weighting functions at specific wavenumber(s).
 
Arguments:
----------
wgtFct:      a subclassed 2D np.array with len(vGrid) rows and len(sGrid) columns;
             attributes:  wavenumber interval, sGrid (distance [cm] to observer), and angle
wavenumber:  wavenumber(s) of interest
             if a single integer n is given, plot for n uniformly spaced wavenumber
             if float(s) are given, pick the wgtFct(s) next to these wavenumber(s)
             if unspecified, try a color contour plot
             -------------------------> ? Interval then zoom contour ? <-------------------------
nLevels:     number of contour levels (default: choose automatically)
verbose:     flag, if True annotate plot
 
NOTE:
this function plots weighting function vs altitude, not distance!
If you want to plot vs distance, you can try to give atmos['z']/cosdg(angle) as 3. argument
wfRead(wfFile, xLimits=None, commentChar='#')
Read weighting functions vs. wavenumber and distance from file.
 
wfFile:       the ascii tabular or pickled data file
xLimits:      wavenumber interval to return a subset of the data;  default None, i.e. read all
 
RETURNS:
--------
wgtFct        an wfArray instance with a 2D matrix of weighting functions (wavenumber vs distance)
              and some attributes
wfSave(wgtFct, outFile=None, atmos=None, transposeWF=False, commentChar='#')
Write weighting functions vs. wavenumber or distance to file.
 
Arguments:
----------
wgtFct:       a subclassed 2D np.array with len(vGrid) rows and len(sGrid) columns;
              attributes:  wavenumber interval, sGrid (distance [cm] to observer), and angle
outFile:      if unspecified, write to standard output
atmos:        optional: save atmospheric data in file header
transposeWF:  save the transposed weighting function
              default: wavenumber as very first column, further columns for altitude levels
commentChar:  default '#'
 
NOTE:
this function saves weighting function vs distance, not altitude!

 
Data
        punctuation = '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'