p2obt.automate#

p2obt.automate.create_ob(target: str, ob_kind: str, array: str | List[str], mode: str = 'st', sci_name: str | None = None, tag: str | None = None, resolution: str = 'low', obs_type: str = 'snapshot', connection: ApiConnection | None = None, container_id: int | None = None, store_password: bool = True, remove_password: bool = False, user_name: str | None = None, server: str = 'production', output_dir: Path | None = None) None[source]#

Creates a singular OB either locally or on P2.

Parameters:
  • target (str) – The name of the target.

  • ob_kind (str) – The type of OB. If it is a science target (“sci”) or a calibrator (“cal”).

  • array (str or list of str) – Determines the array configuration. Possible values are “UTs”, “small”, “medium”, “large”, “extended” or a list with multiple entries.

  • operational_mode (str, optional) – The mode of operation for MATISSE. Can be either “st”/”standalone” for the MATISSE-standalone mode or “gr”/”gra4mat” for GRA4MAT. Default is standalone.

  • sci_name (str, optional) – The name of the science target. If the OB is a science OB, this is None.

  • tag (str, optional) – The calibrator tag (L, N or LN).

  • resolution (str, optional) – The resolution of the OB. Can be either “low”, “med” or “high”.

  • obs_type (str, optional) – The type of the observation. Can be “snapshot”, “ts/time/time series”, or “im/imaging”, for “snapshot”, “time-series”, or “imaging” respectively. Default is “snapshot”.

  • connection (ApiConnection, optional) – The connection to the P2 database.

  • container_id (int, optional) – The id of the container on P2.

  • store_password (bool, optional) – If ‘True’ the password will be stored in the keyring.

  • remove_password (bool, optional) – If ‘True’ the password will be removed from the keyring.

  • user_name (str, optional) – The user name for the P2 database.

  • server (str, optional) – The server to connect to. Can be either “production” or “test”.

  • output_dir (path, optional) – The output directory, where the (.obx)-files will be created in. If left at “None” no files will be created.

p2obt.automate.create_obs(night_plan: Path | Dict | None = None, container_id: int | None = None, targets: List[str] | None = None, calibrators: List[List[str] | str] | None = None, orders: List[List[str] | str] | None = None, tags: List[List[str] | str] | None = None, resolution: Dict[str, str] | List[str] | str | None = 'low', configuration: Dict[str, str] | List[str] | str | None = None, modes: Dict[str, str] | List[str] | str | None = 'gr', user_name: str | None = None, store_password: bool | None = True, remove_password: bool | None = False, server: str | None = 'production', output_dir: Path | None = None) None[source]#

Creates the OBs from a night-plan parsed dictionary or from a manual input of the four needed lists.

Parameters:
  • night_plan (path, optional) – A dictionary containing a parsed night plan. If given it will automatically upload the obs to p2.

  • container_id (int, optional) – The id that specifies the container on p2.

  • targets (list, optional) – A list of targets. If no night plan is given, this list and the calibrators must be given.

  • calibrators (list, optional) – A list of calibrators that must be given with the targets.

  • orders (list, optional) – A list of the orders of the calibrators. If not given, it will be assumed that the calibrators are before the targets.

  • tags (list, optional) – A list of the tags of the calibrators. If not given, it will be “LN” for all calibrators.

  • resolution (dict or list of str or str, optional) – A dictionary containing the resolution for each target or a list of resolutions for all targets or a single resolution for all targets. Will only be used if no night plan is given.

  • configurations (dict or list of str or str, optional) – A dictionary containing the array configuration for each target or a list of array configurations for all targets or a single array configuration for all targets. Will only be used if no night plan is given.

  • modes (dict or list of str or str, optional) – A dictionary containing the operational mode for each target or a list of operational modes for all targets or a single operational mode for all targets. Will only be used if no night plan is given.

  • user_name (str, optional) – The p2 user name.

  • server (str, optional) – The server to connect to. Can be either “production” or “test”.

  • output_dir (path, optional) – The output directory, where the (.obx)-files will be created in. If left at “None” no files will be created.