radInt
index
/users/schrei_f/src/py4CAtS/art/radInt.py

radInt
 
functions to read, write or plot radiation intensity (e.g., to reformat, truncate, or interpolate).

 
Modules
       
numpy
os
sys

 
Classes
       
numpy.ndarray(builtins.object)
riArray

 
class riArray(numpy.ndarray)
    A subclassed numpy array of radiance intensity with xLimits, z, ... attributes added.
 
Furthermore, some convenience functions are implemented:
*  dx:       return wavenumber grid point spacing
*  grid:     return a numpy array with the uniform wavenumber grid
*  info:     return basic information (z, p, T, wavenumber and radiance range)
*  regrid:   return a riArray with the ri data interpolated to a new grid (same xLimits!)
#  convolve: return a riArray of radiance convolved with a spectral response function
#  truncate: return a riArray with the wavenumber range (xLimits) truncated
#  kelvin:   return a numpy array of equivalent brightness temperatures
 
 
Method resolution order:
riArray
numpy.ndarray
builtins.object

Methods defined here:
__array_finalize__(self, obj)
None.
__eq__(self, other)
Compare radiance/intensity including its attributes.
(For p and od relative differences < 0.1% are seen as 'equal')
__str__(self)
Return str(self).
convolve(self, hwhm=1.0, srf='Box')
Return a radiance / intensity 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).
kelvin(self, grid=False)
Convert radiance (vs. wavenumber) in erg/s/(cm^2 sr cm^-1) to BlackBody temperature via inverse Planck.
 
When the wavenumber grid is returned too (default no, i.e. only temperature as numpy array)
then the returned tuple can be easily plotted, e.g.
plot (*radiance.kelvin(1))
(Note:  riPlot can do this anyway)
noise(self, snr=10, radOnly=False)
Add Gaussian noise of signal-to-noise ratio `snr` to radiance.
regrid(self, new, method='l', yOnly=False)
Interpolate radiance (intensity) to (usually denser) uniform, equidistant wavenumber grid.
truncate(self, xLimits)
Return a radiance / intensity in a truncated (smaller) wavenumber interval.

Static methods defined here:
__new__(cls, input_array, xLimits=None, tBack=None, zenith=None, z=None, p=None, t=None, srf='')
Create and return a new object.  See help(type) for accurate signature.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)

Data and other attributes defined here:
__hash__ = None

 
Functions
       
ceil(...)
ceil(x)
 
Return the ceiling of x as an Integral.
This is the smallest integer >= x.
randn(...) method of mtrand.RandomState instance
randn(d0, d1, ..., dn)
 
Return a sample (or samples) from the "standard normal" distribution.
 
If positive, int_like or int-convertible arguments are provided,
`randn` generates an array of shape ``(d0, d1, ..., dn)``, filled
with random floats sampled from a univariate "normal" (Gaussian)
distribution of mean 0 and variance 1 (if any of the :math:`d_i` are
floats, they are first converted to integers by truncation). A single
float randomly sampled from the distribution is returned if no
argument is provided.
 
This is a convenience function.  If you want an interface that takes a
tuple as the first argument, use `numpy.random.standard_normal` instead.
 
Parameters
----------
d0, d1, ..., dn : int, optional
    The dimensions of the returned array, should be all positive.
    If no argument is given a single Python float is returned.
 
Returns
-------
Z : ndarray or float
    A ``(d0, d1, ..., dn)``-shaped array of floating-point samples from
    the standard normal distribution, or a single such float if
    no parameters were supplied.
 
See Also
--------
random.standard_normal : Similar, but takes a tuple as its argument.
 
Notes
-----
For random samples from :math:`N(\mu, \sigma^2)`, use:
 
``sigma * np.random.randn(...) + mu``
 
Examples
--------
>>> np.random.randn()
2.1923875335537315 #random
 
Two-by-four array of samples from N(3, 6.25):
 
>>> 2.5 * np.random.randn(2, 4) + 3
array([[-4.49401501,  4.00950034, -1.81814867,  7.29718677],  #random
       [ 0.39924804,  4.68456316,  4.99394529,  4.84057254]]) #random
riPlot(radi, mue=False, kelvin=False, **kwArgs)
Quicklook plot radiance intensity vs. wavenumber.
 
ARGUMENTS:
----------
 
radi:          radiance intensity spectrum (along with attributes) or a list thereof
mue:           flag:  plot radiance vs. wavelength [mue] (default False)
kelvin:        flag:  plot equ. brightness temperature vs. wavenumber (default False)
kwArgs:        passed directly to semilogy and can be used to set colors, line styles and markers etc.
               ignored (cannot be used) in recursive calls with lists or dictionaries of radiances.
riRead(riFile, commentChar='#')
Read radiance intensity vs. wavenumber along with some attributes from file.
riSave(radi, outFile=None, info=None, commentChar=None, xFormat='%10f', yFormat='%10.5g')
Write radiance intensity vs. wavenumber along with some attributes to file.
 
ARGUMENTS:
----------
 
radi:          radiance intensity spectrum (along with attributes) or a list thereof
outFile:       destination file, stdout if unspecified
info:          information string to be included in file header (default None)
commentChar    character to be used for comment lines in file header
               default None, i.e. pickle radiance(s)
xFormat        format to be used for wavenumbers, default '%10f'
yFormat        format to be used for radiance, default '%10.5g'
               the format specifiers are only used for the ascii tabular output;
               if given, ascii output is generated even if commentChar is not set (uses '#')

 
Data
        __warningregistry__ = {'version': 15, ('\nThe datapath rcparam was deprecated in Matplotl...2.1 and will be removed two minor releases later.', <class 'matplotlib.cbook.deprecation.MatplotlibDeprecationWarning'>, 41): True}
punctuation = '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'