Changeset 394 for trunk/src


Ignore:
Timestamp:
02/08/05 16:30:29 (20 years ago)
Author:
kil064
Message:

Detect Year now in selecting beam/aperture efficiency data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDAttr.cc

    r362 r394  
    3737#include <casa/Quanta/QC.h>
    3838#include <casa/Quanta/Quantum.h>
     39#include <casa/Quanta/MVTime.h>
    3940
    4041#include <measures/Measures/MEpoch.h>
     
    111112// Look at date where appropriate
    112113
     114   MVTime t(dateObs.getValue());
     115   uInt year = t.year();
     116//
    113117   Vector<Float> facs(freqs.nelements(),1.0);
    114118   switch (inst) {
    115119      case ATMOPRA:
    116120        {
    117            facs = interp (freqs/1.0e9f, MopEtaBeamX_, MopEtaBeam2004Y_);
     121           if (year<2003) {
     122              cerr << "There is no beam efficiency data from before 2003 - using 2003 data" << endl;
     123              facs = interp (freqs/1.0e9f, MopEtaBeamX_, MopEtaBeam2003Y_);
     124           } else if (year==2003) {
     125              cerr << "Using beam efficiency data from 2003" << endl;
     126              facs = interp (freqs/1.0e9f, MopEtaBeamX_, MopEtaBeam2003Y_);
     127           } else {
     128              cerr << "Using beam efficiency data from 2004" << endl;
     129              facs = interp (freqs/1.0e9f, MopEtaBeamX_, MopEtaBeam2004Y_);
     130           }
    118131        }
    119132        break;
     
    132145// Look at date where appropriate
    133146
     147   MVTime t(dateObs.getValue());
     148   uInt year = t.year();
     149//
    134150   Vector<Float> facs(freqs.nelements(),1.0);
    135151   switch (inst) {
    136152      case ATMOPRA:
    137153        {
    138            facs = interp (freqs/1.0e9f, MopEtaApX_, MopEtaAp2004Y_);
     154           if (year<2004) {
     155              cerr << "There is no aperture efficiency data from before 2004 - using 2004 data" << endl;
     156              facs = interp (freqs/1.0e9f, MopEtaApX_, MopEtaAp2004Y_);
     157           } else {
     158              cerr << "Using aperture efficiency data from 2004" << endl;
     159              facs = interp (freqs/1.0e9f, MopEtaApX_, MopEtaAp2004Y_);
     160           }
    139161        }
    140162        break;
Note: See TracChangeset for help on using the changeset viewer.