Ignore:
Timestamp:
08/10/10 12:28:15 (14 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: No

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): atnf

Description: Describe your changes here...

Sync with code/atnf/implement/PKSIO


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/external-alma/atnf/PKSIO/NRODataset.cc

    r1757 r1868  
    3434#include <casa/OS/Time.h>
    3535#include <scimath/Mathematics/InterpolateArray1D.h>
     36
     37#include <measures/Measures/MeasConvert.h>
     38#include <measures/Measures/MCFrequency.h>
     39#include <measures/Measures/MFrequency.h>
     40#include <measures/Measures/MPosition.h>
     41#include <measures/Measures/MEpoch.h>
     42#include <measures/Measures/MDirection.h>
    3643
    3744#include <math.h>
     
    796803  }
    797804
     805  // conversion from TOPO to LSRK
     806  v[1] = toLSR( v[1], getStartIntTime( i ), record_->SCX, record_->SCY ) ;
     807
     808  if ( refFreq_[ib] != 0.0 ) {
     809    v[1] = refFreq_[ib] ;
     810  }
     811  else {
     812    refFreq_[ib] = v[1] ;
     813  }
     814
    798815  return v ;
    799816}
     
    820837
    821838}
     839
     840double NRODataset::toLSR( double v, double t, double x, double y )
     841{
     842  double vlsr ;
     843
     844  // get epoch
     845  double tcent = t + 0.5*getIPTIM()/86400.0 ;
     846  MEpoch me( Quantity( tcent, "d" ), MEpoch::UTC ) ;
     847
     848  // get antenna position
     849  MPosition mp ;
     850  if ( SITE.find( "45" ) != string::npos ) {
     851    // 45m telescope
     852    Double posx = -3.8710235e6 ;
     853    Double posy = 3.4281068e6 ;
     854    Double posz = 3.7240395e6 ;
     855    mp = MPosition( MVPosition( posx, posy, posz ),
     856                    MPosition::ITRF ) ;
     857  }
     858  else {
     859    // ASTE
     860    Vector<Double> pos( 2 ) ;
     861    pos[0] = -67.7031 ;
     862    pos[1] = -22.9717 ;
     863    Double sitealt = 4800.0 ;
     864    mp = MPosition( MVPosition( Quantity( sitealt, "m" ),
     865                                Quantum< Vector<Double> >( pos, "deg" ) ),
     866                    MPosition::WGS84 ) ;
     867  }
     868
     869  // get direction
     870  MDirection md ;
     871  if ( SCNCD == 0 ) {
     872    // RADEC
     873    if ( EPOCH == "B1950" ) {
     874      md = MDirection( Quantity( Double(x), "rad" ), Quantity( Double(y), "rad" ),
     875                       MDirection::B1950 ) ;
     876    }
     877    else {
     878      md = MDirection( Quantity( Double(x), "rad" ), Quantity( Double(y), "rad" ),
     879                       MDirection::J2000 ) ;
     880    }
     881  }
     882  else if ( SCNCD == 1 ) {
     883    // LB
     884    md = MDirection( Quantity( Double(x), "rad" ), Quantity( Double(y), "rad" ),
     885                     MDirection::GALACTIC ) ;
     886  }
     887  else {
     888    // AZEL
     889    md = MDirection( Quantity( Double(x), "rad" ), Quantity( Double(y), "rad" ),
     890                     MDirection::AZEL ) ;
     891  }
     892   
     893  // to LSR
     894  MeasFrame mf( me, mp, md ) ;
     895  MFrequency::Convert tolsr( MFrequency::TOPO, MFrequency::Ref( MFrequency::LSRK, mf ) ) ;
     896  vlsr = (double)(tolsr( Double(v) ).get( "Hz" ).getValue()) ;
     897
     898  return vlsr ;
     899}
Note: See TracChangeset for help on using the changeset viewer.