Imaging#

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

This is a singleton instance of the ImagingClass class.

To use it, simply import it :

from dace_query.imaging import Imaging
class dace_query.imaging.imaging.ImagingClass(dace_instance=None)#

Bases: object

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

Tip

An imaging instance is already provided, to use it :

from dace_query.imaging import Imaging
download(file_type, filters=None, output_directory=None, output_filename=None)#

Download specified file type from the imaging module.

Available file types
  • '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

Return type:

None

Returns:

None

Downloading imaging files
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, file_type, output_directory=None, output_filename=None)#

Download a certain fits imaging files specified by named arguments.

Available file types
  • '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

Return type:

None

Returns:

None

Getting a specific imaging file
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=100000, filters=None, sort=None, output_format=None)#

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

Getting all imaging data
from dace_query.imaging import Imaging
values = Imaging.query_database()
query_region(sky_coord, angle, filters=None, output_format=None)#

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

Finding imaging data using a cone search
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)