btk.survey module

The survey module interfaces with the galcheat package.

This package contains various informations about different surveys, including LSST, HSC (wide-field survey), HST COSMOS, etc. These informations are stored in a galcheat Survey object, containing several galcheat Filter objects, which is retrieved in BTK to compute fluxes and noise levels (using functions which are available in galcheat).

The main modifications made by BTK to the galcheat objects are adding the PSF to the Filter object, and making them editable. This is achieved by defining a BTK Survey and a BTK Filter objects, which directly inherit from the corresponding galcheat objects.

Contains information for surveys available in BTK.

class btk.survey.Filter(name: str, psf_fwhm: Quantity, zeropoint: Quantity, sky_brightness: Quantity, full_exposure_time: Quantity, effective_wavelength: Quantity | None = None)

Bases: Filter

Survey object that extends Galcheat surveys to allow modification.

classmethod from_galcheat_filter(galcheat_filter: Filter)

Return the corresponding BTK Filter from the Galcheat Filter.

class btk.survey.Survey(name: str, description: str, _filters: Dict[str, Filter], pixel_scale: Quantity, mirror_diameter: Quantity, gain: Quantity, obscuration: Quantity, zeropoint_airmass: Quantity, references: Dict[str, Dict[str, str]])

Bases: Survey

Survey object that extends Galcheat surveys to allow modification.

classmethod from_galcheat_survey(survey: str | Survey)

Obtain the corresponding BTK survey object from a Galcheat survey object.

get_filter(filter_name: str) Filter

Same as Galcheat getter method for filter except return a view not a copy.

btk.survey.get_psf_from_file(psf_dir: str, survey: Survey) InterpolatedImage

Generates a custom PSF galsim model from FITS file(s).

Parameters:
  • psf_dir – directory where the PSF FITS files are

  • survey – BTK Survey object

Returns:

PSF model

Return type:

galsim.InterpolatedImage

btk.survey.get_surveys(names: str | List[str], psf_func: Callable | None = None) Survey | List[Survey]

Return specified surveys from galcheat extended to contain PSF information.

This function currently returns a list of Survey instances if names is a list with more than one element. If names is a str or a singleton list then we return a single Survey.

Parameters:
  • names – A single str specifying a survey from galcheat.available_surveys().

  • psf_func – Python function which takes in two arguments: survey and filter that returns a PSF as a galsim object or as a callable with no arguments. If None, the default PSF for the specified survey will be used in each band.

Returns:

BTK Survey object or list of such objects.

btk.survey.make_wcs(pixel_scale: float, shape: Tuple[int, int], projection: str = 'TAN', center_pix: Tuple[int, int] | None = None, center_sky: Tuple[int, int] | None = None) WCS

Creates WCS for an image.

The default (center_pix=None AND center_sky=None) is that the center of the image in pixels [(s + 1) / 2, (s + 1) / 2] corresponds to (ra, dec) = [0, 0].

Parameters:
  • pixel_scale – pixel size in arcseconds

  • shape – shape of the image in pixels.

  • projection – projection type, default to TAN. A list of available types can be found in astropy.wcs documentation

  • center_pix – tuple representing the center of the image in pixels

  • center_sky – tuple representing the center of the image in sky coordinates (RA,DEC) in arcseconds.

Returns:

astropy WCS