Barycentric Correction Primitive

This module defines class BarycentricCorrection which inherits from KPF_Primitive and provides methods to perform the event on barycentric correction in the recipe.

Description:
  • Method __init__:

    BarycentricCorrection constructor, the following arguments are passed to __init__,

    • action (keckdrpframework.models.action.Action): action.args contains positional arguments and keyword arguments passed by the BarycentricCorrection event issued in the recipe:

      • action.args[‘bc_config’] (dict): Instance of dict which contains the observation configuration for Barycentric correction.

      • action.args[‘start_time’] (str | float): Starting time in yyyy-mm-dd or Julian Data format. Defaults to None.

      • action.args[‘period’] (str | int): A period of days for Barycentric correction computation. Default to None.

      • action.args[‘bc_corr_path’] (str): Path of file, a csv file storing a list of redshift values from Barycentric correction computation over a period of time. Default to None.

      • actions.args[‘bc_corr_output’] (str): Path of output file, a csv file. Default to None.

      • actions.args[‘bc_result’] (dict): Result of redshift values from module of BC correction Default to None. This contains the maximum and minimum redshift values to be set to the header of level 1 data if there is.

      • actions.args[‘dataset’] (list): List of data in level 1 data model. Default to None.

    • context (keckdrpframework.models.processing_context.ProcessingContext): context.config_path contains the path of the config file defined for the module of Barycentric correction.

    and the following attributes are defined to initialize the object,

    • bc_config (dict): Instance of dict which contains the observation configuration for Barycentric correction, assigned by action.args[‘bc_config’].

    • start_mjd (float): Starting day for Barycentric correction computation, assigned by action.args[‘start_mjd’].

    • period (int): Period of days for Barycentric correction computation, assigned by actions.args[‘period’].

    • data_path(str): Path of the csv file storing redshift numbers, assigned by actions.args[‘bc_corr_path’].

    • data_output_path(str): Path of output csv file, assigned by actions.args[‘bc_corr_output’].

    • config_path (str): Path of config file for Barycentric correction.

    • config (configparser.ConfigParser): Config context.

    • logger (logging.Logger): Instance of logging.Logger.

    • bc_data (dict): Result of redshift values from Barycentric correction computation, assigned by actions.args[‘bc_result’].

    • dataset (list): List of KPF1 data, assigned by actions.args[‘dataset’].

    • alg (modules.barycentric_correction.src.alg_barycentric_corr.BarycentricCorrectionAlg): Instance of BarycentricCorrectionAlg which has operation codes for Barycentric correction computation.

    The observation configuration could be accessed from either bc_config or config.

  • Method __perform:

    BarycentricCorrection returns the result in Arguments object which contains a list of redshift values, maximum redshift value, minimum redshift value over a period of days.

Usage:

For the recipe, the Barycentric correction event is issued like:

:
op_data = BarycentricCorrection(start_time='2458591.5', period=380, bc_corr_path=KPF_TEST_DATA)
:

where op_data is dict object wrapped in Arguments class object.

class modules.barycentric_correction.src.barycentric_correction.BarycentricCorrection(action: Action, context: ProcessingContext)[source]