pyhrs:docs

HRSOrder

class pyhrs.HRSOrder(order, region=None, flux=None, wavelength=None, flux_unit=None, wavelength_unit=None, order_type=None)[source] [edit on github]

Bases: object

A class describing a single order for a High Resolutoin Spectrograph observation.

Parameters:

order: integer

Order of the HRS observations

region: list, tuple, or `~numpy.ndarray`

region is an object that contains coordinates for pixels in the image which are part of this order. It should be a list containing two arrays with the coordinates listed in each array.

flux: `~numpy.ndarray`

Fluxes corresponding to each pixel coordinate in region.

wavelength: `~numpy.ndarray`

Wavelengths corresponding to each pixel coordinate in region.

order_type: str

Type of order for the Order of the HRS observations

flux_unit: `~astropy.units.UnitBase` instance or str, optional

The units of the flux.

wavelength_unit: `~astropy.units.UnitBase` instance or str, optional

The units of the wavelength

Attributes Summary

flux
flux_unit
order
order_type
region
wavelength
wavelength_unit

Methods Summary

extract_spectrum() Extract 1D spectrum from the information provided so far and
set_flux_from_array(data[, flux_unit]) Given an array of data of fluxes, set the fluxes for
set_order_from_array(data) Given an array of data which has an order specified at each pixel,
set_wavelength_from_array(data, wavelength_unit) Given an array of wavelengths, set the wavelength for each pixel coordinate in region.
set_wavelength_from_model(model, params, ...) Given an array of wavelengths, set the wavelength for each pixel coordinate in region.

Attributes Documentation

flux
flux_unit
order
order_type
region
wavelength
wavelength_unit

Methods Documentation

extract_spectrum()[source] [edit on github]

Extract 1D spectrum from the information provided so far and createa Spectrum1D object

set_flux_from_array(data, flux_unit=None)[source] [edit on github]
Given an array of data of fluxes, set the fluxes for
the region at the given order for HRSOrder
Parameters:

data: `~numpy.ndarray`

data is an 2D array with a flux value specified at each pixel.

flux_unit: `~astropy.units.UnitBase` instance or str, optional

The units of the flux.

set_order_from_array(data)[source] [edit on github]
Given an array of data which has an order specified at each pixel,
set the region at the given order for HRSOrder
Parameters:

data: `~numpy.ndarray`

data is an 2D array with an order value specified at each pixel. If no order is available for a given pixel, the pixel should have a value of zero.

set_wavelength_from_array(data, wavelength_unit)[source] [edit on github]
Given an array of wavelengths, set the wavelength for
each pixel coordinate in region.
Parameters:

data: `~numpy.ndarray`

data is an 2D array with a wavelength value specified at each pixel

wavelength_unit: `~astropy.units.UnitBase` instance or str, optional

The units of the wavelength

set_wavelength_from_model(model, params, wavelength_unit, **kwargs)[source] [edit on github]
Given an array of wavelengths, set the wavelength for
each pixel coordinate in region.
Parameters:

model: function

model is a callable function that will create a corresponding wavelength for each pixel in region. The function can either be 1D or 2D. If it is 2D, the x-coordinate should be the first argument.

params: `~numpy.ndarray`

Either a 1D or 2D list of parameters with the number of elements corresponding to the number of pixles. Typically, if model is a 1D function, this would be the x-coordinated from region. Otherwise, this would be expected to be region.

wavelength_unit: `~astropy.units.UnitBase` instance or str, optional

The units of the wavelength

**kwargs:

All additional keywords to be passed to model

Page Contents