adler.objectdata.AdlerPlanetoid

Attributes

logger

SCHEMA_CONFIG_DICT

RSP_TAP_CONFIG_DICT

Classes

AdlerPlanetoid

AdlerPlanetoid class. Contains the Observations, MPCORB and SSObject dataclass objects.

Module Contents

logger[source]
SCHEMA_CONFIG_DICT[source]
RSP_TAP_CONFIG_DICT[source]
class AdlerPlanetoid(ssObjectId, filter_list, date_range, observations_by_filter, mpcorb, ssobject, adler_data)[source]

AdlerPlanetoid class. Contains the Observations, MPCORB and SSObject dataclass objects.

ssObjectId[source]
filter_list[source]
date_range[source]
observations_by_filter[source]
MPCORB[source]
SSObject[source]
AdlerData[source]
classmethod construct_from_SQL(ssObjectId, sql_filename, filter_list=['u', 'g', 'r', 'i', 'z', 'y'], date_range=[60000.0, 67300.0], schema=None, flux_flag=None)[source]

Custom constructor which builds the AdlerPlanetoid object and the associated Observations, MPCORB and SSObject objects from a local SQL database. Mostly used for testing.

Parameters:
  • ssObjectId (str) – ssObjectId of the object of interest.

  • sql_filename (str) – Filepath to the local SQL database.

  • filter_list (list of str) – A comma-separated list of the filters of interest.

  • date_range (list of float) – The minimum and maximum dates of the desired observations.

  • schema (str or None) – Schema/database from which to select the data tables. Can be None. Default is currently “dp03_catalogs_10yr” for testing using DP0.3.

  • flux_flag (str or None) – Name of the flux column to select from DP1 DiaSource table. Determines FluxErr and ra/dec columns to select also. Default is None (selects mag/magErr/ra/dec for DP0.3)

classmethod construct_from_cassandra(ssObjectId, filter_list=['u', 'g', 'r', 'i', 'z', 'y'], date_range=[60000.0, 67300.0], cassandra_hosts=['10.21.3.123'])[source]

Custom constructor which builds the AdlerPlanetoid object and the associated Observations, MPCORB and SSObject objects from a Cassandra database. Used only for Lasair integration.

TODO: move method to its own class which inherits from AdlerPlanetoid and move to adler-lasair repo?

Parameters:
  • ssObjectId (str) – ssObjectId of the object of interest.

  • filter_list (list of str) – A comma-separated list of the filters of interest.

  • date_range (list of float) – The minimum and maximum dates of the desired observations.

  • cassandra_hosts (list of str) – Location of the Cassandra database - usually an IP address. Default is [“10.21.3.123”].

classmethod construct_from_RSP(ssObjectId, filter_list=['u', 'g', 'r', 'i', 'z', 'y'], date_range=[60000.0, 67300.0], schema='dp03_catalogs_10yr', api_token_path=None, flux_flag=None)[source]

Custom constructor which builds the AdlerPlanetoid object and the associated Observations, MPCORB and SSObject objects from the RSP.

Parameters:
  • ssObjectId (str) – ssObjectId of the object of interest.

  • filter_list (list of str) – A comma-separated list of the filters of interest.

  • date_range (list of float) – The minimum and maximum dates of the desired observations.

  • schema (str or None) – Schema/database from which to select the data tables. Can be None. Default is currently “dp03_catalogs_10yr” for testing using DP0.3.

  • api_token_path (str or None) – Path to user RSP API token if running not on RSP. See https://rsp.lsst.io/guides/auth/creating-user-tokens.html and lsst-adler/notebooks/adler_demo/adler_demo_rsp_api.ipynb for guide on setting this up.

  • flux_flag (str or None) – Name of the flux column to select from DP1 DiaSource table. Determines FluxErr and ra/dec columns to select also. Default is None (selects mag/magErr/ra/dec for DP0.3)

populate_observations(ssObjectId, filter_list, date_range, service=None, sql_filename=None, schema='dp03_catalogs_10yr', flux_flag=None)[source]

Populates the observations_by_filter class attribute. Can populate from either the RSP for a SQL database: this behaviour is controlled by the service and sql_filename parameters, one of which must be supplied.

Parameters:
  • ssObjectId (str) – ssObjectId of the object of interest.

  • filter_list (list of str) – A comma-separated list of the filters of interest.

  • date_range (list of float) – The minimum and maximum dates of the desired observations.

  • service (pyvo.dal.tap.TAPService object or None) – TAPService object linked to the RSP. Default=None.

  • sql_filename (str or None) – Filepath to a SQL database. Default=None.

  • schema (str or None) – Schema/database from which to select the data tables. Can be None. Default is currently “dp03_catalogs_10yr” for testing using DP0.3.

  • flux_flag (str or None) – Name of the flux column to select from DP1 DiaSource table. Determines FluxErr and ra/dec columns to select also. Default is None (selects mag/magErr/ra/dec for DP0.3)

populate_MPCORB(ssObjectId, service=None, sql_filename=None, schema='dp03_catalogs_10yr')[source]

Populates the MPCORB object class attribute. Can populate from either the RSP for a SQL database: this behaviour is controlled by the service and sql_filename parameters, one of which must be supplied.

Parameters:
  • ssObjectId (str) – ssObjectId of the object of interest.

  • service (pyvo.dal.tap.TAPService object or None) – TAPService object linked to the RSP. Default=None.

  • sql_filename (str or None) – Filepath to a SQL database. Default=None.

  • schema (str or None) – Schema/database from which to select the data tables. Can be None. Default is currently “dp03_catalogs_10yr” for testing using DP0.3.

populate_SSObject(ssObjectId, filter_list, service=None, sql_filename=None, schema='dp03_catalogs_10yr')[source]

Populates the SSObject class attribute. Can populate from either the RSP for a SQL database: this behaviour is controlled by the service and sql_filename parameters, one of which must be supplied.

Parameters:
  • ssObjectId (str) – ssObjectId of the object of interest.

  • filter_list (list of str) – A comma-separated list of the filters of interest.

  • service (pyvo.dal.tap.TAPService object or None) – TAPService object linked to the RSP. Default=None.

  • sql_filename (str or None) – Filepath to a SQL database. Default=None.

  • schema (str or None) – Schema/database from which to select the data tables. Can be None. Default is currently “dp03_catalogs_10yr” for testing using DP0.3.

classmethod construct_from_mpc_obs_sbn(ssObjectId, sql_filename, filter_list=['u', 'g', 'r', 'i', 'z', 'y'], date_range=[60000.0, 67300.0])[source]

Custom constructor which builds the AdlerPlanetoid object and the associated Observations, MPCORB and SSObject objects from the MPC obs_sbn database. This is designed specifically for the SSSC Prompt Products Database Bandaid.

Parameters:
  • ssObjectId (str) – ssObjectId of the object of interest.

  • sql_filename (str) – Filepath to the local SQL database.

  • filter_list (list of str) – A comma-separated list of the filters of interest.

  • date_range (list of float) – The minimum and maximum dates of the desired observations (in MJD).

populate_observations_from_mpc_obs_sbn(ssObjectId, filter_list, date_range, sql_filename)[source]

Populates the observations_by_filter class attribute. This version is specific to the construct_from_mpc_obs_sbn function.

Parameters:
  • ssObjectId (str) – ssObjectId of the object of interest.

  • filter_list (list of str) – A comma-separated list of the filters of interest.

  • date_range (list of float) – The minimum and maximum dates of the desired observations.

  • sql_filename (str) – Filepath to an SQL database.

populate_MPCORB_from_mpc_obs_sbn(ssObjectId, sql_filename)[source]

Populates the MPCORB object class attribute. This version is specific to the construct_from_mpc_obs_sbn function.

Parameters:
  • ssObjectId (str) – ssObjectId of the object of interest.

  • sql_filename (str or None) – Filepath to an SQL database.

populate_SSObject_from_mpc_obs_sbn(ssObjectId, filter_list, sql_filename)[source]

Populates the SSObject class attribute. This version is specific to the construct_from_mpc_obs_sbn function.

Parameters:
  • ssObjectId (str) – ssObjectId of the object of interest.

  • filter_list (list of str) – A comma-separated list of the filters of interest.

  • sql_filename (str or None) – Filepath to an SQL database.

observations_in_filter(filter_name)[source]

User-friendly helper function. Returns the Observations object for a given filter.

Parameters:

filter_name (str) – The desired filter.

Returns:

The Observations object in self.observations_by_filter corresponding to the desired filter.

Return type:

Observations object

observations_within_time(start=None, stop=None)[source]

Get a dataframe of all observations (across all filters) taken within a given time interval.

Parameters:
  • start (float) – The time limits as modified Julian dates. Optional, if not declared then get all data

  • stop (float) – The time limits as modified Julian dates. Optional, if not declared then get all data

Returns:

observations

Return type:

pandas.DataFrame

SSObject_in_filter(filter_name)[source]

User-friendly helper function. Returns the filter-dependent values from SSObject for a given filter.

Parameters:

filter_name (str) – The desired filter.

Returns:

ssobject_in_filter

Return type:

SSObject

attach_previous_adler_data(filepath, modelId=None)[source]

Attaches and returns an AdlerData object containing the most recent AdlerData for this ssObjectId.

Parameters:
  • filepath (path-like object) – Filepath with the location of the output SQL database.

  • modelId (str, optional) – modelId for the model of interest that should be recovered. Default: None.