scopesim.effects.ter_curves module

Transmission, emissivity, reflection curves.

class scopesim.effects.ter_curves.ADCWheel(cmds=None, **kwargs)[source]

Bases: Effect

Wheel holding a selection of predefined atmospheric dispersion correctors.

apply_to(obj, **kwargs)[source]

Use apply_to of current ADC.

change_adc(adcname=None)[source]

Change the current ADC.

property current_adc

Return the currently used ADC.

get_table()[source]

Create a table of ADCs with maximum throughput.

required_keys = {'adc_names', 'current_adc', 'filename_format'}
class scopesim.effects.ter_curves.AtmosphericTERCurve(**kwargs)[source]

Bases: TERCurve

class scopesim.effects.ter_curves.DownloadableFilterCurve(**kwargs)[source]

Bases: FilterCurve

required_keys = {'filename_format', 'filter_name'}
class scopesim.effects.ter_curves.FilterCurve(cmds=None, **kwargs)[source]

Bases: TERCurve

Descripton TBA.

Parameters:
positionint, optional
filter_namestr, optional

Ks - corresponding to the filter name in the filename pattern

filename_formatstr, optional

TC_filter_{}.dat

Can either be created using the standard 3 options:
- ``filename``: direct filename of the filter curve
- ``table``: an ``astropy.Table``
- ``array_dict``: a dictionary version of a table: ``{col_name1: values, }``
or by passing the combination of ``filter_name`` and ``filename_format`` as
kwargs. Here all filter file names follow a pattern (e.g. see above) and the
``{}`` are replaced by ``filter_name`` at run time. ``filter_name`` can
also be a !bang string for a ``__currsys__`` entry: ``”!INST.filter_name”``
property center
property centre
fov_grid(which='waveset', **kwargs)[source]

Return the edges needed to generate FieldOfViews for an observation.

Parameters:
whichstr

[“waveset”, “edges”, “shifts”] where: * waveset - wavelength bin extremes * edges - on sky coordinate edges for each FOV box * shifts - wavelength dependent FOV position offsets

Returns:
wavesetlist

[um] N+1 wavelengths that set edges of N spectral bins

edgeslist of lists

[arcsec] Contains a list of footprint lists

shiftslist of 3 lists

[wave, dx, dy] Contains lists corresponding to the (dx, dy) offset from the optical axis (0, 0) induced for each wavelength in (wave) [um, arcsec, arcsec]

property fwhm
class scopesim.effects.ter_curves.FilterWheel(**kwargs)[source]

Bases: FilterWheelBase

Wheel holding a selection of predefined filters.

Examples

name: filter_wheel
class: FilterWheel
kwargs:
    filter_names: []
    filename_format: "filters/{}.
    current_filter: "Ks"
required_keys = {'current_filter', 'filename_format', 'filter_names'}
class scopesim.effects.ter_curves.FilterWheelBase(**kwargs)[source]

Bases: Effect

Base class for Filter Wheels.

add_filter(newfilter, name=None)[source]

Add a filter to the FilterWheel.

Parameters:
newfilterFilterCurve
namestring

Name to be used for the new filter. If None a name from the newfilter object is used.

apply_to(obj, **kwargs)[source]

Use apply_to of current filter.

change_filter(filtername=None)[source]

Change the current filter.

property current_filter
fov_grid(which='waveset', **kwargs)[source]

Return the edges needed to generate FieldOfViews for an observation.

Parameters:
whichstr

[“waveset”, “edges”, “shifts”] where: * waveset - wavelength bin extremes * edges - on sky coordinate edges for each FOV box * shifts - wavelength dependent FOV position offsets

Returns:
wavesetlist

[um] N+1 wavelengths that set edges of N spectral bins

edgeslist of lists

[arcsec] Contains a list of footprint lists

shiftslist of 3 lists

[wave, dx, dy] Contains lists corresponding to the (dx, dy) offset from the optical axis (0, 0) induced for each wavelength in (wave) [um, arcsec, arcsec]

get_table()[source]
plot(which='x', wavelength=None, *, axes=None, **kwargs)[source]

Plot TER curves.

Parameters:
which{“x”, “t”, “e”, “r”}, optional

“x” plots throughput. “t”,”e”,”r” plot trans/emission/refl. Can be a combination, e.g. “tr” or “tex” to plot each.

wavelengtharray_like, optional

DESCRIPTION. The default is None.

axesmatplotlib axes, optional

If given, plot into existing axes. The default is None.

Returns:
figmatplotlib figure

Figure containing plots.

property surface
property throughput
class scopesim.effects.ter_curves.PupilTransmission(transmission, cmds=None, **kwargs)[source]

Bases: TERCurve

Wavelength-independent transmission curve.

Use this class to describe a cold stop or pupil mask that is characterised by “grey” transmissivity. The emissivity is set to zero, assuming that the mask is cold.

update_transmission(transmission, **kwargs)[source]
class scopesim.effects.ter_curves.QuantumEfficiencyCurve(**kwargs)[source]

Bases: TERCurve

class scopesim.effects.ter_curves.SkycalcTERCurve(**kwargs)[source]

Bases: AtmosphericTERCurve

Retrieve an atmospheric spectrum from ESO’s skycalc server.

Examples

- name : skycalc_background
  class : SkycalcTERCurve
  kwargs :
    wunit : "!SIM.spectral.wave_unit"
    wmin : "!SIM.spectral.wave_min"
    wmax : "!SIM.spectral.wave_max"
    wdelta : 0.0001     # 0.1nm bin width
    outer : 1
    outer_unit : "m"
property include
load_skycalc_table()[source]
query_server(**kwargs)[source]
class scopesim.effects.ter_curves.SpanishVOFilterCurve(**kwargs)[source]

Bases: FilterCurve

Pulls a filter transmission curve down from the Spanish VO filter service.

Parameters:
observatorystr
instrumentstr
filter_namestr

Examples

name: HAWKI-Ks
class: SpanishVOFilterCurve
kwargs:
    observatory : Paranal
    instrument : HAWKI
    filter_name : Ks
required_keys = {'filter_name', 'instrument', 'observatory'}
class scopesim.effects.ter_curves.SpanishVOFilterWheel(**kwargs)[source]

Bases: FilterWheelBase

A FilterWheel that loads all the filters from the Spanish VO service.

Warning

This use astropy.download_file(..., cache=True).

The filter transmission curves probably won’t change, but if you notice discrepancies, try clearing the astropy cache:

>> from astropy.utils.data import clear_download_cache
>> clear_download_cache()
Parameters:
observatorystr
instrumentstr
current_filterstr

Default filter name

include_str, exclude_strstr

String sequences that can be used to include or exclude filter names which contain a certain string. E.g. GTC/OSIRIS has curves for sdss_g and sdss_g_filter. We can force the inclusion of only the filter curves by setting list_include_str: "_filter".

Examples

name: svo_filter_wheel
class: SpanishVOFilterWheel
kwargs:
    observatory: "GTC"
    instrument: "OSIRIS"
    current_filter: "sdss_r_filter"
    include_str: "_filter"
required_keys = {'current_filter', 'instrument', 'observatory'}
class scopesim.effects.ter_curves.TERCurve(filename=None, **kwargs)[source]

Bases: Effect

Transmission, Emissivity, Reflection Curve.

note:: This is basically an Effect wrapper for the

SpectralSurface object

Must contain a wavelength column, and one or more of the following: transmission, emissivity, reflection. Additionally, in the header there should be the following keywords: wavelength_unit

kwargs that can be passed:

"rescale_emission" : { "filter_name": str, "value": float, "unit": str}

Examples

Directly inside a YAML file description:

name: bogus_surface
class: TERCurve
kwargs:
    array_dict:
        wavelength: [0.3, 3.0]
        transmission: [0.9, 0.9]
        emission: [1, 1]
    wavelength_unit: um
    emission_unit: ph s-1 m-2 um-1
    rescale_emission:
        filter_name: "Paranal/HAWK.Ks"
        value: 15.5
        unit: ABmag

Indirectly inside a YAML file:

name: some_curve
class TERCurve
kwargs:
    filename: bogus_surface.dat

which references this ASCII file:

# name: bogus_surface
# wavelength_unit: um
wavelength  transmission    emissivity
0.3         0.9             0.1
3.0         0.9             0.1
apply_to(obj, **kwargs)[source]

TBA.

property background_source
property emission
plot(which='x', wavelength=None, *, axes=None, **kwargs)[source]

Plot TER curves.

Parameters:
which{“x”, “t”, “e”, “r”}, optional

“x” plots throughput. “t”,”e”,”r” plot trans/emission/refl. Can be a combination, e.g. “tr” or “tex” to plot each.

wavelengtharray_like, optional

Wavelength on x-axis, taken from currsys if None (default).

axesmatplotlib axes, optional

If given, plot into existing axes. The default is None.

Returns:
figmatplotlib figure

Figure containing plots.

property throughput
class scopesim.effects.ter_curves.TopHatFilterCurve(cmds=None, **kwargs)[source]

Bases: FilterCurve

A simple Top-Hat filter profile.

Parameters:
transmissionfloat

[0..1] Peak transmission of filter

blue_cutoff, red_cutofffloat

[um] Blue and Red cutoff wavelengths

wing_transmissionfloat, optional

[0..1] Default 0. Wing transmission of filter outside the cutoff range

Examples

name: J_band_tophat
class: TopHatFilterCurve
kwargs:
    transmission : 0.9
    wing_transmission : 0.001
    blue_cutoff : 1.15
    red_cutoff : 1.35
required_keys = {'blue_cutoff', 'red_cutoff', 'transmission'}
class scopesim.effects.ter_curves.TopHatFilterWheel(**kwargs)[source]

Bases: FilterWheelBase

A selection of top-hat filter curves as defined in the input lists.

Parameters:
filter_names: list of string
transmissions: list of floats

[0..1] Peak transmissions inside the cutoff limits

wing_transmissions: list of floats

[0..1] Wing transmissions outside the cutoff limits

blue_cutoffs: list of floats

[um]

red_cutoffs: list of floats

[um]

current_filter: str, optional

Name of current filter at initialisation. If no name is given, the first entry in filter_names is used by default.

Examples

name: top_hat_filter_wheel
class: TopHatFilterWheel
kwargs:
    filter_names: ["J", "H", "K"]
    transmissions: [0.9, 0.95, 0.85]
    wing_transmissions: [0., 0., 0.001]
    blue_cutoffs: [1.15, 1.45, 1.9]
    red_cutoffs: [1.35, 1.8, 2.4]
    current_filter: "K"
required_keys = {'blue_cutoffs', 'filter_names', 'red_cutoffs', 'transmissions', 'wing_transmissions'}