Last change
on this file since 2746 was 2720, checked in by Takeshi Nakazato, 12 years ago |
New Development: Yes
JIRA Issue: Yes CAS-4770 and its sub-tickets
Ready for Test: Yes
Interface Changes: No
What Interface Changed: Please list interface changes
Test Programs: List test programs
Put in Release Notes: Yes/No
Module(s): Module Names change impacts.
Description: Describe your changes here...
First version of applycal for single dish calibration.
Added new classes for the operation (STApplyCal, Calibrator, PSAlmaCalibrator,
Locator, BisectionLocator, Interpolator1D, NearestInterpolator1D).
Also, modified existing classes to fit with implementation of applycal.
|
File size:
1014 bytes
|
Line | |
---|
1 | //
|
---|
2 | // C++ Implementation: PSAlmaCalibrator
|
---|
3 | //
|
---|
4 | // Description:
|
---|
5 | //
|
---|
6 | //
|
---|
7 | // Author: Takeshi Nakazato <takeshi.nakazato@nao.ac.jp>, (C) 2012
|
---|
8 | //
|
---|
9 | // Copyright: See COPYING file that comes with this distribution
|
---|
10 | //
|
---|
11 | //
|
---|
12 | #include <assert.h>
|
---|
13 |
|
---|
14 | #include "PSAlmaCalibrator.h"
|
---|
15 |
|
---|
16 | using namespace casa;
|
---|
17 |
|
---|
18 | namespace asap {
|
---|
19 |
|
---|
20 | PSAlmaCalibrator::PSAlmaCalibrator()
|
---|
21 | : Calibrator()
|
---|
22 | {}
|
---|
23 |
|
---|
24 | PSAlmaCalibrator::PSAlmaCalibrator(unsigned int nchan)
|
---|
25 | : Calibrator(nchan)
|
---|
26 | {}
|
---|
27 |
|
---|
28 | void PSAlmaCalibrator::calibrate()
|
---|
29 | {
|
---|
30 | assert(source_);
|
---|
31 | assert(ref_);
|
---|
32 | assert(scaler_);
|
---|
33 | assert(calibrated_);
|
---|
34 |
|
---|
35 | Float *p_s = source_;
|
---|
36 | Float *p_r = ref_;
|
---|
37 | Float *p_c = calibrated_;
|
---|
38 | for (unsigned int i = 0; i < nchan_; i++) {
|
---|
39 | *p_c = *p_s / *p_r - 1.0;
|
---|
40 | p_s++;
|
---|
41 | p_r++;
|
---|
42 | p_c++;
|
---|
43 | }
|
---|
44 |
|
---|
45 | p_c = calibrated_;
|
---|
46 | p_s = scaler_;
|
---|
47 | if (nchanS_ == 1) {
|
---|
48 | for (unsigned int i = 0; i < nchan_; i++) {
|
---|
49 | *p_c *= *p_s;
|
---|
50 | p_c++;
|
---|
51 | }
|
---|
52 | }
|
---|
53 | else {
|
---|
54 | for (unsigned int i = 0; i < nchan_; i++) {
|
---|
55 | *p_c *= *p_s;
|
---|
56 | p_c++;
|
---|
57 | p_s++;
|
---|
58 | }
|
---|
59 | }
|
---|
60 | }
|
---|
61 |
|
---|
62 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.