scifysim.n_air module

scifysim.n_air.compile_table(file)[source]

Compiles a Mathar table into an interpolation function

Arguments: * file : The url for a .dat file containing:

  • in column 1 the frequency in THz

  • in column 2 the reduced refracive index [fs/(mol/m^2)].

Returns: A function that computes the reduced the reduced refractive index. Note that it switches from fs to s: [s/(mol/m^2)].

scifysim.n_air.get_Pco2(co2_ppm, T, ptot)[source]

Parameters:

  • co2_ppm : Relative content of CO2 [ppm] (ppmv)

  • T : Temperature [K]

  • ptot : The total pressure of the mixture [Pa]

Returns: The partial pressure of CO2 [Pa]

scifysim.n_air.get_Ph2o(Rhum, T)[source]

Parameters:

  • Rhum : Relative humidity [%]

  • T : Temperature [K]

Returns: The partial pressure of water vapor [Pa]

scifysim.n_air.get_n_CO2(wavelength, add=0)[source]

Parameters :

  • wavelength: [m]

  • add : Value to add to n-1 (default: 0 returns n-1)

Returns the refractive index of CO2 from dispersion formula found at https://refractiveindex.info/?shelf=main&book=CO2&page=Bideau-Mehu

n_absolute: true wavelength_vacuum: true temperature: 0 °C pressure: 101325 Pa

Ref: A. Bideau-Mehu, Y. Guern, R. Abjean and A. Johannin-Gilles. Interferometric determination of the refractive index of carbon dioxide in the ultraviolet region, Opt. Commun. 9, 432-434 (1973)

scifysim.n_air.get_n_air(lamb, pres, g_co2, rhum, T, nref=False, add=0)[source]
  • pres : [mbar]

  • g_co2 : [ppmv]

  • rhum : [%]

  • T : [K]

scifysim.n_air.get_pvsat_buck(T)[source]

Saturating vapor pressure of H2O

Parmameters:

  • T : Temperature [K]

Returns: P_vsat [Pa]

scifysim.n_air.m2thz(lambda_)[source]
scifysim.n_air.n_air(lambda_, temp=288.15, pres=1000.0, rhum=0.0, co2=450.0, ph2o=None, eso=False, column=False, nws=None)[source]

This function is a translation of a function of GENIEsim.

DESCRIPTION

Returns the phase refractive index (n-1) of air a function of (IR) wavelength (in m), and optionally, temperature (in K), pressure (in bar), relative humidity (%) and CO2 content (in ppm). Note that the used approximation for air applies in the range from 300 to 1690 nm, hence their use at much longer wavelengths should be done with caution. For wavelengths longer than 1.7 micron, use the Hill & Lawrence approximation for water vapor, which has been verified with experimental data up to 15 micron.

Argument

  • lambda_ : wavelength vector in meters

Keyword arguments

  • temp : air temperature [K]

  • pres : air pressure [mbar]

  • rhum : relative humidity of the air [%]

  • co2 : CO2 content in the air [ppm]

  • ph2o : partial pressure of water vapour [in Pa = 0.01 mbar] if set, overrules RHUM – if not defined, partial pressure will be given on output

  • eso : set this keyword to use E. Marchetti’s moist air refractive index instead of Ciddor + Hill & Lawrance

  • column : set this keyword to convert to input into fs/(mopl/m²), instead of the standard unitless n-1 value

  • nws : on output, returns the refractive index of pure water vapour (unless ESO keyword is set)

CALLS

  • MOL_DENS

  • N_H2O

REFERENCE

  • J.E. Decker et al. “Updates to the NRC gauge block interferometer”, NRC document 42753, 8 August 2000

  • P.E. Ciddor, “The refractive index of air: new equations for the visible and near infrared”, Appl. Opt. 35 (9), 1566-1573

    1. Meisner & R. Le Poole, “Dispersion affecting the VLTI and 10 micron interferometry using MIDI”, Proc. SPIE 4838

  • http://www.eso.org/gen-fac/pubs/astclim/lasilla/diffrefr.html

MODIFICATION HISTORY

  • Version 1.0, 17-SEP-2002, by Roland den Hartog, ESA / ESTEC / Genie team, rdhartog@rssd.esa.int

  • Version 1.1, 09-OCT-2002, RdH: conversion to column densities (Meisner’s n^hat) implemented

  • Version 1.2, 01-NOV-2002, RdH: water vapor index based on approximation also valid in the IR

  • Version 1.3, 03-JUL-2003, OA: PostScript output of test harness modified

  • Version 1.4, 15-DEC-2009, OA: Removed discontinuity at 1.7µm by using tabulated water vapour refraction index instead of models + improved header

  • SCIFYsim , Oct. 2020, : Translated to python by R. Laugier for SCIFYsim

scifysim.n_air.n_h2o(lambda_, approx=False, column=False, co2=450.0, pres=1013.25, rad=False, rhum=0.0, table=False, temp=296.15, wda=False, freq=False)[source]

PURPOSE:

Returns the refractive index (n-1) of water vapor a function of (IR) wavelength (in m), in the range from 3.3 to 10.6 micron, and optionally, temperature (in K), and vapor density in (kg/m3)

Argument

  • lambda_ : wavelength vector in meters

Keyword arguments:

  • temp: temperature in K

  • pres: pressure in mbar

  • rhum: relative humidity in %

  • co2: CO2 fraction in ppm

  • approx:

    • if not set, the table from Mathar will be interpolated at the input wavelengths

    • if set to 1, use approximate formula by Hill & Lawrence

    • if set to 2, use approximate formula by Ciddor

  • table: set this keyword to use the full Mathar table – warning, this modifies the lambda array on output (ONLY FOR TEST PURPOSE)

  • column: convert units to fs / (mol/m^2), such that t_delay = n_H20 * column density

  • rad: convert units to radians

  • wda: the refraction index is given for water vapour displacing air instead of bare water vapour, in units of fs/(mol/m^2)

RESTRICTIONS:

Does require a file ‘n_mathar.dat’ to be present in same directory The Mathar data table does not include wavelengths smaller than 1.819 µm. At wavelengths smaller than 1.819 µm, the Hill & Lawrence approximation is used instead. This produces a discontinuity of N_H2O at 1.819 µm.

CALLS:

  • n_air

REFERENCE:

  • R.J. Hill, R.S. Lawrence, “Refractive index of water vapor in infrared windows”, Infrared Phys. 26, 371 - 376 (1986)

  • P.E. Ciddor, “The refractive index of air: new equations for the visible and near infrared”, Appl. Opt. 35 (9), 1566-1573

    1. Hase, R.J. Mathar, “Water vapor dispersion in the atmospheric window at 10 um”, Preprint, 06-FEB-2002

MODIFICATION HISTORY:

  • Version 1.0, 13-SEP-2002, by Roland den Hartog, ESA / ESTEC / Genie team, rdhartog@rssd.esa.int

  • Version 2.0, 09-OCT-2002, RdH: included tabulated data by R.J. Mathar (obtained via J. Meisner)

  • Version 2.1, 29-OCT-2002, RdH: conversion to WDA implemented

  • Version 2.2, 01-NOV-2002, RdH: Ciddor’s approximation implemented

  • Version 2.3, 15-DEC-2009, OA: Improved header

TESTED

  • 13-SEP-2002, RdH: comparison with measurements by Hase and Mathar

  • 09-OCT-2002, RdH: direct comparison between Hill & Lawrence’s approximation and Mathar’s data

  • 15-NOV-2004, RdH: implemented option to convert output directly into radians

scifysim.n_air.n_hat2nm1(nhat, P_i, T, add=0)[source]

Works for pure gazes:

Arguments: * P_i : Partial pressure [Pa] * T : Temperature [K]

Return: add + n-1

scifysim.n_air.r_index_DA(lamb)[source]

Subtracting the contribution fo CO2 from the reference air that is given by Mathar with 370ppm of CO2.

Arguments: * Wavelength [m]

scifysim.n_air.r_index_air(lam2)

Interpolation of one of the Mathar tables. Note that we switch to seconds here.

Arguments:

  • lam2 : The wavelength [m]

Returns: the reduced refractive index [s.mol^-1.m^2].

scifysim.n_air.r_index_co2(lam2)

Interpolation of one of the Mathar tables. Note that we switch to seconds here.

Arguments:

  • lam2 : The wavelength [m]

Returns: the reduced refractive index [s.mol^-1.m^2].

scifysim.n_air.r_index_h2o(lam2)

Interpolation of one of the Mathar tables. Note that we switch to seconds here.

Arguments:

  • lam2 : The wavelength [m]

Returns: the reduced refractive index [s.mol^-1.m^2].

scifysim.n_air.set_logging_level(level=30)[source]
scifysim.n_air.test_air()[source]
scifysim.n_air.test_h2o()[source]
scifysim.n_air.thz2m(f)[source]
class scifysim.n_air.wet_atmo(config=None, temp=None, pres=None, rhum=None, co2=None, ph2o=None, eso=False, column=False, nws=None, name='True atmosphere')[source]

Bases: object

__dict__ = mappingproxy({'__module__': 'scifysim.n_air', '__init__': <function wet_atmo.__init__>, 'get_Nair': <function wet_atmo.get_Nair>, 'get_Nair_wn': <function wet_atmo.get_Nair_wn>, 'get_Nair_old': <function wet_atmo.get_Nair_old>, 'report_setup': <function wet_atmo.report_setup>, '__dict__': <attribute '__dict__' of 'wet_atmo' objects>, '__weakref__': <attribute '__weakref__' of 'wet_atmo' objects>, '__doc__': None, '__annotations__': {}})
__init__(config=None, temp=None, pres=None, rhum=None, co2=None, ph2o=None, eso=False, column=False, nws=None, name='True atmosphere')[source]

Creates a model for humid refractive index

Parameters:

  • config : Give a config file that provides the parameters for the fields left at None.

  • temp : air temperature [K]

  • pres : air pressure [mbar]

  • rhum : relative humidity of the air [%]

  • co2 : CO2 content in the air [ppm]

  • ph2o : partial pressure of water vapour [in Pa = 0.01 mbar]

__module__ = 'scifysim.n_air'
__weakref__

list of weak references to the object (if defined)

get_Nair(lambs, add=0)[source]

Returns the refractive index (or reduced refractive index) for humid air at the given wavelengths.

Parameters:

  • lambs : An array of wavelengths [m]

  • add : Gets added to the reduced refracive index: default: 0. Use 1 to obtain the actual refractive index.

Returns: add + n-1

get_Nair_old(lambs, add=0)[source]

Returns the refractive index (or reduced refractive index) for humid air at the given wavelengths.

Parameters:

  • lambs : An array of wavelengths [m]

  • add : Gets added to the reduced refracive index: default: 0. Use 1 to obtain the actual refractive index.

get_Nair_wn(sig, add=1)[source]

Add=1 by default

Returns the refractive index (or reduced refractive index) for humid air at the given wavelengths.

Parameters:

  • sig : An array of wavenumber [m^-1]

  • add : Gets added to the reduced refracive index: default: 1. Use 1 to obtain the actual refractive index.

Returns: add + n-1

report_setup()[source]