telescope – Telescope and guide probe information

Telescope module

Stores information related to the guide, i.e. guide probe and tracker information. Also deals with illumination and image quality servers.

class pyhetdex.het.telescope.Shot(fwhm_fallback=1.6, illumination_fallback=1.0, transparency_fallback=1.0)[source]

Bases: object

Class to store information about the whole shot and retrieve fwhm, illumination, transparency and normalization.

Each of them rely on some underlying model, with the interface defined by ModelInterface

Parameters:
fwhm_fallback : float, optionally

number to use when instantiating a ConstantModel if a fwhm_model is not provided

illumination_fallback : float, optionally

number to use when instantiating a ConstantModel if a illumination_model is not provided

transparency_fallback : float, optionally

number to use when instantiating a ConstantModel if a transparency_model is not provided

Attributes:
fwhm_model

Retrieve, set or remove the fwhm model.

illumination_model

Retrieve, set or remove the illumination model.

transparency_model

Retrieve, set or remove the transparency model.

fwhm_model

Retrieve, set or remove the fwhm model. If not set or removed, fall back to one that returns a constant value

fwhm(x, y, dither)[source]

Return the FWHM

Parameters:
x, y : float

position in the focal plane in arcseconds

dither : int

the dither number (starting from 1)

illumination_model

Retrieve, set or remove the illumination model. If not set or removed, fall back to one that returns a constant value

illumination(x, y, dither)[source]

Return the illumination

Parameters:
x,y : float

position in the focal plane in arcseconds

dither : int

the dither number (starting from 1)

transparency_model

Retrieve, set or remove the transparency model. If not set or removed, fall back to one that returns a constant value

transparency(dither)[source]

Return the sky transparency

Parameters:
dither : int

the dither number (starting from 1)

normalisation(x, y, dither)[source]

Return the normalisation (transparency * illumination)

Parameters:
x, y : float

position in the focal plane in arcseconds

dither : int

the dither number (starting from 1)

class pyhetdex.het.telescope.ModelInterface[source]

Bases: object

Abstract Base Class for the models. Shot expects that all the models are derived from this one and/or that implement the __call__()

__call__(x, y, dither)[source]

Returns the value of the model in position x, y for dither

Parameters:
x, y : float

position in the focal plane in arcseconds

dither : int

the dither number, it should start from 1

Returns:
number

value of the model

class pyhetdex.het.telescope.ConstantModel(constant)[source]

Bases: pyhetdex.het.telescope.ModelInterface

Dummy model that always return the value passed to the constructor

Parameters:
constant : number

number that __call__() should return

__call__(x, y, dither)[source]

Returns the constant passed to the constructor. The arguments are ignored

class pyhetdex.het.telescope.PerDitherValueModel(vals)[source]

Bases: pyhetdex.het.telescope.ModelInterface

A model that returns a single value per
dither, that doesn’t depend on x, y
Parameters:
vals : array

an array of values, one for each dither

__call__(x, y, dither)[source]

Returns the val for this dither. The x,y arguments are ignored

class pyhetdex.het.telescope.HetpupilModel(files, normalize=True)[source]

Bases: pyhetdex.het.telescope.ModelInterface

Run the $CUREBIN/hetpupil code on the input files and save the relative illumination into a list. If required normalize the whole list to the first element. subprocess.check_output() is used.

hetpupil is searched in CUREBIN and then in the path

Parameters:
files : list of strings

name of the files on which to run the command

normalize : bool, optional

normalize the output of hetpupil to the first value found

Raises:
``pyhetdex.tools.six_ext.SubprocessExeError``

if he hetpupil executable cannot be found

Attributes:
fill_factor : list

list of filling factors for each input file

__call__(x, y, dither)[source]

Returns the value of the model for dither. x/y are ignored

Parameters:
x, y : float

position in the focal plane in arcseconds

dither : int

the dither number, starting from 1

Returns:
float

relative/absolute pupil fill factor