dace_query.imaging package

Submodules

dace_query.imaging.imaging module

dace_query.imaging.imaging.Imaging: ImagingClass = <dace_query.imaging.imaging.ImagingClass object>

Imaging instance

class dace_query.imaging.imaging.ImagingClass(dace_instance: DaceClass | None = None)

Bases: object

The imaging class. Use to retrieve data from the imaging module.

An imaging instance is already provided, to use it :

>>> from dace_query.imaging import Imaging
download(file_type: str, filters: dict | None = None, output_directory: str | None = None, output_filename: str | None = None) None

Download specified file type from the imaging module.

Available file types are [ ‘ns’, ‘snr’, ‘dl’, ‘hc’, ‘pa’, ‘master’, ‘all’ ].

  • ns : non saturated

  • snr : signal-to-noise ratio

  • dl : detection limit (.rdb file)

  • hc : high contrast

  • pa : Parallactic angle (.rdb file)

  • master : master

  • all : all files

Filters and sorting order can be applied to the query via named arguments (see Filtering and sorting).

Parameters:
  • file_type (str) – File type

  • filters (Optional[dict]) – Filters to apply to the query

  • output_directory (Optional[str]) – The directory where files will be saved

  • output_filename (Optional[str]) – The filename for the download

Returns:

None

>>> from dace_query.imaging import Imaging
>>> filters_to_use = {'file_rootpath':{'contains':'sphere/SPHERE-DRS/DRS-1.0/reduced/2018-08-19/SPHERE_IRDIS.2018-08-19T07:03:54.679_H2.fits' }}
>>> # Imaging.download(file_type='ns', filters=filters_to_use, output_directory='/tmp', output_filename='files.tar.gz')
get_image(fits_file: str, file_type: str, output_directory: str | None = None, output_filename: str | None = None) None

Download a certain fits imaging files specified by named arguments.

Available file types are [ ‘ns’, ‘snr’, ‘dl’, ‘hc’, ‘pa’, ‘master’, ‘all’ ].

  • ns : non saturated

  • snr : signal-to-noise ratio

  • dl : detection limit (.rdb file)

  • hc : high contrast

  • pa : Parallactic angle (.rdb file)

  • master : master

  • all : all files

Parameters:
  • fits_file (str) – The root fits file to download

  • file_type (str) – The file type to download

  • output_directory (Optional[str]) – The directory where files will be saved

  • output_filename (Optional[str]) – The filename for the download

Returns:

None

>>> from dace_query.imaging import Imaging
>>> fits_file_to_download, file_type = 'sphere/SPHERE-DRS/DRS-1.0/reduced/2018-08-19/SPHERE_IRDIS.2018-08-19T07:03:54.679_H2.fits', 'hc'
>>> # Imaging.get_image(fits_file=fits_file_to_download, file_type=file_type, output_directory='/tmp', output_filename='imaging.fits')
query_database(limit: int | None = 100000, filters: dict | None = None, sort: dict | None = None, output_format: str | None = None) dict[str, ndarray] | DataFrame | Table | dict

Query the imaging database to retrieve data in the chosen format.

Parameters:
  • limit (Optional[int]) – Maximum number of rows to return

  • filters (Optional[dict]) – Filters to apply to the query

  • sort (Optional[dict]) – Sort order to apply to the query

  • output_format (Optional[str]) – Type of data returns

Returns:

The desired data in the chosen output format

Return type:

dict[str, ndarray] or DataFrame or Table or dict

>>> from dace_query.imaging import Imaging
>>> values = Imaging.query_database()
query_region(sky_coord: SkyCoord, angle: Angle, filters: dict | None = None, output_format: str | None = None) dict[str, ndarray] | DataFrame | Table | dict

Query a region, based on SkyCoord and Angle objects, in the imaging database and retrieve data in the chosen format.

Filters and sorting order can be applied to the query via named arguments (see Filtering and sorting).

All available formats are defined in this section (see Output formats).

Parameters:
  • sky_coord (SkyCoord) – Sky coordinates object from the astropy module

  • angle (Angle) – Angle object from the astropy module

  • filters (Optional[dict]) – Filters to apply to the query

  • output_format (Optional[str]) – Type of data returns

Returns:

The desired data in the chosen output format

Return type:

dict[str, ndarray] or DataFrame or Table or dict

>>> from dace_query.imaging import Imaging
>>> from astropy.coordinates import SkyCoord, Angle
>>> from astropy import units as u
>>> sky_coord, angle = SkyCoord("02:12:20.6774","-46:48:58.9566", unit=(u.hourangle, u.deg)), Angle('0.045d')
>>> values = Imaging.query_region(sky_coord=sky_coord, angle=angle)

Module contents