scopesim.effects.ter_curves_utils module¶
TBA.
- scopesim.effects.ter_curves_utils.apply_throughput_to_cube(cube, thru)[source]¶
Apply throughput curve to a spectroscopic cube.
- Parameters:
- cubeImageHDU
three-dimensional image, dimension 0 (in python convention) is the spectral dimension. WCS is required.
- thrusynphot.SpectralElement, synphot.SourceSpectrum
- Returns:
- cubeImageHDU, header unchanged, data multiplied with
wavelength-dependent throughput.
- scopesim.effects.ter_curves_utils.combine_two_spectra(spec_a, spec_b, action, wave_min, wave_max)[source]¶
Combine transmission and/or emission spectrum with a common waverange.
Spec_A is the source spectrum Spec_B is either the transmission or emission that should be applied
- Parameters:
- spec_asynphot.SourceSpectrum
- spec_bsynphot.SpectralElement, synphot.SourceSpectrum
- action: str
[“multiply”, “add”]
- wave_min, wave_maxquantity
[Angstrom]
- Returns:
- new_sourcesynphot.SourceSpectrum
- scopesim.effects.ter_curves_utils.download_svo_filter(filter_name, return_style='synphot')[source]¶
Query the SVO service for the true transmittance for a given filter.
Copied 1 to 1 from tynt by Brett Morris
- Parameters:
- filter_namestr
Name of the filter as available on the spanish VO filter service e.g:
Paranal/HAWKI.Ks
- return_stylestr, optional
Defines the format the data is returned - synphot: synphot.SpectralElement - table: astropy.table.Table - quantity: astropy.unit.Quantity [wave, trans] - array: np.ndarray [wave, trans], where wave is in Angstrom - vo_table : astropy.table.Table - original output from SVO service
- Returns:
- filt_curveSee return_style
Astronomical filter object.
- scopesim.effects.ter_curves_utils.download_svo_filter_list(observatory, instrument, short_names=False, include=None, exclude=None)[source]¶
Query the SVO service for a list of filter names for an instrument.
- Parameters:
- observatorystr
Name of the observatory as available on the spanish VO filter service e.g:
Paranal/HAWKI.Ks
–> Paranal- instrumentstr
Name of the instrument. Be careful of hyphens etc. E.g. “HAWK-I”
- short_namesbool
Default False. If True, the full SVO names (obs/inst.filt) are split to only return the (filt) part of the name
- include, exclude: str
Each a string sequence for excluding or including specific filters E.g. GTC/OSIRIS has curves for
sdss_g
andsdss_g_filter
. We can force the inclusion of only the filter curves by settinginclude="_filter"
.
- Returns:
- nameslist
A list of filter names
- scopesim.effects.ter_curves_utils.scale_spectrum(spectrum, filter_name, amplitude)[source]¶
Scale a SourceSpectrum to a value in a filter.
- Parameters:
- spectrumsynphot.SourceSpectrum
- filter_namestr
Name of a filter from - a local instrument package (available in
rc.__search_path__
) - a generic filter name (seeter_curves_utils.FILTER_DEFAULTS
) - a spanish-vo filter service reference (e.g."Paranal/HAWKI.Ks"
)- amplitude
astropy.Quantity
, float The value that the spectrum should have in the given filter. Acceptable astropy quantities are: - u.mag : Vega magnitudes - u.ABmag : AB magnitudes - u.STmag : HST magnitudes - u.Jy : Jansky per filter bandpass Additionally the
FLAM
andFNU
units fromsynphot.units
can be used when passing the quantity foramplitude
:
- Returns:
- spectrumsynphot.SourceSpectrum
Input spectrum scaled to the given amplitude in the given filter
Examples
>>> from scopesim.source.source_templates import vega_spectrum >>> from scopesim.effects.ter_curves_utils as ter_utils >>> >>> spec = vega_spectrum() >>> vega_185 = ter_utils.scale_spectrum(spec, "Ks", -1.85 * u.mag) >>> ab_0 = ter_utils.scale_spectrum(spec, "Ks", 0 * u.ABmag) >>> jy_3630 = ter_utils.scale_spectrum(spec, "Ks", 3630 * u.Jy)
- scopesim.effects.ter_curves_utils.zero_mag_flux(filter_name, photometric_system, return_filter=False)[source]¶
Return the zero magnitude photon flux for a filter.
Acceptable filter names are those given in
scopesim.effects.ter_curves_utils.FILTER_DEFAULTS
or a string with an appropriate name for a filter in the Spanish-VO filter-service. Such strings must use the naming convention: observatory/instrument.filter. E.g:paranal/HAWKI.Ks
, orGemini/GMOS-N.CaT
.- Parameters:
- filter_namestr
Name of the filter - see above
- photometric_systemstr
[“vega”, “AB”, “ST”] Name of the photometric system
- return_filterbool, optional
If True, also returns the filter curve object
- Returns:
- fluxfloat
[PHOTLAM]
- filt
synphot.SpectralElement
If
return_filter
is True