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 and SHOWLevel1BCollection

close()[source]
load(tmin: datetime.datetime = None, tmax: datetime.datetime = None)[source]
numrecords()[source]
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]
append_l1b_to_netcdf(l1b: showapi.level1.showlevel1b.SHOWL1BEntry)[source]
create_empty_l1b_netcdf(l1b: showapi.level1.showlevel1b.SHOWL1BEntry)[source]
write_record(l1b: showapi.level1.showlevel1b.SHOWL1BEntry)[source]
class showapi.level1.l1a_io.SHOW_Level1A_Output[source]
append_l1a_to_netcdf()[source]
create_empty_l1a_netcdf()[source]
write_record()[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]
VersionNumber(major, minor, detail)[source]
checkfiletime(usert: numpy.datetime64)[source]

Used during write processes to see if the current file is exhausted :param t: :return:

convert_time_entry(usert) → datetime.datetime[source]
load(tmin: datetime.datetime = None, tmax: datetime.datetime = None)[source]
load_list_of_files(tmin: datetime.datetime = None, tmax: datetime.datetime = None)[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
apply_shot_noise()[source]
check_normal_mode()[source]
close_pipeline()[source]
flat_field_correction()[source]
image_jitter_validation()[source]
initialize_readout_error()[source]
interpolate_bad_pixels()[source]
interpolate_big_pixels()[source]
interpolate_small_pixels()[source]
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_bits_14_and_15()[source]
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:

normalize_integrationtime()[source]
nuc_correction()[source]
open_pipeline()[source]
process_pipeline() → bool[source]

Apply the Level 0 to Level 1A pipeline to the current level 0 image

Returns:
remove_dark_current()[source]
reset_datecheck()[source]

Reset the internal flag used to detect data not collected at 1 Hz frame rate :return:

reset_pipeline(l0: showapi.level0.showlevel0.SHOWLevel0, i: int) → bool[source]

Reset the processing pipeline so it can process another image :param l0: :param i: :return:

sqrt_error()[source]
sub_window_selection()[source]
sub_windowed_array(userarray: numpy.ndarray)[source]
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]
Level1B()[source]
apply_filter_transmission()[source]
attitude_solution()[source]
close_pipeline()[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:

make_total_power()[source]
open_pipeline()[source]
process_pipeline() → bool[source]

Apply the Level 0 to Level 1A pipeline to the current level 0 image

Returns:
reset_pipeline(l1a: showapi.level1.showlevel1a.SHOWL1AEntry) → bool[source]

Reset the procesisng pipeline so it can process another image :param l0: :param i: :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.

active_length_cms()[source]
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_littrow_wavenumber(shs_temperature: float)[source]
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
section(section: str) → typing.Dict[source]
Returns a specific section of the configuration parameters
  • shsdesign
  • level0

The code will throw an exception if the requested section does not exist.

Parameters:section – Name of the configuration section to return
Returns:The configuration ssection
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.decode_version(versionstr: str)[source]
show_config.show_configuration.encode_version(version: typing.Tuple[[int, int], int]) → str[source]
show_config.show_configuration.read_configuration(anycase_instrumentname: str) → typing.Dict[str, typing.Dict[str, typing.Union[float, int, str, typing.List[float], typing.List[int]]]][source]
show_config.show_configuration.read_pickle_h20xsection() → typing.Tuple[numpy.ndarray, numpy.ndarray][source]