Ignore:
Timestamp:
06/09/10 19:03:06 (14 years ago)
Author:
Kana Sugimoto
Message:

New Development: Yes

JIRA Issue: Yes (CAS-2211)

Ready for Test: Yes

Interface Changes: Yes

What Interface Changed: ASAP 3.0.0 interface changes

Test Programs:

Put in Release Notes: Yes

Module(s): all the CASA sd tools and tasks are affected.

Description: Merged ATNF-ASAP 3.0.0 developments to CASA (alma) branch.

Note you also need to update casa/code/atnf.


Location:
branches/alma
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/alma

  • branches/alma/src/STFocus.cpp

    r957 r1757  
    3434}
    3535
    36 asap::STFocus::STFocus( casa::Table tab ) : STSubTable(tab, name_)
     36STFocus::STFocus( casa::Table tab ) :
     37  STSubTable(tab, name_)
    3738{
     39  parangleCol_.attach(table_,"PARANGLE");
    3840  rotationCol_.attach(table_,"ROTATION");
    3941  axisCol_.attach(table_,"AXIS");
     
    5052}
    5153
    52 STFocus& asap::STFocus::operator =( const STFocus & other )
     54STFocus& STFocus::operator =( const STFocus & other )
    5355{
    5456  if (this != &other) {
    5557    static_cast<STSubTable&>(*this) = other;
     58    parangleCol_.attach(table_,"PARANGLE");
    5659    rotationCol_.attach(table_,"ROTATION");
    5760    axisCol_.attach(table_,"AXIS");
     
    6568  return *this;
    6669}
    67 void asap::STFocus::setup( )
     70void STFocus::setup( )
    6871{
    6972  // add to base class table
     73  table_.addColumn(ScalarColumnDesc<Float>("PARANGLE"));
    7074  table_.addColumn(ScalarColumnDesc<Float>("ROTATION"));
    7175  table_.addColumn(ScalarColumnDesc<Float>("AXIS"));
     
    7680  table_.addColumn(ScalarColumnDesc<Float>("XYPHASE"));
    7781  table_.addColumn(ScalarColumnDesc<Float>("XYPHASEOFFSET"));
     82  table_.rwKeywordSet().define("PARALLACTIFY", False);
    7883
    7984  // new cached columns
     85  parangleCol_.attach(table_,"PARANGLE");
    8086  rotationCol_.attach(table_,"ROTATION");
    8187  axisCol_.attach(table_,"AXIS");
     
    8894}
    8995
    90 uInt STFocus::addEntry( Float fax, Float ftan, Float frot, Float hand,
    91                         Float user, Float mount,
    92                         Float xyphase, Float xyphaseoffset)
     96  uInt STFocus::addEntry( Float pa, Float fax, Float ftan, Float frot, Float hand,
     97                          Float user, Float mount,
     98                          Float xyphase, Float xyphaseoffset)
    9399{
    94   Table result = table_( near(table_.col("ROTATION"), frot)
    95                     && near(table_.col("AXIS"), fax)
    96                     && near(table_.col("TAN"), ftan)
    97                     && near(table_.col("HAND"), hand)
    98                     && near(table_.col("USERPHASE"), user)
    99                     && near(table_.col("MOUNT"), mount)
    100                     && near(table_.col("XYPHASE"), xyphase)
    101                     && near(table_.col("XYPHASEOFFSET"), xyphaseoffset)
    102                     );
     100  Table result = table_(  near(table_.col("PARANGLE"), pa)
     101                          && near(table_.col("ROTATION"), frot)
     102                          && near(table_.col("AXIS"), fax)
     103                          && near(table_.col("TAN"), ftan)
     104                          && near(table_.col("HAND"), hand)
     105                          && near(table_.col("USERPHASE"), user)
     106                          && near(table_.col("MOUNT"), mount)
     107                          && near(table_.col("XYPHASE"), xyphase)
     108                          && near(table_.col("XYPHASEOFFSET"), xyphaseoffset)
     109                          );
    103110  uInt resultid = 0;
    104111  if ( result.nrow() > 0) {
     
    113120      resultid++;
    114121    }
     122    parangleCol_.put(rno, pa);
    115123    rotationCol_.put(rno, frot);
    116124    axisCol_.put(rno, fax);
     
    126134}
    127135
    128 void asap::STFocus::getEntry( Float& rotation, Float& angle, Float& ftan,
    129                               Float& hand, Float& user, Float& mount,
    130                               Float& xyphase, Float& xyphaseoffset,
    131                               uInt id) const
     136  void STFocus::getEntry( Float& pa, Float& rotation, Float& angle, Float& ftan,
     137                                Float& hand, Float& user, Float& mount,
     138                                Float& xyphase, Float& xyphaseoffset,
     139                                uInt id) const
    132140{
    133141  Table t = table_(table_.col("ID") == Int(id) );
     
    138146  // get first row - there should only be one matching id
    139147  const TableRecord& rec = row.get(0);
     148  pa = rec.asFloat("PARANGLE");
    140149  rotation = rec.asFloat("ROTATION");
    141150  angle = rec.asFloat("AXIS");
     
    149158
    150159
    151 casa::Float asap::STFocus::getTotalFeedAngle( casa::uInt id ) const
     160casa::Float STFocus::getTotalAngle( casa::uInt id ) const
    152161{
    153162  Float total = 0.0f;
    154163  Table t = table_(table_.col("ID") == Int(id) );
    155164  if (t.nrow() == 0 ) {
    156     throw(AipsError("STFocus::getEntry - id out of range"));
     165    throw(AipsError("STFocus::getTotalAngle - id out of range"));
     166  }
     167  if (table_.keywordSet().asBool("PARALLACTIFY")) {
     168    return 0.0f;
    157169  }
    158170  ROTableRow row(t);
    159171  // get first row - there should only be one matching id
    160172  const TableRecord& rec = row.get(0);
     173  total += rec.asFloat("PARANGLE"); 
    161174  total += rec.asFloat("ROTATION");
    162175  total += rec.asFloat("USERPHASE");
     
    164177  return total;
    165178}
    166 }
    167179
    168 casa::Float asap::STFocus::getFeedHand( casa::uInt id ) const
     180
     181casa::Float STFocus::getFeedHand( casa::uInt id ) const
    169182{
    170183  Table t = table_(table_.col("ID") == Int(id) );
     
    177190}
    178191
     192void STFocus::setParallactify(bool istrue) {
     193  table_.rwKeywordSet().define("PARALLACTIFY", Bool(istrue));
     194}
     195
     196}
Note: See TracChangeset for help on using the changeset viewer.