showapi Classes¶
The showapi classes:
-
class
showapi.level1.showlevel1a.
SHOWL1AEntry
(time, heightrow, pixelcolumn, sensor_names, exposure_time, temperatures, image, error, version)¶ -
error
¶ Alias for field number 7
-
exposure_time
¶ Alias for field number 4
-
heightrow
¶ Alias for field number 1
-
image
¶ Alias for field number 6
-
pixelcolumn
¶ Alias for field number 2
-
sensor_names
¶ Alias for field number 3
-
temperatures
¶ Alias for field number 5
-
time
¶ Alias for field number 0
-
version
¶ Alias for field number 8
-
-
class
showapi.level1.showlevel1a.
SHOWLevel1ACollection
(instrumentname: str, groupname: str, basedir: str = None, versionstr: str = None)[source]¶
-
class
showapi.level1.showl1collection.
SHOWLevel1Collection
(groupname: str, levelname: str, basedir: str, versionstr: str)[source]¶ A base class to load SHOW Level 1A and Level 1B. The class is a simple wrapper around the L1_Netcdf_FileOrganizer class and an xarray instance. Interpretation o fthe fields within the xarray instance is left to derived classes, e.g.
SHOWLevel1ACollection
andSHOWLevel1BCollection
-
class
showapi.level1.showl1collection.
SHOWLevel1CollectionIterator
(collection: typing.List[typing.Any])[source]¶
-
class
showapi.level1.l1b_io.
SHOW_Level1B_Input
(basedir: str, groupname: str, version: str = 'v000')[source]¶
-
class
showapi.level1.l1b_io.
SHOW_Level1B_Output
(instrumentname: str, groupname: str, version: typing.Tuple[[int, int], int], basedir: str = None)[source]¶
-
class
showapi.level1.l1_fileorganizer.
L1_Netcdf_FileOrganizer
(basedir: str, groupname: str, levelname: str, versionstr: typing.Union[str, typing.Tuple[int, int, int]])[source]¶
-
class
showapi.level1.l0_to_l1a_pipeline.
L0_to_L1A_Pipeline
(instrumentname: str, version: typing.Tuple[[int, int], int])[source]¶ -
EXCEPTION_FLAG_BAD_PIXEL
= 1¶
-
EXCEPTION_FLAG_SATURATED_PIXEL
= 2¶
-
load_jitter_pixels
(config)[source]¶ Load the standard bad pixels from the calibration dtaabase. This is just a simple text file :return:
-
load_list_of_pixels
(filename)[source]¶ Load a list of pixel indices from a simple text file :return:
-
load_standard_bad_pixels
(config)[source]¶ Load the standard bad pixels from the calibration dtaabase. This is just a simple text file :return:
-
mask_saturated_and_bad_pixels
()[source]¶ sets known bad pixels to Nan. Bad pixels are read in from the calibration database. Note they are 1 based indices. :return:
-
process_pipeline
() → bool[source]¶ Apply the Level 0 to Level 1A pipeline to the current level 0 image
Returns:
-
reset_datecheck
()[source]¶ Reset the internal flag used to detect data not collected at 1 Hz frame rate :return:
-
-
showapi.level1.l0_to_l1a_pipeline.
process_level0_to_level1a
(level0_filename: str, level1_basedir: str, instrument_name, groups=None, version: typing.Tuple[[int, int], int] = None)[source]¶
-
class
showapi.level1.l1a_to_l1b_pipeline.
L1A_to_L1B_Pipeline
(instrumentname: str, iwg1_filename: str, version: typing.Tuple[[int, int], int])[source]¶ -
-
generate_wavelength_scale
()[source]¶ Generates the wavelength scale. This must occur after the spectrum has been generated :return:
-
interferogram_to_spectrum
()[source]¶ Converts the interferogram and error into a spectrum and error :return:
-
-
showapi.level1.l1a_to_l1b_pipeline.
process_level1a_to_level1b
(instrument_name: str, group: str, starttime: datetime.datetime, endtime: datetime.datetime, iwg1_filename: str, level1b_basedir: str = None, level1a_basedir: str = None, level1a_version: str = None, level1b_version: typing.Tuple[[int, int], int] = None)[source]¶
-
class
show_config.show_configuration.
Parameters
(instrumentname: str = 'er2_2017') → None[source]¶ The analysis of SHOW involves transformations from interferogram space to frequency space. This class provides an interface that converts between the two spaces using known and/or fitted design parameters.
The interferogram equation is given by:
I(x) = 0.5*Integral( B(k)(1 +cos(2.pi.k.x)dk ) (eqn 1)
where k is the heterodyne frequency:
k = 4M( v - vo)tan(ThetaL) (eqn 2) or (v-v0) = k/(4Mtan(thetaL))
M = Magnification (typically 4 to 5) v = wavenumber cm-1 vo = Littrow wavenumber cm-1 ThetaL = Littrow angle of grating (typically ~28.5 degrees).
The measured interferogram is imaged onto a detector of width ‘L’ cms and the discrete harmonics of equation(1) that are retrieved by a discrete Fourier Transform are given by:
k.L = n n = 1,2,3,4,5,6,7,8.... (eqn 3)
and by substitution from eqn (2)
n- (vn - v0) = —————— (eqn 4)
- 4.M.L.tan(thetaL)
where vn is the nth discrete wavenumber.
-
fft_step_size_wavenumber
() → float[source]¶ Return the theoretical step size in wavenumbers of one harmonic from the discrete FFT.
Returns: The spacing of one FFT harmonic in wavenumbers (cm-1) Return type: float
-
g_onetime
= 0¶
-
gauss_pixel_sigma_to_wavelen_sigma
(pixelsigma: (<class 'float'>, <class 'numpy.ndarray'>)) -> (<class 'float'>, <class 'numpy.ndarray'>)[source]¶ Calculate the standard deviation width of a Gaussian in FFT wavelength space given the sd width of the corresponding gaussian in CCD pixel space. This is useful if we want to multiply in detector space but convolve theoretical spectra in wavenumber space.
Returns: The sd width of the gaussian in wavenumbers cm-1. Return type: float or numpy.ndarray
-
gauss_pixel_sigma_to_wavenumber_sigma
(pixelsigma: (<class 'float'>, <class 'numpy.ndarray'>)) -> (<class 'float'>, <class 'numpy.ndarray'>)[source]¶ Calculate the standard deviation width of a Gaussian in FFT wavenumber space given the sd width of the corresponding gaussian in CCD pixel space. This is useful if we want to multiply in detector space but convolve theoretical spectra in wavenumber space.
:param pixelsigma :return: The standard deviation width of the gaussian in wavenumbers cm-1. :rtype: float or numpy.ndarray
-
gauss_wavenumber_sigma_to_pixel_sigma
(wavenumbersigma: (<class 'float'>, <class 'numpy.ndarray'>)) -> (<class 'float'>, <class 'numpy.ndarray'>)[source]¶ Calculate the standard deviation width of a Gaussian in CCD pixel space given the sd width of the corresponding gaussian in FFT wavenumber space. This is useful if we want to multiply in wavenumber space but convolve in CCD pixel space.
Returns: The sd width of the gaussian in CCD pixels . Return type: float or numpy.ndarray
-
nominal_wavelengths
(numfreq: int, shs_temperature_celsius: float) → numpy.ndarray[source]¶ Calculates the nominal wavelengths of the retrieved spectrum for the first “numfreq” discrete harmonics.
Parameters: numfreq (int) – The number of frequencies. Returns: The array (numfreq) of nominal wavenumbers in cm-1 Return type: numpy.ndarray
-
nominal_wavenumbers
(numfreq: int, shs_temperature_celsius: float) → numpy.ndarray[source]¶ Calculates the nominal wavenumbers of the retrieved spectrum for the first “numfreq” discrete harmonics.
Parameters: numfreq (int) – The number of frequencies. Returns: The array (numfreq) of nominal wavenumbers in cm-1 Return type: numpy.ndarray
-
show_config.show_configuration.
cdb_directory
(config: typing.Dict[str, typing.Any]) → str[source]¶ Returns the location of the instrument Calibration Database Directory :param anycase_instrumentname: :return:
-
show_config.show_configuration.
encode_version
(version: typing.Tuple[[int, int], int]) → str[source]¶