Changeset 2247 for branches


Ignore:
Timestamp:
07/25/11 14:57:22 (13 years ago)
Author:
Takeshi Nakazato
Message:

merged changes in trunk (r2209,r2202,r2243

Location:
branches/parallel
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • branches/parallel

  • branches/parallel/Makefile

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/parallel/SConstruct

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/parallel/apps

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/parallel/external-alma

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/parallel/external-alma/atnf/pks/pks_maths.cc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/parallel/getsvnrev.sh

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/parallel/python

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/parallel/python/flagtoolbar.py

  • branches/parallel/src

  • branches/parallel/src/FillerBase.cpp

    r1876 r2247  
    1212
    1313#include <casa/Containers/RecordField.h>
     14#include <tables/Tables/ExprNode.h>
    1415
    1516#include "FillerBase.h"
     
    176177}
    177178
     179void FillerBase::setWeather2(Float temperature,
     180                             Float pressure,
     181                             Float humidity,
     182                             Float windspeed,
     183                             Float windaz)
     184{
     185  uInt id ;
     186  Table tab = table_->weather().table() ;
     187  Table subt = tab( tab.col("TEMPERATURE") == temperature \
     188                    && tab.col("PRESSURE") == pressure \
     189                    && tab.col("HUMIDITY") == humidity \
     190                    && tab.col("WINDSPEED") == windspeed \
     191                    && tab.col("WINDAZ") == windaz, 1 ) ;
     192  Int nrow = tab.nrow() ;
     193  Int nrowSel = subt.nrow() ;
     194  if ( nrowSel == 0 ) {
     195    tab.addRow( 1, True ) ;
     196    TableRow row( tab ) ;
     197    TableRecord &rec = row.record() ;
     198    RecordFieldPtr<casa::uInt> rfpi ;
     199    rfpi.attachToRecord( rec, "ID" ) ;
     200    *rfpi = (uInt)nrow ;
     201    RecordFieldPtr<casa::Float> rfp ;
     202    rfp.attachToRecord( rec, "TEMPERATURE" ) ;
     203    *rfp = temperature ;
     204    rfp.attachToRecord( rec, "PRESSURE" ) ;
     205    *rfp = pressure ;
     206    rfp.attachToRecord( rec, "HUMIDITY" ) ;
     207    *rfp = humidity ;
     208    rfp.attachToRecord( rec, "WINDSPEED" ) ;
     209    *rfp = windspeed ;
     210    rfp.attachToRecord( rec, "WINDAZ" ) ;
     211    *rfp = windaz ;
     212    row.put( nrow, rec ) ;
     213    id = (uInt)nrow ;
     214  }
     215  else {
     216    ROTableColumn tc( subt, "ID" ) ;
     217    id = tc.asuInt( 0 ) ;
     218  }
     219  RecordFieldPtr<uInt> mweatheridCol(row_.record(), "WEATHER_ID");
     220  *mweatheridCol = id;
     221}
     222
     223void FillerBase::setTcal2(const String& tcaltime,
     224                          const Vector<Float>& tcal)
     225{
     226  uInt id = 0 ;
     227  Table tab = table_->tcal().table() ;
     228  Table result =
     229    //tab( nelements(tab.col("TCAL")) == uInt (tcal.size()) &&
     230    //     all(tab.col("TCAL")== tcal) &&
     231    //     tab.col("TIME") == tcaltime, 1 ) ;
     232    tab( nelements(tab.col("TCAL")) == uInt (tcal.size()) &&
     233         all(tab.col("TCAL")== tcal), 1 ) ;
     234
     235  if ( result.nrow() > 0 ) {
     236    ROTableColumn tmpCol( result, "ID" ) ;
     237    tmpCol.getScalar( 0, id ) ;
     238  }
     239  else {
     240    uInt rno = tab.nrow();
     241    tab.addRow();
     242    TableColumn idCol( tab, "ID" ) ;
     243    TableColumn tctimeCol( tab, "TIME" ) ;
     244    ArrayColumn<Float> tcalCol( tab, "TCAL" ) ;
     245    // get last assigned _id and increment
     246    if ( rno > 0 ) {
     247      idCol.getScalar(rno-1, id);
     248      id++;
     249    }
     250    tctimeCol.putScalar(rno, tcaltime);
     251    tcalCol.put(rno, tcal);
     252    idCol.putScalar(rno, id);
     253  }
     254
     255  RecordFieldPtr<uInt> mcalidCol(row_.record(), "TCAL_ID");
     256  *mcalidCol = id;
     257}
     258
    178259};
  • branches/parallel/src/FillerBase.h

    r1904 r2247  
    7777                            casa::Float windspeed=0.0f,
    7878                            casa::Float windaz=0.0f);
     79    void setWeather2(casa::Float temperature=0.0f,
     80                            casa::Float pressure=0.0f,
     81                            casa::Float humidity=0.0f,
     82                            casa::Float windspeed=0.0f,
     83                            casa::Float windaz=0.0f);
    7984    void setTcal(const casa::String& caltime="",
     85                         const casa::Vector<casa::Float>& tcal=casa::Vector<casa::Float>());
     86    void setTcal2(const casa::String& caltime="",
    8087                         const casa::Vector<casa::Float>& tcal=casa::Vector<casa::Float>());
    8188    void setScanRate(const casa::Vector<casa::Double>& srate=casa::Vector<casa::Double>());
  • branches/parallel/src/SConscript

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/parallel/src/STFit.cpp

    r1932 r2247  
    9090  // replace
    9191  if ( id > -1 ) {
    92     Table t = table_(table_.col("ID") == id );
     92    Table t = table_(table_.col("ID") == id, 1 );
    9393    if (t.nrow() > 0) {
    9494      rno = t.rowNumbers(table_)[0];
     
    129129void STFit::getEntry( STFitEntry& fit, uInt id ) const
    130130{
    131   Table t = table_(table_.col("ID") == Int(id) );
     131  Table t = table_(table_.col("ID") == Int(id), 1 );
    132132  if (t.nrow() == 0 ) {
    133133    throw(AipsError("STFit::getEntry - id out of range"));
  • branches/parallel/src/STFocus.cpp

    r1587 r2247  
    106106                          && near(table_.col("MOUNT"), mount)
    107107                          && near(table_.col("XYPHASE"), xyphase)
    108                           && near(table_.col("XYPHASEOFFSET"), xyphaseoffset)
     108                          && near(table_.col("XYPHASEOFFSET"), xyphaseoffset), 1
    109109                          );
    110110  uInt resultid = 0;
     
    139139                                uInt id) const
    140140{
    141   Table t = table_(table_.col("ID") == Int(id) );
     141  Table t = table_(table_.col("ID") == Int(id), 1 );
    142142  if (t.nrow() == 0 ) {
    143143    throw(AipsError("STFocus::getEntry - id out of range"));
     
    161161{
    162162  Float total = 0.0f;
    163   Table t = table_(table_.col("ID") == Int(id) );
     163  Table t = table_(table_.col("ID") == Int(id), 1 );
    164164  if (t.nrow() == 0 ) {
    165165    throw(AipsError("STFocus::getTotalAngle - id out of range"));
     
    181181casa::Float STFocus::getFeedHand( casa::uInt id ) const
    182182{
    183   Table t = table_(table_.col("ID") == Int(id) );
     183  Table t = table_(table_.col("ID") == Int(id), 1 );
    184184  if (t.nrow() == 0 ) {
    185185    throw(AipsError("STFocus::getEntry - id out of range"));
  • branches/parallel/src/STFrequencies.cpp

    r1819 r2247  
    8888  // test if this already exists
    8989  Table result = table_( near(table_.col("REFVAL"), refval)
    90                     && near(table_.col("REFPIX"), refpix)
    91                     && near(table_.col("INCREMENT"), inc) );
     90                         && near(table_.col("REFPIX"), refpix)
     91                         && near(table_.col("INCREMENT"), inc), 1 );
    9292  uInt resultid = 0;
    9393  if ( result.nrow() > 0) {
     
    116116                              uInt id )
    117117{
    118   Table t = table_(table_.col("ID") == Int(id) );
     118  Table t = table_(table_.col("ID") == Int(id), 1 );
    119119  if (t.nrow() == 0 ) {
    120120    throw(AipsError("STFrequencies::getEntry - freqID out of range"));
     
    130130void STFrequencies::setEntry( Double refpix, Double refval, Double inc, uInt id )
    131131{
    132   Table t = table_(table_.col("ID") == Int(id) );
     132  Table t = table_(table_.col("ID") == Int(id), 1 );
    133133  if (t.nrow() == 0 ) {
    134134    throw(AipsError("STFrequencies::getEntry - freqID out of range"));
     
    147147SpectralCoordinate STFrequencies::getSpectralCoordinate( uInt id ) const
    148148{
    149   Table t = table_(table_.col("ID") == Int(id) );
     149  Table t = table_(table_.col("ID") == Int(id), 1 );
    150150
    151151  if (t.nrow() == 0 ) {
     
    309309  ostringstream oss;
    310310  if ( id < 0 ) t = table_;
    311   else  t = table_(table_.col("ID") == Int(id) );
     311  else  t = table_(table_.col("ID") == Int(id), 1 );
    312312  ROTableRow row(t);
    313313  for (uInt i=0; i<t.nrow(); ++i) {
     
    337337float STFrequencies::getRefFreq( uInt id, uInt channel )
    338338{
    339   Table t = table_(table_.col("ID") == Int(id) );
     339  Table t = table_(table_.col("ID") == Int(id), 1 );
    340340  if ( t.nrow() == 0 ) throw(AipsError("Selected Illegal frequency id"));
    341341  ROTableRow row(t);
     
    441441void STFrequencies::shiftRefPix(int npix, uInt id)
    442442{
    443   Table t = table_(table_.col("ID") == Int(id) );
     443  Table t = table_(table_.col("ID") == Int(id), 1 );
    444444  if ( t.nrow() == 0 ) throw(AipsError("Selected Illegal frequency id"));
    445445  ScalarColumn<Double> tcol(t, "REFPIX");
  • branches/parallel/src/STHistory.cpp

    r860 r2247  
    7171void asap::STHistory::getEntry( String& item, uInt id)
    7272{
    73   Table t = table_(table_.col("ID") == Int(id) );
     73  Table t = table_(table_.col("ID") == Int(id), 1 );
    7474  if (t.nrow() == 0 ) {
    7575    throw(AipsError("STHistory::getEntry - id out of range"));
  • branches/parallel/src/STMolecules.cpp

    r1819 r2247  
    108108  Table result =
    109109    table_( nelements(table_.col("RESTFREQUENCY")) == uInt (restfreq.size()) &&
    110             all(table_.col("RESTFREQUENCY")== restfreq) );
     110            all(table_.col("RESTFREQUENCY")== restfreq), 1 );
    111111  uInt resultid = 0;
    112112  if ( result.nrow() > 0) {
     
    152152                            Vector<String>& formattedname, uInt id ) const
    153153{
    154   Table t = table_(table_.col("ID") == Int(id) );
     154  Table t = table_(table_.col("ID") == Int(id), 1 );
    155155  if (t.nrow() == 0 ) {
    156156    throw(AipsError("STMolecules::getEntry - id out of range"));
     
    182182{
    183183  std::vector<double> out;
    184   Table t = table_(table_.col("ID") == Int(id) );
     184  Table t = table_(table_.col("ID") == Int(id), 1 );
    185185  if (t.nrow() == 0 ) {
    186186    throw(AipsError("STMolecules::getRestFrequency - id out of range"));
  • branches/parallel/src/STWeather.cpp

    r1481 r2247  
    110110                          uInt id ) const
    111111{
    112   Table t = table_(table_.col("ID") == Int(id) );
     112  Table t = table_(table_.col("ID") == Int(id), 1 );
    113113  if (t.nrow() == 0 ) {
    114114    throw(AipsError("STWeather::getEntry - id out of range"));
Note: See TracChangeset for help on using the changeset viewer.