p2obt.backend.compose#

p2obt.backend.compose.compose_ob(target_name: str, ob_kind: str, array: List[str], mode: str = 'st', sci_name: str | None = None, tag: str | None = None, resolution: str = 'low', obs_type: str = 'snapshot') Dict[source]#

Composes the dictionary

Parameters:
  • target_name (str) – The target’s name.

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

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

  • 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”.

Returns:

target – A dictionary containg all the target’s information.

Return type:

dict

p2obt.backend.compose.fill_acquisition(target: Dict, op_mode: str, array: List[str], obs_type: str) Dict[source]#

Gets the for the operational mode correct acquisition template and then fills it in with the information from the query.

Parameters:
  • target (dict)

  • op_mode (str)

  • array (list of str)

  • obs_type (str)

Returns:

acquisition

Return type:

dict

p2obt.backend.compose.fill_header(target: Dict, obs_type: str, array: List[str], sci_name: str | None = None, tag: str | None = None) Dict[source]#

Fill header dictionary with the information from the query.

Parameters:
  • target (dict)

  • obs_type (str)

  • array (list of str)

  • sci_name (str, optional)

  • tag (str, optional)

Returns:

header

Return type:

dict

p2obt.backend.compose.fill_observation(target: Dict, resolution: str, obs_type: str, op_type: str, array: List[str]) Dict[source]#

Gets the for the operational mode correct acquisition template and then fills it in with the information from the query.

Parameters:
  • target (dict)

  • resolution (str)

  • obs_type (str)

  • op_type (str)

  • array (str)

Returns:

acquisition

Return type:

dict

p2obt.backend.compose.format_fluxes(target: Dict) Tuple[float | None, float | None][source]#

Correctly gets and formats the fluxes from the queried data.

p2obt.backend.compose.format_proper_motions(target: Dict) Tuple[float, float][source]#

Correctly formats the right ascension’s and declination’s proper motions.

p2obt.backend.compose.format_ra_and_dec(target: Dict) Tuple[str, str][source]#

Correctly formats the right ascension and declination.

p2obt.backend.compose.get_observation_settings(resolution: str, op_mode: str, array: List[str]) Tuple[str, float, float, bool][source]#

Gets the observation settings from the options corresponding to the resolution, operational mode and array configuration.

Parameters:
  • resolution (str)

  • op_mode (str)

  • array (list of str)

Returns:

  • resolution (str)

  • integration_time (float)

  • central_wl (float)

  • photometry (bool)

p2obt.backend.compose.load_template(file: Path, header: str, sub_header: str | None = None, operational_mode: str | None = None) Dict[source]#

Loads a template from a (.toml)-file.

Parameters:
  • file (path) – A (.toml)-file containing templates.

  • header (str) – The name of the specific template.

  • sub_header (str, optional) – The name of a sub-template.

  • operational_mode (str, optional) – The mode in which MATISSE is operated, either “gra4mat” or “matisse”.

Returns:

template – A dictionary that is the template.

Return type:

dict

p2obt.backend.compose.set_ob_name(target: Dict | str, observation_type: str, sci_name: str | None = None, tag: str | None = None) str[source]#

Sets the OB’s name.

Parameters:
  • target (dict or str)

  • observation_type (str)

  • sci_name (str, optional)

  • tag (str, Optional)

Returns:

ob_name

Return type:

str

Examples

p2obt.backend.compose.write_dict(file, dictionary: Dict)[source]#

Iterates over the key and value pairs of a dictionary and writes them.

p2obt.backend.compose.write_ob(ob: Dict, ob_name: str, output_dir: Path) None[source]#

Writes the (.obx)-file to the specified directory