# exo_k.atable¶

@author: jeremy leconte

A class to handle continuum absorption (CIA)

## Module Contents¶

class Atable(*filename_filters, filename=None, aerosol_name=None, search_path=None, mks=False, remove_zeros=False)[source]

A class to handle aerosol optical properties in table form.

Initialization for Atables.

Parameters
• filename (str, optional) – Relative or absolute name of the file to be loaded.

• filename_filters (sequence of string) – As many strings as necessary to uniquely define a file in the global search path defined in Settings. This path will be searched for a file with all the filename_filters in the name. The filename_filters can contain ‘*’.

Other Parameters

search_path (str, optional) – If search_path is provided, it locally overrides the global _search_path in Settings and only files in search_path are returned.

read_LMDZ(self, filename, aerosol_name=None)[source]

Reads LMDZ like optical propertt files.

Parameters

filename (str) – Name of the file to be read.

read_hdf5(self, filename, aerosol_name=None)[source]

Reads hdf5 cia files and load temperature, wavenumber, and absorption coefficient grid.

Parameters

filename (str) – Name of the file to be read.

write_hdf5(self, filename)[source]

Writes hdf5 cia files.

Parameters

filename (str) – Name of the file to be written.

sample(self, wngrid, remove_zeros=False, use_grid_filter=False, sample_all_vars=False, **kwargs)[source]

Method to re sample a Atable to a new grid of wavenumbers (in place)

Parameters
• wngrid (array) – new wavenumber grid (cm-1)

• use_grid_filter (boolean, optional) – If true, the table is sampled only within the boundaries of its current wavenumber grid. The coefficients are set to zero elswere (except if remove_zeros is set to True). If false, the values at the boundaries are used when sampling outside the grid.

• sample_all_vars (boolean, optional) – Whether to sample the single_scattering albedo and asymmetry_factor as well.

sample_cp(self, wngrid, **kwargs)[source]

Creates a copy of the object before resampling it.

Parameters

sample method for details. (See) –

Returns

the re-sampled Atable

Return type

Atable object

interpolate_optical_properties(self, r_array=None, var_type=0, log_interp=None, wngrid_limit=None)[source]

interpolate_cia interpolates the kdata at on a given temperature profile.

Parameters
• r_array (float or array) – Effective radius array to interpolate to. If a float is given, it is interpreted as an array of size 1.

• data_id (int) –

type of data to interpolate:
• 0 is extinction coefficient

• 1 is single scattering albedo

• 2 is asymmetry factor

• wngrid_limit (array, optional) – If an array is given, interpolates only within this array.

• log_interp (bool, optional) – Whether the interpolation is linear in kdata or in log(kdata).

cross_section(self, r_array, wngrid_limit=None, log_interp=None)[source]

Computes the cross section due to the aerosol in area per particles.

Parameters

r_array (float or array) – Effective radius array to interpolate to. If a float is given, it is interpreted as an array of size 1.

Other Parameters
• wngrid_limit (array, optional) – If an array is given, interpolates only within this array.

• log_interp (bool, optional) – Whether the interpolation is linear in kdata or in log(kdata).

absorption_coefficient(self, r_array, n_density, wngrid_limit=None, log_interp=None)[source]

Computes the cross section due to the aerosol in area per particles.

Parameters
• r_array (float or 1d array) – Effective radius array to interpolate to. If a float is given, it is interpreted as an array of size 1.

• n_density (float or 1d array (same dim as r_array)) – Number density of aerosol

Other Parameters
• wngrid_limit (array, optional) – If an array is given, interpolates only within this array.

• log_interp (bool, optional) – Whether the interpolation is linear in kdata or in log(kdata).

plot_spectrum(self, ax, r=1e-06, x_axis='wls', xscale=None, yscale=None, var_type=0, **kwarg)[source]

Plot the spectrum for a given point

Parameters
• ax (pyplot.Axes) – A pyplot axes instance where to put the plot.

• r (float) – Effective radius (m)

• x_axis (str, optional) – If ‘wls’, x axis is wavelength. Wavenumber otherwise.

• x/yscale (str, optional) – If ‘log’ log axes are used.

convert_to_mks(self)[source]

Converts units to MKS

rindex(self, r)[source]

Finds the index corresponding to the given radius r (units must be the same as the ktable)

remove_zeros(self, deltalog_min_value=0.0)[source]

Finds zeros in the ext_coeff and set them to (10.^-deltalog_min_value) times the minimum positive value in the table. This is to be able to work in logspace.

copy(self)[source]

Creates a new instance of Atable object and (deep) copies data into it

combine_tables(aerosol_name, *atables)[source]

Combine several tables representing the same aerosol type for different wavelength range.