pychell API reference

Data

class pychell.rvs.data1d.SpecData1d(input_file, order_num=None, spec_num=None, crop_pix=None, wave_direction='increasing')

Bases: object

Base class for an extracted 1-dimensional spectrum.

input_file

The full path + input file this spectrum corresponds to, possibly containing all orders.

Type:str
base_input_file

The filename this spectrum corresponds to, with the path removed.

Type:str
order_num

The image order number, defaults to None.

Type:int
spec_num

The spectral image number, defaults to None.

Type:int
flux

The normalized flux.

Type:np.ndarray
flux_unc

The normalized flux uncertainty.

Type:np.ndarray
badpix

The badpix array (1=good, 0=bad)

Type:np.ndarray
wave_grid

If present, the known (or possibly only an initial) wavelength grid of the data.

Type:np.ndarray
wave_direction

Ordering of the wavelength grid. Nothing is done by default here, but may be useful for child-classes.

Type:str

Base initialization for this model component.

Parameters:
  • input_file (str) – The full path + input file this spectrum corresponds to, possibly containing all orders.
  • order_num (int) – The image order number, defaults to None.
  • spec_num (int) – The spectral image number, defaults to None.
  • crop_pix (list) – Pixels to crop on the left and right of the data arrays. Pixels are not removed, but rather changed to nan with corresponding values of zero in the bad pixel mask, defaults to None, or no cropped pixels. If pixels are already cropped, then this will still be performed but have no effect, which is fine.
  • wave_direction (str) – Ordering of the wavelength grid. Nothing is done by default here, but may be useful for child-classes.
calculate_bc_info(obs_name, star_name)

Computes the bary-center Julian Day and bary-center velocities for this observation and stores them in place.

Parameters:
  • obs_name (str) – The name of the observatory to be looked up on EarthLocations.
  • star_name (str) – The name of the star to be queuried on SIMBAD.
static calculate_bc_info_all(forward_models, obs_name, star_name)

Computes the bary-center information for all observations.

Parameters:
  • forward_models (ForwardModels) – The list of forward model objects.
  • obs_name (str) – The name of the observatory to be looked up on EarthLocations.
  • star_name (str) – The name of the star to be queuried on SIMBAD.
Returns:

The BJDs of the observations bc_vels (np.ndarray): The bary-center velocities of the observations.

Return type:

bjds (np.ndarray)

static load_custom_bcinfo(file)

Loads a custom bc file.

Parameters:file (str) – The full path + filename of the file containing the information. The file is assumed to be comma separated, with col1=bjds, col2=vels.
Returns:The BJDs of the observations bc_vels (np.ndarray): The bary-center velocities of the observations.
Return type:bjds (np.ndarray)
parse(wave_direction='increasing', **kwargs)

A default parse method which must be implemented for each instrument.

Parameters:wave_direction (str) – Ordering of the wavelength grid.
set_bc_info(bjd=None, bc_vel=None)

Basic setter method for the BJD and barycenter velocity.

Parameters:
  • bjd (float) – The BJD of the observation.
  • bc_vel (float) – The bary-center velocity of the observation.
class pychell.rvs.data1d.SpecDataCHIRON(input_file, order_num=None, spec_num=None, crop_pix=None, wave_direction='increasing')

Bases: pychell.rvs.data1d.SpecData1d

Class for extracted 1-dimensional spectra from CHIRON on the SMARTS 1.5 m telescope.

parse(wave_direction='increasing')

Parses CHIRON data and extracts the flux weighted midpoint of the exposure from the header if present, otherwise computes the mid exposure time. The flux uncertainty is not provided from CHIRON (?), so we assume all normalized uncertainties to be 0.001. The wavelength grid provided by the ThAr lamp is provided in the wave_grid attribute.

Parameters:wave_direction (str) – The direction of the wavelength grid (‘increasing’ or ‘decreasing’). If decreasing, the data is flipped.
class pychell.rvs.data1d.SpecDataMinervaAustralis(input_file, order_num=None, spec_num=None, crop_pix=None, wave_direction='increasing')

Bases: pychell.rvs.data1d.SpecData1d

calculate_bc_info(gpars)

Computes the bary-center Julian Day and bary-center velocities for this observation and stores them in place.

Parameters:
  • obs_name (str) – The name of the observatory to be looked up on EarthLocations.
  • star_name (str) – The name of the star to be queuried on SIMBAD.
parse(gpars)

A default parse method which must be implemented for each instrument.

Parameters:wave_direction (str) – Ordering of the wavelength grid.
class pychell.rvs.data1d.SpecDataiSHELL(input_file, order_num=None, spec_num=None, crop_pix=None, wave_direction='decreasing')

Bases: pychell.rvs.data1d.SpecData1d

Class for extracted 1-dimensional spectra from iSHELL on the NASA IRTF.

parse(wave_direction='decreasing')

Parses iSHELL data and computes the mid-exposure time (no exp meter -> no flux-weighting).

Parameters:wave_direction (str) – The direction of the wavelength grid (‘increasing’ or ‘decreasing’). If decreasing, the data is flipped.