dace_query.cheops package¶
Submodules¶
dace_query.cheops.cheops module¶
- dace_query.cheops.cheops.Cheops: CheopsClass = <dace_query.cheops.cheops.CheopsClass object>¶
Cheops instance
- class dace_query.cheops.cheops.CheopsClass(dace_instance: DaceClass | None = None)¶
Bases:
objectThe cheops class. Use to retrieve data from the cheops module.
A cheops instance is already provided, to use it :
- download(file_type: str, filters: dict | None = None, output_directory: str | None = None, output_filename: str | None = None) None¶
Download CHEOPS products (FITS, PDF,…) for specific visits and save it locally depending on the specified arguments.
Filters can be applied to the query via named arguments (see Filtering and sorting).
File types available are [ ‘lightcurves’, ‘images’, ‘reports’, ‘full’, ‘sub’, ‘all’ ].
All available formats are defined in this section (see Output formats).
- Parameters:
file_type (str) – The type of files to download
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.cheops import Cheops >>> filters_to_use = {'file_key': {'contains': 'CH_PR300001_TG000301_V0000'}} >>> # Cheops.download('all', filters_to_use, output_directory='/tmp', output_filename='cheops.tar.gz')
- download_diagnostic_movie(file_key: str, aperture: str | None = 'default', output_directory: str | None = None, output_filename: str | None = None) None¶
Download diagnostic movie for a Cheops file_key.
Aperture types available are [ ‘default’, ‘optimal, ‘rinf’, ‘rsup’ ].
- Parameters:
file_key (str) – The cheops visit file key
aperture (Optional[str]) – Apertures types
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.cheops import Cheops >>> # Cheops.download_diagnostic_movie(file_key='CH_PR100018_TG027204_V0200', output_directory='/tmp', output_filename='cheops_movie.mp4')
- download_files(files: list, file_type: str | None = 'all', output_directory: str | None = None, output_filename: str | None = None)¶
Download reduction products specified in argument for the list of raw specified and save it locally.
File type available are [‘lightcurves’, ‘images’, ‘reports’, ‘full’, ‘sub’, ‘all’, ‘files’].
Note: When using
file_type='files', it is necessary to indicate the exact filename of each data product that will be downloaded (See Usage examples).- Parameters:
files (list[str]) – The raw files
file_type (Optional[str]) – The type of files to download
output_directory (Optional[str]) – The directory where files will be saved
output_filename (Optional[str]) – The file for the download
- Returns:
None
>>> from dace_query.cheops import Cheops >>> # Cheops.download_files(files=['cheops/outtray/PR30/PR300024_TG000101_V0101/CH_PR300024_TG000101_TU2020-03-09T14-50-41_SCI_RAW_SubArray_V0101.fits'],file_type='lightcurves',output_directory='/tmp' ,output_filename='cheops.tar.gz') >>> # Cheops.download_files(files=['cheops/outtray/PR30/PR300024_TG000101_V0101/CH_PR300024_TG000101_TU2020-03-09T14-50-41_SCI_RAW_HkCe-SubArray_V0101.fits', 'cheops/outtray/PR30/PR300024_TG000101_V0101/CH_PR300024_TG000101_TU2020-03-09T14-49-35_SCI_RAW_HkCe-FullArray_V0101.fits'], file_type='files', output_directory='/tmp', output_filename='specific_files.tar.gz')
- get_lightcurve(target: str, aperture: str | None = 'default', filters: dict | None = None, sort: dict | None = None, output_format: str | None = None) dict[str, ndarray] | DataFrame | Table | dict¶
Get the photometry data (from Cheops) in the chosen format for a specified target.
Aperture types available are [ ‘default’, ‘optimal, ‘rinf’, ‘rsup’ ].
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:
target (str) – The target to retrieve light curve from
aperture (Optional[str]) – Aperture type
filters (Optional[dict]) – Filters to apply to the query
sort (Optional[dict]) – Sort order to apply to the query
output_format (Optional[str]) – The desired data in the chosen output format
- Returns:
The desired data in the chosen format
- Return type:
dict[str, ndarray] or DataFrame or Table or dict
>>> from dace_query.cheops import Cheops >>> values = Cheops.get_lightcurve('WASP-8')
- list_data_product(visit_filepath: str, output_format: str | None = None) dict[str, ndarray] | DataFrame | Table | dict¶
List the filenames of all available data products for the specified visit filepath.
- Parameters:
visit_filepath (str) – The cheops visit filepath
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.cheops import Cheops >>> values = Cheops.list_data_product(visit_filepath='cheops/outtray/PR10/PR100018_TG027204_V0200/CH_PR100018_TG027204_TU2020-12-04T04-42-41_SCI_RAW_SubArray_V0200.fits')
- query_catalog(catalog: str, limit: int | None = 10000, filters: dict | None = None, sort: dict | None = None, output_format: str | None = None) dict[str, ndarray] | DataFrame | Table | dict¶
Query the cheops, either stellar or planet, catalogs.
Available catalogs are [ ‘planet’, ‘stellar’ ].
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:
catalog (str) – The catalog name
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.cheops import Cheops >>> catalog_to_search = 'planet' >>> values = Cheops.query_catalog(catalog_to_search)
- query_database(limit: int | None = 10000, filters: dict | None = None, sort: dict | None = None, output_format: str | None = None) dict[str, ndarray] | DataFrame | Table | dict¶
Query the cheops database to retrieve available visits 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:
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.cheops import Cheops >>> values = Cheops.query_database()
- query_region(sky_coord: SkyCoord, angle: Angle, limit: int | None = 10000, 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 Cheops 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
limit (Optional[int]) – Maximum number of rows to return
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.cheops import Cheops >>> from astropy.coordinates import SkyCoord, Angle >>> sky_coord, angle = SkyCoord("22h23m29s", "+32d27m34s", frame='icrs'), Angle('0.045d') >>> values = Cheops.query_region(sky_coord=sky_coord, angle=angle)