PointingModel

class ctapointing.pointingmodel.PointingModel(**kwargs: Any)

Bases: Component

Super class that holds the parameters of a pointing model, provides a function to calculate pointing corrections for a particular coordinate, and enables loading of a model from the database or a file.

Attributes Summary

from_date

A trait for unicode strings.

name

model name

parameters

uuid

UUID of Pointing Model

valid_from

start date of validity of model

valid_until

end date of validity of model

Methods Summary

from_config(**kwargs)

Read a pointing model from either configuration file or database.

get_corrected_pointing(nominal_pointing)

Calculates the corrected pointing for a single nominal pointing position.

get_parameters_as_dict([strip_units])

Return a list of parameter values (with or without units)

get_parameters_as_list([strip_units])

Return a list of parameter values (with or without units)

update_parameter_values(parameters)

Set a model or parts of a model from individual arguments or a dictionary

Attributes Documentation

from_date

A trait for unicode strings.

name

model name

parameters = []
uuid

UUID of Pointing Model

valid_from

start date of validity of model

valid_until

end date of validity of model

Methods Documentation

classmethod from_config(**kwargs)

Read a pointing model from either configuration file or database. Either the path of a configuration file (‘input_url’) or a database collection (‘collection’) must be provided.

Parameters:
  • input_url (str or Path) – path of the configuration file.

  • name (str) – name of the camera (as in PointingCamera.name). When loading the configuration from file, can be set to check that the configuration with the correct name is loaded. When loading from database, is used to identify the correct database record.

  • uuid (str) – UUID of the camera (as in PointingCamera.uuid). When loading the configuration from file, can be set to check that the configuration with the correct UUID is loaded. When loading from database, is used to identify the correct database record.

  • collection (str) – name of the database collection from which configuration is read

  • database (str) – name of the database in which the collection is stored

Returns:

camera

Return type:

PointingCamera object

get_corrected_pointing(nominal_pointing)

Calculates the corrected pointing for a single nominal pointing position. Must be implemented by child class.

get_parameters_as_dict(strip_units=False) dict

Return a list of parameter values (with or without units)

get_parameters_as_list(strip_units=False) list

Return a list of parameter values (with or without units)

update_parameter_values(parameters: dict | list) None

Set a model or parts of a model from individual arguments or a dictionary

Parameters:

parameters (dict) – dictionary of model parameters names (keys) and parameter values

__init__(config=None, parent=None, **kwargs)
Parameters:
  • config (traitlets.loader.Config) – Configuration specified by config file or cmdline arguments. Used to set traitlet values.

  • parent (Tool or Component) – If a Component is created by another Component or Tool, you need to pass the creating Component as parent, e.g. parent=self. This makes sure the config is correctly handed down to the child components. Do not pass config in this case.

  • kwargs – Traitlets to be overridden. TraitError is raised if kwargs contains a key that does not correspond to a traitlet.

classmethod from_config(**kwargs)

Read a pointing model from either configuration file or database. Either the path of a configuration file (‘input_url’) or a database collection (‘collection’) must be provided.

Parameters:
  • input_url (str or Path) – path of the configuration file.

  • name (str) – name of the camera (as in PointingCamera.name). When loading the configuration from file, can be set to check that the configuration with the correct name is loaded. When loading from database, is used to identify the correct database record.

  • uuid (str) – UUID of the camera (as in PointingCamera.uuid). When loading the configuration from file, can be set to check that the configuration with the correct UUID is loaded. When loading from database, is used to identify the correct database record.

  • collection (str) – name of the database collection from which configuration is read

  • database (str) – name of the database in which the collection is stored

Returns:

camera

Return type:

PointingCamera object

get_corrected_pointing(nominal_pointing)

Calculates the corrected pointing for a single nominal pointing position. Must be implemented by child class.

get_parameters_as_dict(strip_units=False) dict

Return a list of parameter values (with or without units)

get_parameters_as_list(strip_units=False) list

Return a list of parameter values (with or without units)

name

model name

update_parameter_values(parameters: dict | list) None

Set a model or parts of a model from individual arguments or a dictionary

Parameters:

parameters (dict) – dictionary of model parameters names (keys) and parameter values

uuid

UUID of Pointing Model

valid_from

start date of validity of model

valid_until

end date of validity of model