PolnCalibratorExtensionUtils.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2024 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/More/Polarimetry/Pulsar/PolnCalibratorExtensionUtils.h
10
11#ifndef __Pulsar_PolnCalibratorExtensionUtils_h
12#define __Pulsar_PolnCalibratorExtensionUtils_h
13
14#include "Pulsar/PolnCalibratorExtension.h"
15#include "Pulsar/PolnCalibrator.h"
16
17namespace Calibration
18{
20 MEAL::Complex2* new_transformation (const Pulsar::PolnCalibratorExtension*, unsigned ichan);
21
23 void handle_parameter_names (MEAL::Complex2* to, const Pulsar::PolnCalibratorExtension::Transformation* from);
24
26 void handle_parameter_names (Pulsar::PolnCalibratorExtension::Transformation* to, const MEAL::Complex2* from);
27
29 template<class T, class F>
30 void copy (T* to, const F* from)
31 {
32 if (to->get_nparam() != from->get_nparam())
33 {
34 throw Error (InvalidParam, "Calibration::copy<To,From>",
35 "to nparam=%d != from nparam=%d",
36 to->get_nparam(), from->get_nparam());
37 }
38
39 for (unsigned i=0; i<to->get_nparam(); i++)
40 to->set_Estimate(i, from->get_Estimate(i));
41
42 handle_parameter_names (to, from);
43 }
44}
45
46#endif
47
48
49

Generated using doxygen 1.14.0