galapy.PhotometricSystem
Class and tools for building the photometric system and inspecting the filters database
Tip
The PMS class is implemented to receive a variable number of arguments
(i.e. all the filters necessary, either from the database or custom).
Given that
the filters from the database can be given as input to the
PMSclass as a sequence of strings, each with the unique name of a filter;the function
galapy.PhotometricSystem.list_filters()returns a list of filters that can be selected by experiment (i.e. instrument)
a convenient way for passing all the filters from a selected instrument as arguments
of the PMS class builder is to unpack the list returned by the list_filters function,
e.g.:
pms = PMS( *list_filters( 'Herschel.PACS' ), 'Herschel.SPIRE.PMW' )
will build a PMS object with all the PACS filters and the PMW filter from the SPIRE experiment.
Functions
|
Return a list of filters available in database. |
|
Prints on screen all filters available in database. |
Classes
|
Builds the Photometric System |
- galapy.PhotometricSystem.print_filters(experiment=None)
Prints on screen all filters available in database.
- Parameters:
experiment (string or None) – (Optional, default = None) filter the results by experiment.
Examples
>>> print_filters(experiment='Herschel.SPIRE') # Path: /path/to/.galapy Herschel.SPIRE.PSW Herschel.SPIRE.PLW Herschel.SPIRE.PMW
- galapy.PhotometricSystem.list_filters(experiment=None)
Return a list of filters available in database.
- Parameters:
experiment (string or None) – (Optional, default = None) filter the results by experiment.
- Returns:
list
a list of strings, containing the name of each filter in the database
Examples
>>> list_filters(experiment='Herschel.SPIRE') ['Herschel.SPIRE.PSW', 'Herschel.SPIRE.PLW', 'Herschel.SPIRE.PMW' ]
- class galapy.PhotometricSystem.PMS(*args, **kwargs)
Builds the Photometric System
- Parameters:
*args (tuple of strings) – As many strings as necessary. Each string has to name one of the available filters already present in the database.
**kwargs (dictionary) – Keyword arguments can be used for providing user-defined transmissions. Custom transmissions are passed as properly formatted dictionaries:
keyword = { 'wavelengths' : array-like,'photons' : array-like }The two arrays provided, as the keys suggest, must define the wavelength grid and the corresponding transmission in photon units (and thus they must have the same size). Note that the chosen keyword will be used as unique identifier of the custom transmission.
Examples
>>> from galapy.PhotometricSystem import PMS >>> pms = PMS( 'Herschel.PACS.green', 'ALMA.B3' )
builds a photometric system from two filters in the database, namely ALMA Band 3 and the green filter from the PACS experiment of the Herschel satellite
>>> pms = PMS( ... custom1 = { ... 'wavelengths' : [999., 1000., 1001., 1999., 2000., 2001.], ... 'photons' : [0., 1., 1., 1., 1., 0.] ... } ... )
builds a photometric system from a custom top-hat filter between 1000 to 2000 Angstrom, It is also possible to build heterogeneous objects, with the only caveat of providing the names of filters from the database first and then all the custom ones:
>>> pms = PMS( ... 'Herschel.PACS.green', 'ALMA.B3', ... custom1 = { ... 'wavelengths' : [999., 1000., 1001., 1999., 2000., 2001.], ... 'photons' : [0., 1., 1., 1., 1., 0.] ... } ... )
- dump()
Dump the Photometric System to formatted dictionary.
- classmethod load(dictionary)
Load the Photometric System from a formatted dictionary
- get_fluxes(ll, fl)
Get a list of fluxes, one per each band in the photometric system.
- Parameters:
ll (array-like) – wavelength grid
fl (array-like) – fluxes defined on the wavelength grid
- Returns:
list
the fluxes from the input array trasmitted by each
filter in the photometric system