Last change
on this file since 2859 was 2756, checked in by Takeshi Nakazato, 12 years ago |
New Development: No
JIRA Issue: Yes CAS-4770
Ready for Test: Yes
Interface Changes: No
What Interface Changed: Please list interface changes
Test Programs: test_sdcal2
Put in Release Notes: No
Module(s): Module Names change impacts.
Description: Describe your changes here...
Replace assert with casa::assert_ to avoid aborting casapy session.
|
File size:
1.3 KB
|
Rev | Line | |
---|
[2720] | 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 |
|
---|
[2756] | 14 | #include <casa/Exceptions/Error.h>
|
---|
| 15 | #include <casa/Utilities/Assert.h>
|
---|
| 16 |
|
---|
[2720] | 17 | #include "PSAlmaCalibrator.h"
|
---|
| 18 |
|
---|
| 19 | using namespace casa;
|
---|
| 20 |
|
---|
| 21 | namespace asap {
|
---|
| 22 |
|
---|
| 23 | PSAlmaCalibrator::PSAlmaCalibrator()
|
---|
| 24 | : Calibrator()
|
---|
| 25 | {}
|
---|
| 26 |
|
---|
| 27 | PSAlmaCalibrator::PSAlmaCalibrator(unsigned int nchan)
|
---|
| 28 | : Calibrator(nchan)
|
---|
| 29 | {}
|
---|
| 30 |
|
---|
| 31 | void PSAlmaCalibrator::calibrate()
|
---|
| 32 | {
|
---|
[2756] | 33 | //assert(source_);
|
---|
| 34 | //assert(ref_);
|
---|
| 35 | //assert(scaler_);
|
---|
| 36 | //assert(calibrated_);
|
---|
| 37 | assert_<AipsError>(source_, "Source spectrum is null.");
|
---|
| 38 | assert_<AipsError>(ref_, "Reference spectrum is null.");
|
---|
| 39 | assert_<AipsError>(scaler_, "Scaling factor is null.");
|
---|
| 40 | assert_<AipsError>(calibrated_, "Calibrated spectrum is null.");
|
---|
[2720] | 41 |
|
---|
| 42 | Float *p_s = source_;
|
---|
| 43 | Float *p_r = ref_;
|
---|
| 44 | Float *p_c = calibrated_;
|
---|
| 45 | for (unsigned int i = 0; i < nchan_; i++) {
|
---|
| 46 | *p_c = *p_s / *p_r - 1.0;
|
---|
| 47 | p_s++;
|
---|
| 48 | p_r++;
|
---|
| 49 | p_c++;
|
---|
| 50 | }
|
---|
| 51 |
|
---|
| 52 | p_c = calibrated_;
|
---|
| 53 | p_s = scaler_;
|
---|
| 54 | if (nchanS_ == 1) {
|
---|
| 55 | for (unsigned int i = 0; i < nchan_; i++) {
|
---|
| 56 | *p_c *= *p_s;
|
---|
| 57 | p_c++;
|
---|
| 58 | }
|
---|
| 59 | }
|
---|
| 60 | else {
|
---|
| 61 | for (unsigned int i = 0; i < nchan_; i++) {
|
---|
| 62 | *p_c *= *p_s;
|
---|
| 63 | p_c++;
|
---|
| 64 | p_s++;
|
---|
| 65 | }
|
---|
| 66 | }
|
---|
| 67 | }
|
---|
| 68 |
|
---|
| 69 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.