pypeit.core.wave module

Routines related to flexure, air2vac, etc.

pypeit.core.wave.airtovac(wave)[source]

Convert air-based wavelengths to vacuum

Parameters:

wave (astropy.units.Quantity) – Wavelengths to convert

Returns:

new_wave – Wavelength array corrected to vacuum wavelengths

Return type:

astropy.units.Quantity

pypeit.core.wave.geomotion_calculate(radec, time, longitude, latitude, elevation, refframe)[source]

Correct the wavelength calibration solution to the desired reference frame

Parameters:
Returns:

The velocity correction that should be added to the original velocity.

Return type:

float

pypeit.core.wave.geomotion_correct(radec, time, longitude, latitude, elevation, refframe)[source]

Correct the wavelength of every pixel to a barycentric/heliocentric frame.

Parameters:
  • radec (astropy.coordinates.SkyCoord) – RA, DEC of source

  • time (astropy.time.Time) – Time of observation

  • gd_slitord (numpy.ndarray) – Array of good slit/order IDs

  • fitstbl – Table/PypeItMetaData Containing the properties of every fits file

  • longitude (float) – Telescope longitude in deg

  • latitude (float) – Telescope latitude in deg

  • elevation (float) – Telescope elevation in m

  • refframe (str)

Returns:

Two objects are returned:

  • float: The velocity correction that should be applied to the wavelength array.

  • float: The relativistic velocity correction that should be multiplied by the wavelength array to convert each wavelength into the user-specified reference frame.

Return type:

tuple

pypeit.core.wave.geomotion_velocity(time, skycoord, frame='heliocentric')[source]

Perform a barycentric/heliocentric velocity correction.

For the correction, this routine uses the ephemeris: astropy.coordinates.solar_system_ephemeris.set For more information see ~astropy.coordinates.solar_system_ephemeris.

Parameters:
  • time (astropy.time.Time) – The time of observation, including the location.

  • skycoord (astropy.coordinates.SkyCoord) – The RA and DEC of the pointing, as a SkyCoord quantity.

  • frame (str) – The reference frame that should be used for the calculation.

Returns:

vcorr – The velocity correction that should be added to the original velocity.

Return type:

float

pypeit.core.wave.vactoair(wave)[source]

Convert to air-based wavelengths from vacuum

Parameters:

wave (astropy.units.Quantity) – Wavelengths to convert

Returns:

new_wave – Wavelength array corrected to air

Return type:

astropy.units.Quantity