rubix.telescope.filters package#

Submodules#

rubix.telescope.filters.filters module#

class rubix.telescope.filters.filters.Filter(wavelength, response, name: str)[source]#

Bases: Module

A class representing a single filter with wavelength and response data.

wavelength#

The wavelengths at which the filter response is defined.

Type:

Float[Array, “n_wavelengths”]

response#

The filter response at the corresponding wavelengths.

Type:

Float[Array, “n_wavelengths”]

name#

The name of the filter.

Type:

str

name: str#
plot(ax=None)[source]#

Plot the filter response.

Parameters:

ax (matplotlib.axes.Axes, optional) – The axes on which to plot. If None, the current axes (plt.gca()) will be used.

response: Float[Array, 'n_wavelengths']#
save(filter_path: str | None = '/home/annalena/rubix/rubix/telescope/filters/data')[source]#

Save the filter response to a csv file.

Parameters:

filter_path (str) – optional: default=FILTERS_PATH The path to save the filter response to. The filter response will be saved in a directory named after the facility, which is assumed to be the first part of the filter name, demarcated by a ‘/’. The filter response will be saved in a csv file named after the filter name.

wavelength: Float[Array, 'n_wavelengths']#
class rubix.telescope.filters.filters.FilterCurves(filters)[source]#

Bases: Module

A class representing a collection of filter curves.

filters#

The list of filter objects.

Type:

List[Filter]

apply_filter_curves(cube, wavelengths)[source]#

Get the images of a cube of spectra through all filters. :param cube: The cube of spectra. :type cube: jax.numpy.ndarray :param wavelengths: The wavelengths of the cube. :type wavelengths: jax.numpy.ndarray

Returns:

The list of images through each filter.

Return type:

List[jax.numpy.ndarray]

filters: List[Filter]#
plot()[source]#

Plot all filter responses on the same figure.

rubix.telescope.filters.filters.convolve_filter_with_spectra(filter: Filter, spectra: Float[Array, 'n_wavelengths'] | Float[Array, 'n_x n_y n_wavelengths'], wavelengths: Float[Array, 'n_wavelengths']) Float[Array, '1'] | Float[Array, 'n_x n_y'][source]#

Convolves a single filter with a single spectrum or a cube of spectra.

Parameters:
  • filter (Filter) – The filter to convolve with the spectrum or cube.

  • spectrum_or_cube (jax.numpy.ndarray) – The spectrum or cube of spectra.

  • wavelengths (jax.numpy.ndarray) – The wavelengths of the spectrum or cube.

Returns:

The convolved flux value for a single spectrum or the convolved image for a cube of spectra.

Return type:

jax.numpy.ndarray

rubix.telescope.filters.filters.load_filter(facility: str, instrument: str | List[str] | None = None, filter_name: str | List[str] | None = None, filters_path: str | None = '/home/annalena/rubix/rubix/telescope/filters/data')[source]#

Load a single filter or all filters of a given facility and instrument as Filter objects. If filters are locally present we load them from the specified path, otherwise we download them from the SVO Filter Profile Service (http://svo2.cab.inta-csic.es/theory/fps/index.php). Filters are implicitly stored in the format of SVO: ‘facilty/instrument.filter.csv’

Parameters:
  • facility (str) – Name of the facility. e.g ‘SLOAN’ for SDSS.

  • instrument (str or list of str) – optional: default=None Name of the instrument/s. e.g ‘SDSS’ for ‘SLOAN’. If None, all instruments are loaded.

  • filter_name (str or list of str) – optional: default=None Name of the specific filter/s to load. e.g ‘r’ for ‘SDSS.r’ which loads only the SDSS r-band filter. If None, all filters of the facility and instrument are loaded.

  • filters_path (str) – optional: default=FILTERS_PATH Path to load the filters from if present on disk, or to save the filters to if downloaded.

Returns:

FilterCurves object containing the Filter objects.

Return type:

FilterCurves

rubix.telescope.filters.filters.print_filter_list(facility: str, instrument: str | None = None)[source]#

Print the list of filters available for a given facility and instrument. If you want to see the list of all facilities and instruments, follow the link below: http://svo2.cab.inta-csic.es/theory/fps/index.php

Parameters:
  • facility (str) – Name of the facility. e.g ‘SLOAN’ for SDSS.

  • instrument (str) – optional: default=None Name of the instrument. e.g ‘MIRI’ for ‘JWST’.

Return type:

None

rubix.telescope.filters.filters.print_filter_list_info(facility: str, instrument: str | None = None)[source]#

Print the information of a filter list available for a given facility and instrument. If you want to see the list of all facilities and instruments, follow the link below: http://svo2.cab.inta-csic.es/theory/fps/index.php

Parameters:
  • facility (str) – Name of the facility. e.g ‘SLOAN’ for SDSS.

  • instrument (str)

  • optinal (default=None) – Name of the instrument. e.g ‘MIRI’ for ‘JWST’.

Return type:

None

rubix.telescope.filters.filters.print_filter_property(facility: str, filter_name: str, instrument: str | None = None)[source]#

Print the properties of a filter available for a given facility, instrument and filter name. If you want to see the list of all facilities and instruments, follow the link below: http://svo2.cab.inta-csic.es/theory/fps/index.php

Parameters:
  • facility (str) – Name of the facility. e.g ‘SLOAN’ for SDSS.

  • instrument (str) – Name of the instrument. e.g ‘MIRI’ for ‘JWST’.

  • filter_name (str) – Name of the filter. e.g ‘r’ for ‘SDSS.r’.

Returns:

filter_info – Table containing the filter properties such as wavelength range, effective wavelength, zero point etc.

Return type:

Table

rubix.telescope.filters.filters.save_filters(facility: str, filters_path: str | None = '/home/annalena/rubix/rubix/telescope/filters/data')[source]#

Download all filters of a given facility from the Filter Profile Service of the Spanisch Virtual Observatory (http://svo2.cab.inta-csic.es/theory/fps/index.php) and save them as csv file to the specified path.

Parameters:
  • facility (str) – Name of the facility. e.g ‘SLOAN’ for SDSS.

  • filters_path (str) – optional: default=FILTERS_PATH Path to save the filters as csv files.

Returns:

Table containing the filter list.

Return type:

Table

Module contents#