Changeset 362


Ignore:
Timestamp:
02/03/05 16:44:37 (19 years ago)
Author:
kil064
Message:

move gain elevation info into here from SDMath

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDAttr.cc

    r361 r362  
    7070{
    7171   Float D = 1.0;
    72    if (inst==ATPKSMB || inst==ATPKSHOH) {
    73       D = 64.0;
    74    } else if (inst==ATMOPRA) {
    75       D = 22.0;
    76    } else if (inst==TIDBINBILLA) {
    77       D = 70.0;
    78    } else if (inst==CEDUNA) {
    79       D = 30.0;
    80    } else if (inst==HOBART) {
    81       D = 26.0;
    82    } else {
    83       throw(AipsError("Unknown instrument"));
     72   switch (inst) {
     73      case ATMOPRA:
     74        {
     75           D = 22.0;
     76        }
     77        break;
     78      case ATPKSMB:
     79      case ATPKSHOH:
     80        {
     81           D = 64.0;
     82        }
     83        break;
     84      case TIDBINBILLA:
     85        {
     86           D = 70.0;
     87        }
     88        break;
     89      case CEDUNA:
     90        {
     91           D = 30.0;
     92        }
     93        break;
     94      case HOBART:
     95        {
     96           D = 26.0;
     97        }
     98        break;
     99      default:
     100        {
     101            throw(AipsError("Unknown instrument"));
     102        }
    84103   }
    85104//
     
    93112
    94113   Vector<Float> facs(freqs.nelements(),1.0);
    95    if (inst==ATPKSMB) {
    96       cerr << "No beam efficiency data for this instrument - assuming unity" << endl;
    97    } else if (inst==ATPKSHOH) {
    98       cerr << "No beam efficiency data for this instrument - assuming unity" << endl;
    99    } else if (inst==ATMOPRA) {
    100       facs = interp (freqs/1.0e9f, MopEtaBeamX_, MopEtaBeam2004Y_);
    101    } else if (inst==TIDBINBILLA) {
    102       cerr << "No beam efficiency data for this instrument - assuming unity" << endl;
    103    } else if (inst==CEDUNA) {
    104       cerr << "No beam efficiency data for this instrument - assuming unity" << endl;
    105    } else if (inst==HOBART) {
    106       cerr << "No beam efficiency data for this instrument - assuming unity" << endl;
    107    } else {
     114   switch (inst) {
     115      case ATMOPRA:
     116        {
     117           facs = interp (freqs/1.0e9f, MopEtaBeamX_, MopEtaBeam2004Y_);
     118        }
     119        break;
     120      default:
     121        {
     122           cerr << "No beam efficiency data for this instrument - assuming unity" << endl;
     123        }
    108124   }
    109125//
     
    117133
    118134   Vector<Float> facs(freqs.nelements(),1.0);
    119    if (inst==ATPKSMB) {
    120       cerr << "No aperture efficiency data for this instrument - assuming unity" << endl;
    121    } else if (inst==ATPKSHOH) {
    122       cerr << "No aperture efficiency data for this instrument - assuming unity" << endl;
    123    } else if (inst==ATMOPRA) {
    124       facs = interp (freqs/1.0e9f, MopEtaApX_, MopEtaAp2004Y_);
    125    } else if (inst==TIDBINBILLA) {
    126       cerr << "No aperture efficiency data for this instrument - assuming unity" << endl;
    127    } else if (inst==CEDUNA) {
    128       cerr << "No aperture efficiency data for this instrument - assuming unity" << endl;
    129    } else if (inst==HOBART) {
    130       cerr << "No aperture efficiency data for this instrument - assuming unity" << endl;
    131    } else {
    132       cerr << "No aperture efficiency data for this instrument - assuming unity" << endl;
     135   switch (inst) {
     136      case ATMOPRA:
     137        {
     138           facs = interp (freqs/1.0e9f, MopEtaApX_, MopEtaAp2004Y_);
     139        }
     140        break;
     141      default:
     142        {
     143           cerr << "No aperture efficiency data for this instrument - assuming unity" << endl;
     144        }
    133145   }
    134146   return facs;
     
    166178
    167179
     180Vector<Float> SDAttr::gainElevationPoly (Instrument inst) const
     181{
     182
     183// Look at date where appropriate
     184
     185   switch (inst) {
     186      case TIDBINBILLA:
     187        {
     188           return TidGainElPoly_.copy();
     189        }
     190        break;
     191      default:
     192        {
     193           Vector<Float> t;
     194           return t.copy();
     195        }
     196   }
     197}
     198
     199
     200
    168201
    169202// Private
     
    186219
    187220void SDAttr::initData ()
    188 {
    189221//
    190222// Mopra data from online Mopra guide.
    191223//
     224{
     225
     226// Beam efficiency
     227
    192228   MopEtaBeamX_.resize(3);
    193229   MopEtaBeamX_(0) = 86.0;
     
    204240   MopEtaBeam2004Y_(1) = 0.44;
    205241   MopEtaBeam2004Y_(2) = 0.42;
    206 //
     242
     243// Aperture efficiency
     244
    207245   MopEtaApX_.resize(2);
    208246   MopEtaApX_(0) = 86.0;
     
    212250   MopEtaAp2004Y_(0) = 0.33;
    213251   MopEtaAp2004Y_(1) = 0.24;
    214 }
    215 
     252
     253// Gain elevation correction polynomial coefficients (for elevation in degrees)
     254
     255   TidGainElPoly_.resize(3);
     256   TidGainElPoly_(0) = 3.58788e-1;
     257   TidGainElPoly_(1) = 2.87243e-2;
     258   TidGainElPoly_(2) = -3.219093e-4;
     259}
  • trunk/src/SDAttr.h

    r361 r362  
    6363
    6464// Beam efficiency.  Frequency in Hz.  Returns 1 if unknown.
    65    casa::Vector<casa::Float> beamEfficiency (Instrument, const casa::MEpoch& dateObs,
     65   casa::Vector<casa::Float> beamEfficiency (Instrument instr, const casa::MEpoch& dateObs,
    6666                                             const casa::Vector<casa::Float>& freqs) const;
    6767 
    6868// Aperture efficiency. Frequency in Hz.  Returns 1 if unknown.
    69    casa::Vector<casa::Float> apertureEfficiency (Instrument, const casa::MEpoch& dateObs,
     69   casa::Vector<casa::Float> apertureEfficiency (Instrument instr, const casa::MEpoch& dateObs,
    7070                                                 const casa::Vector<casa::Float>& freqs) const;
    7171
    7272// Find factor to convert Jy -> K for this telescope, date of observation and frequency (Hz)
    73    casa::Vector<casa::Float> JyPerK (Instrument, const casa::MEpoch& dateObs,
     73   casa::Vector<casa::Float> JyPerK (Instrument instr, const casa::MEpoch& dateObs,
    7474                                     const casa::Vector<casa::Float>& freqs) const;
    7575
     
    7777   static casa::Float findJyPerKFac (casa::Float etaAp, casa::Float D);
    7878
     79// Gain Elevation polynomial correction coefficients (elevation in degrees)
     80// Returns length 0 if not known.
     81   casa::Vector<casa::Float> gainElevationPoly (Instrument instr) const;
     82
    7983 private:
    8084
    8185// Static data
    8286
    83    casa::Vector<casa::Float> MopEtaBeamX_;
     87   casa::Vector<casa::Float> MopEtaBeamX_;          // Beam efficiency
    8488   casa::Vector<casa::Float> MopEtaBeam2003Y_;
    8589   casa::Vector<casa::Float> MopEtaBeam2004Y_;
    86    casa::Vector<casa::Float> MopEtaApX_;
     90//
     91   casa::Vector<casa::Float> MopEtaApX_;            // Aperture efficiency
    8792   casa::Vector<casa::Float> MopEtaAp2004Y_;
     93//
     94   casa::Vector<casa::Float> TidGainElPoly_;        // Gain-el correction poly coeffs
    8895
    8996// Init private data
Note: See TracChangeset for help on using the changeset viewer.