ATLAS API Client Reference#

The client module#

Description:

This module contains the classes to interact with the ATLAS API.

Author:

Heloise Stevance, Jack Leland

Date of Creation:

2024-05-22

Last Update:

2024-12-09

Classes#

  • APIClient: Parent class for the ATLAS API pipelines.

  • RequestVRAScores: To download the data from the VRA table.

  • RequestVRAToDoList: To download the data from the VRA To Do List.

  • RequestCustomListsTable: To download the data from the Custom Lists Table.

  • RequestSingleSourceData: To download the data for a single source.

  • RequestMultipleSourceData: To download the data for multiple sources.

class atlasapiclient.client.APIClient(api_config_file: str = None)#

Bases: ABC

dict_list_id = {'agn': [7, False], 'attic': [5, False], 'cv': [40, True], 'dummy': [999, True], 'duplicates': [13, False], 'eyeball': [4, False], 'fasttrack': [8, False], 'follow_up': [1, False], 'galcand': [12, False], 'garbage': [0, False], 'good': [2, False], 'heloise': [72, True], 'magellanic_clouds': [10, False], 'mdwarf': [56, True], 'mookodi': [2, True], 'movers': [9, False], 'pm_stars': [11, False], 'possible': [3, False], 'stars': [6, False], 'vra': [73, True]}#
get_response(inplace: bool = True)#

Get the response from the server.

Parameters#

inplace: bool

If True, sets self.response to the response from the server. If False, it ALSO returns the response.

parse_atlas_id(atlas_id: str) int#

Check that the atlas_id input is valid - it must have 19 digits and be an integer

Parameters:

atlas_id – string containing the atlas_id

Returns:

int representing the atlas_id

Raises:

ATLASAPIClientError: if the atlas_id is not a valid integer

class atlasapiclient.client.ConeSearch(payload: dict = {}, get_response: bool = False, api_config_file: str = None)#

Bases: APIClient

class atlasapiclient.client.RemoveFromCustomList(array_ids: array = None, list_name: str = None, get_response: bool = False, api_config_file: str = None)#

Bases: APIClient

chunk_get_response_quiet()#

Chunks the request in groups of 100 so don’t get timed out by the server. No progress bar.

class atlasapiclient.client.RequestATLASIDsFromWebServerList(list_name: str, get_response: bool = True, api_config_file: str = None)#

Bases: APIClient

property atlas_id_list_int#
property atlas_id_list_str#
class atlasapiclient.client.RequestCustomListsTable(payload: dict = {}, get_response: bool = False, api_config_file: str = None)#

Bases: APIClient

class atlasapiclient.client.RequestMultipleSourceData(array_ids: array = None, mjdthreshold=None, api_config_file: str = None)#

Bases: APIClient

chunk_get_response()#

Chunks the request in groups of 100 so don’t get timed out by the server. Prints out a progress bar.

Notes#

This is typically used in human scripts and notebooks to see how long it’ll take.

chunk_get_response_quiet()#

Chunks the request in groups of 100 so don’t get timed out by the server. Does not print out a progress bar.

Notes#

This is typically used in production to avoid spamming the logs.

Returns#

None

save_response_to_json(output_dir=None)#

Saves the response to INDIVIDUAL text files with the name [ATLAS_ID].json. One for EACH object.

Parameters#

output_dir:str

The directory where the files will be saved

Returns#

None

class atlasapiclient.client.RequestSingleSourceData(atlas_id: str = None, mjdthreshold: float = None, get_response: bool = True, api_config_file: str = None)#

Bases: APIClient

save_response_to_json(output_dir=None)#

Saves the response to a text file name [ATLAS_ID].json

Parameters#

output_dir: str

The directory where the file will be saved

Returns#

None

class atlasapiclient.client.RequestVRAScores(payload: dict = {}, get_response: bool = False, api_config_file: str = None)#

Bases: APIClient

class atlasapiclient.client.RequestVRAToDoList(payload: dict = {}, get_response: bool = False, api_config_file: str = None)#

Bases: APIClient

class atlasapiclient.client.WriteObjectDetectionListNumber(payload: dict = {}, get_response: bool = False, api_config_file: str = None)#

Bases: APIClient

class atlasapiclient.client.WriteToCustomList(array_ids: array = None, list_name: str = None, get_response: bool = False, api_config_file: str = None)#

Bases: APIClient

chunk_get_response_quiet()#

Chunks the request in groups of 100 so don’t get timed out by the server. No progress bar.

class atlasapiclient.client.WriteToToDo(payload: dict = {}, get_response: bool = False, api_config_file: str = None)#

Bases: APIClient

class atlasapiclient.client.WriteToVRARank(payload: dict = {}, get_response: bool = False, api_config_file: str = None)#

Bases: APIClient

class atlasapiclient.client.WriteToVRAScores(payload: dict = {}, get_response: bool = False, api_config_file: str = None)#

Bases: APIClient

The exceptions module#

exception atlasapiclient.exceptions.ATLASAPIClientAuthError#
exception atlasapiclient.exceptions.ATLASAPIClientConfigError#
exception atlasapiclient.exceptions.ATLASAPIClientError#
exception atlasapiclient.exceptions.ATLASAPIClientRequestError#