LCOV - code coverage report
Current view: top level - atmosphere/ATM - ATMWaterVaporRadiometer.cc (source / functions) Hit Total Coverage
Test: casa_coverage.info Lines: 2 121 1.7 %
Date: 2023-10-25 08:47:59 Functions: 1 10 10.0 %

          Line data    Source code
       1             : /*******************************************************************************
       2             :  * ALMA - Atacama Large Millimiter Array
       3             :  * (c) Instituto de Estructura de la Materia, 2009
       4             :  *
       5             :  * This library is free software; you can redistribute it and/or
       6             :  * modify it under the terms of the GNU Lesser General Public
       7             :  * License as published by the Free Software Foundation; either
       8             :  * version 2.1 of the License, or (at your option) any later version.
       9             :  *
      10             :  * This library is distributed in the hope that it will be useful,
      11             :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      12             :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      13             :  * Lesser General Public License for more details.
      14             :  *
      15             :  * You should have received a copy of the GNU Lesser General Public
      16             :  * License along with this library; if not, write to the Free Software
      17             :  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
      18             :  *
      19             :  * "@(#) $Id: ATMWaterVaporRadiometer.cpp Exp $"
      20             :  *
      21             :  * who       when      what
      22             :  * --------  --------  ----------------------------------------------
      23             :  * pardo     24/03/09  created
      24             :  */
      25             : 
      26             : #include "ATMWaterVaporRadiometer.h"
      27             : 
      28             : #include <vector>
      29             : #include <string>
      30             : #include <stdio.h>
      31             : #include <iostream>
      32             : 
      33             : 
      34             : 
      35             : ATM_NAMESPACE_BEGIN
      36             : 
      37           0 : WaterVaporRadiometer::WaterVaporRadiometer(const std::vector<unsigned int> &IdChannels)
      38             : {
      39             : 
      40           0 :   spilloverTemperature_ = Temperature(-999.0, Temperature::UnitKelvin);
      41           0 :   IdChannels_ = IdChannels;
      42             : 
      43           0 :   Percent sg(50, Percent::UnitPercent); // IF DOUBLE SIDE BAND, Default Sideband Gain is 50%
      44             : 
      45           0 :   for(unsigned int i = 0; i < IdChannels.size(); i++) {
      46             : 
      47           0 :     skyCoupling_.push_back(1.0);
      48           0 :     signalGain_.push_back(sg);
      49             : 
      50             :   }
      51             : 
      52           0 : }
      53             : 
      54           0 : WaterVaporRadiometer::WaterVaporRadiometer(const std::vector<unsigned int> &IdChannels,
      55           0 :                                            const std::vector<double> &skyCoupling)
      56             : {
      57             : 
      58           0 :   spilloverTemperature_ = Temperature(-999.0, Temperature::UnitKelvin);
      59           0 :   IdChannels_ = IdChannels;
      60             : 
      61             :   /*    if(IdChannels.size()!=skyCoupling.size()){throw Error();} */
      62             : 
      63           0 :   if(IdChannels.size() < skyCoupling.size()) {
      64           0 :     for(unsigned int i = 0; i < IdChannels.size(); i++) {
      65           0 :       skyCoupling_.push_back(skyCoupling[i]);
      66             :     }
      67             :   } else {
      68           0 :     if(IdChannels.size() == skyCoupling.size()) {
      69           0 :       skyCoupling_ = skyCoupling;
      70             :     } else {
      71           0 :       for(unsigned int i = 0; i < skyCoupling.size(); i++) {
      72           0 :         skyCoupling_.push_back(skyCoupling[i]);
      73             :       }
      74           0 :       for(unsigned int i = skyCoupling.size(); i < IdChannels.size(); i++) {
      75           0 :         skyCoupling_.push_back(skyCoupling[skyCoupling.size() - 1]);
      76             :       }
      77             :     }
      78             :   }
      79             : 
      80           0 : }
      81             : 
      82           0 : WaterVaporRadiometer::WaterVaporRadiometer(const std::vector<unsigned int> &IdChannels,
      83           0 :                                            const std::vector<Percent> &signalGain)
      84             : {
      85             : 
      86           0 :   spilloverTemperature_ = Temperature(-999.0, Temperature::UnitKelvin);
      87           0 :   IdChannels_ = IdChannels;
      88             : 
      89           0 :   if(IdChannels.size() < signalGain.size()) {
      90           0 :     for(unsigned int i = 0; i < IdChannels.size(); i++) {
      91           0 :       signalGain_.push_back(signalGain[i]);
      92             :     }
      93             :   } else {
      94           0 :     if(IdChannels.size() == signalGain.size()) {
      95           0 :       signalGain_ = signalGain;
      96             :     } else {
      97           0 :       for(unsigned int i = 0; i < signalGain.size(); i++) {
      98           0 :         signalGain_.push_back(signalGain[i]);
      99             :       }
     100           0 :       for(unsigned int i = signalGain.size(); i < IdChannels.size(); i++) {
     101           0 :         signalGain_.push_back(signalGain[signalGain.size() - 1]);
     102             :       }
     103             :     }
     104             :   }
     105             : 
     106           0 : }
     107             : 
     108           0 : WaterVaporRadiometer::WaterVaporRadiometer(const std::vector<unsigned int> &IdChannels,
     109             :                                            const std::vector<double> &skyCoupling,
     110           0 :                                            const std::vector<Percent> &signalGain)
     111             : {
     112             : 
     113           0 :   spilloverTemperature_ = Temperature(-999.0, Temperature::UnitKelvin);
     114           0 :   IdChannels_ = IdChannels;
     115             : 
     116           0 :   if(IdChannels.size() < skyCoupling.size()) {
     117           0 :     for(unsigned int i = 0; i < IdChannels.size(); i++) {
     118           0 :       skyCoupling_.push_back(skyCoupling[i]);
     119             :     }
     120             :   } else {
     121           0 :     if(IdChannels.size() == skyCoupling.size()) {
     122           0 :       skyCoupling_ = skyCoupling;
     123             :     } else {
     124           0 :       for(unsigned int i = 0; i < skyCoupling.size(); i++) {
     125           0 :         skyCoupling_.push_back(skyCoupling[i]);
     126             :       }
     127           0 :       for(unsigned int i = skyCoupling.size(); i < IdChannels.size(); i++) {
     128           0 :         skyCoupling_.push_back(skyCoupling[skyCoupling.size() - 1]);
     129             :       }
     130             :     }
     131             :   }
     132             : 
     133           0 :   if(IdChannels.size() < signalGain.size()) {
     134           0 :     for(unsigned int i = 0; i < IdChannels.size(); i++) {
     135           0 :       signalGain_.push_back(signalGain[i]);
     136             :     }
     137             :   } else {
     138           0 :     if(IdChannels.size() == signalGain.size()) {
     139           0 :       signalGain_ = signalGain;
     140             :     } else {
     141           0 :       for(unsigned int i = 0; i < signalGain.size(); i++) {
     142           0 :         signalGain_.push_back(signalGain[i]);
     143             :       }
     144           0 :       for(unsigned int i = signalGain.size(); i < IdChannels.size(); i++) {
     145           0 :         signalGain_.push_back(signalGain[signalGain.size() - 1]);
     146             :       }
     147             :     }
     148             :   }
     149             : 
     150           0 : }
     151             : 
     152           0 : WaterVaporRadiometer::WaterVaporRadiometer(const std::vector<unsigned int> &IdChannels,
     153           0 :                                            const Temperature &spilloverTemperature)
     154             : {
     155             : 
     156           0 :   spilloverTemperature_ = spilloverTemperature;
     157           0 :   IdChannels_ = IdChannels;
     158             : 
     159           0 :   Percent sg(50, Percent::UnitPercent); // IF DOUBLE SIDE BAND, Default Sideband Gain is 50%
     160             : 
     161           0 :   for(unsigned int i = 0; i < IdChannels.size(); i++) {
     162             : 
     163           0 :     skyCoupling_.push_back(1.0);
     164           0 :     signalGain_.push_back(sg);
     165             : 
     166             :   }
     167             : 
     168           0 : }
     169             : 
     170           0 : WaterVaporRadiometer::WaterVaporRadiometer(const std::vector<unsigned int> &IdChannels,
     171             :                                            const std::vector<double> &skyCoupling,
     172           0 :                                            const Temperature &spilloverTemperature)
     173             : {
     174             : 
     175           0 :   spilloverTemperature_ = spilloverTemperature;
     176           0 :   IdChannels_ = IdChannels;
     177             : 
     178           0 :   if(IdChannels.size() < skyCoupling.size()) {
     179           0 :     for(unsigned int i = 0; i < IdChannels.size(); i++) {
     180           0 :       skyCoupling_.push_back(skyCoupling[i]);
     181             :     }
     182             :   } else {
     183           0 :     if(IdChannels.size() == skyCoupling.size()) {
     184           0 :       skyCoupling_ = skyCoupling;
     185             :     } else {
     186           0 :       for(unsigned int i = 0; i < skyCoupling.size(); i++) {
     187           0 :         skyCoupling_.push_back(skyCoupling[i]);
     188             :       }
     189           0 :       for(unsigned int i = skyCoupling.size(); i < IdChannels.size(); i++) {
     190           0 :         skyCoupling_.push_back(skyCoupling[skyCoupling.size() - 1]);
     191             :       }
     192             :     }
     193             :   }
     194             : 
     195           0 : }
     196             : 
     197           0 : WaterVaporRadiometer::WaterVaporRadiometer(const std::vector<unsigned int> &IdChannels,
     198             :                                            const std::vector<Percent> &signalGain,
     199           0 :                                            const Temperature &spilloverTemperature)
     200             : {
     201             : 
     202           0 :   spilloverTemperature_ = spilloverTemperature;
     203           0 :   IdChannels_ = IdChannels;
     204             : 
     205           0 :   if(IdChannels.size() < signalGain.size()) {
     206           0 :     for(unsigned int i = 0; i < IdChannels.size(); i++) {
     207           0 :       signalGain_.push_back(signalGain[i]);
     208             :     }
     209             :   } else {
     210           0 :     if(IdChannels.size() == signalGain.size()) {
     211           0 :       signalGain_ = signalGain;
     212             :     } else {
     213           0 :       for(unsigned int i = 0; i < signalGain.size(); i++) {
     214           0 :         signalGain_.push_back(signalGain[i]);
     215             :       }
     216           0 :       for(unsigned int i = signalGain.size(); i < IdChannels.size(); i++) {
     217           0 :         signalGain_.push_back(signalGain[signalGain.size() - 1]);
     218             :       }
     219             :     }
     220             :   }
     221             : 
     222           0 : }
     223             : 
     224           0 : WaterVaporRadiometer::WaterVaporRadiometer(const std::vector<unsigned int> &IdChannels,
     225             :                                            const std::vector<double> &skyCoupling,
     226             :                                            const std::vector<Percent> &signalGain,
     227           0 :                                            const Temperature &spilloverTemperature)
     228             : {
     229             : 
     230           0 :   spilloverTemperature_ = spilloverTemperature;
     231           0 :   IdChannels_ = IdChannels;
     232             : 
     233           0 :   if(IdChannels.size() < skyCoupling.size()) {
     234           0 :     for(unsigned int i = 0; i < IdChannels.size(); i++) {
     235           0 :       skyCoupling_.push_back(skyCoupling[i]);
     236             :     }
     237             :   } else {
     238           0 :     if(IdChannels.size() == skyCoupling.size()) {
     239           0 :       skyCoupling_ = skyCoupling;
     240             :     } else {
     241           0 :       for(unsigned int i = 0; i < skyCoupling.size(); i++) {
     242           0 :         skyCoupling_.push_back(skyCoupling[i]);
     243             :       }
     244           0 :       for(unsigned int i = skyCoupling.size(); i < IdChannels.size(); i++) {
     245           0 :         skyCoupling_.push_back(skyCoupling[skyCoupling.size() - 1]);
     246             :       }
     247             :     }
     248             :   }
     249             : 
     250           0 :   if(IdChannels.size() < signalGain.size()) {
     251           0 :     for(unsigned int i = 0; i < IdChannels.size(); i++) {
     252           0 :       signalGain_.push_back(signalGain[i]);
     253             :     }
     254             :   } else {
     255           0 :     if(IdChannels.size() == signalGain.size()) {
     256           0 :       signalGain_ = signalGain;
     257             :     } else {
     258           0 :       for(unsigned int i = 0; i < signalGain.size(); i++) {
     259           0 :         signalGain_.push_back(signalGain[i]);
     260             :       }
     261           0 :       for(unsigned int i = signalGain.size(); i < IdChannels.size(); i++) {
     262           0 :         signalGain_.push_back(signalGain[signalGain.size() - 1]);
     263             :       }
     264             :     }
     265             :   }
     266             : 
     267           0 : }
     268             : 
     269        1112 : WaterVaporRadiometer::~WaterVaporRadiometer()
     270             : {
     271        1112 : }
     272             : 
     273             : ATM_NAMESPACE_END

Generated by: LCOV version 1.16