Changeset 2388 for trunk


Ignore:
Timestamp:
12/27/11 15:31:29 (12 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-2816

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): Module Names change impacts.

Description: Describe your changes here...

Introduced some parameter for user input.
setupGrid() is called within grid(), not defineImage().


Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STGrid.cpp

    r2386 r2388  
    6767  nprocessed_ = 0 ;
    6868  nchunk_ = 0 ;
     69
     70  // initialize user input
     71  nxUI_ = -1 ;
     72  nyUI_ = -1 ;
     73  cellxUI_ = "" ;
     74  cellyUI_ = "" ;
     75  centerUI_ = "" ;
    6976}
    7077
     
    7481  if ( infile_.compare( name ) != 0 ) {
    7582    infile_ = String( infile ) ;
    76     tab_ = Table( infile_ ) ;
    7783  }
    7884}
     
    100106                          string scenter )
    101107{
    102   ROArrayColumn<Double> dirCol( tab_, "DIRECTION" ) ;
    103   Matrix<Double> direction = dirCol.getColumn() ;
    104   Double rmax, rmin, dmax, dmin ;
    105   minMax( rmin, rmax, direction.row( 0 ) ) ;
    106   minMax( dmin, dmax, direction.row( 1 ) ) ;
    107 
    108   Int npx = (Int)nx ;
    109   Int npy = (Int)ny ;
    110   String cellx( scellx ) ;
    111   String celly( scelly ) ;
    112   String center( scenter ) ;
    113   setupGrid( npx, npy,
    114              cellx, celly,
    115              rmin, rmax,
    116              dmin, dmax,
    117              center ) ;
     108  nxUI_ = (Int)nx ;
     109  nyUI_ = (Int)ny ;
     110  cellxUI_ = String( scellx ) ;
     111  cellyUI_ = String( scelly ) ;
     112  centerUI_ = String( scenter ) ;
    118113}
    119114 
     
    255250  os << "selectData: elapsed time is " << t1-t0 << " sec." << LogIO::POST ;
    256251
     252  setupGrid() ;
    257253  setupArray() ;
    258254
     
    592588}
    593589
     590void STGrid::setupGrid()
     591{
     592  Double xmin,xmax,ymin,ymax ;
     593  mapExtent( xmin, xmax, ymin, ymax ) ;
     594 
     595  setupGrid( nxUI_, nyUI_, cellxUI_, cellyUI_,
     596             xmin, xmax, ymin, ymax, centerUI_ ) ;
     597}
     598
    594599void STGrid::setupGrid( Int &nx,
    595600                        Int &ny,
     
    708713    ny_ = Int( ceil( wy/celly_ ) ) ;
    709714  }
     715}
     716
     717void STGrid::mapExtent( Double &xmin, Double &xmax,
     718                        Double &ymin, Double &ymax )
     719{
     720  //LogIO os( LogOrigin("STGrid","mapExtent",WHERE) ) ;
     721  ROArrayColumn<Double> dirCol( tab_, "DIRECTION" ) ;
     722  Matrix<Double> direction = dirCol.getColumn() ;
     723  //os << "dirCol.nrow() = " << dirCol.nrow() << LogIO::POST ;
     724  minMax( xmin, xmax, direction.row( 0 ) ) ;
     725  minMax( ymin, ymax, direction.row( 1 ) ) ;
     726  //os << "(xmin,xmax)=(" << xmin << "," << xmax << ")" << LogIO::POST ;
     727  //os << "(ymin,ymax)=(" << ymin << "," << ymax << ")" << LogIO::POST ;
    710728}
    711729
  • trunk/src/STGrid.h

    r2386 r2388  
    7272  void gridPerPol() ;
    7373
     74  void setupGrid() ;
    7475  void setupGrid( Int &nx,
    7576                  Int &ny,
     
    8182                  Double &ymax,
    8283                  String &center ) ;
     84  void mapExtent( Double &xmin, Double &xmax,
     85                  Double &ymin, Double &ymax ) ;
    8386
    8487  void setData( Array<Complex> &gdata,
     
    156159
    157160
     161  // user input
     162  Int nxUI_ ;
     163  Int nyUI_ ;
     164  String cellxUI_ ;
     165  String cellyUI_ ;
     166  String centerUI_ ;
     167
    158168  String infile_ ;
    159169  Int ifno_ ;
Note: See TracChangeset for help on using the changeset viewer.