- Timestamp:
- 01/09/13 14:27:57 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/PlotHelper.cpp
r2717 r2718 74 74 { 75 75 LogIO os(LogOrigin("PlotHelper","getSTCoord()", WHERE)); 76 os << " Start getSTCoord()" << LogIO::POST;76 os << "Getting pointing information of the scantable." << LogIO::POST; 77 77 if (data_p->nrow() < 1) 78 78 throw AipsError("Scantable is not set. Please set a scantable first."); … … 107 107 #ifdef KS_DEBUG 108 108 {//Debug outputs 109 cout << "Generat ing a coordinate from DIRECTIONs ina scantable: " << endl;109 cout << "Generated a temporal direction coordinate of a scantable: " << endl; 110 110 Vector<String> units = coord.worldAxisUnits(); 111 111 Vector<Double> refv = coord.referenceValue(); … … 126 126 { 127 127 LogIO os(LogOrigin("PlotHelper","setGridParam()", WHERE)); 128 os << "Start setGridParam()" << LogIO::POST;129 128 // Value check of nx and ny 130 129 if (nx < 1) … … 193 192 } 194 193 194 os << "Setting grid parameters" << LogIO::POST; 195 195 // Now, define direction coordinate from input parameters (in radian) 196 196 Double incx, incy; … … 199 199 // center 200 200 if (center.empty()){ 201 os << "center is not specified. Using pointing center of the scantable." << LogIO::POST; 201 202 if (!stset) 202 203 throw AipsError("Scantable is not set. Could not resolve map center."); 203 #ifdef KS_DEBUG 204 cout << "Using pointing center from DIRECTION column" << endl; 205 #endif 204 206 205 centx = stcent.getAngle("rad").getValue()[0]; 207 206 centy = stcent.getAngle("rad").getValue()[1]; 208 207 mdt = stdt; 209 208 } else { 210 #ifdef KS_DEBUG 211 cout << "Using user defined grid center" << endl; 212 #endif 209 os << "Using user defined center" << LogIO::POST; 213 210 // Parse center string 214 211 string::size_type pos0 = center.find(" "); … … 230 227 if (!MDirection::getType(mdt,sepoch)) 231 228 throw AipsError("Invalid direction reference in center"); 232 if (stset && mdt != stdt)229 if (stset && (mdt != stdt)) 233 230 throw AipsError("Direction reference of center should be the same as input scantable"); 234 231 QuantumHolder qh ; … … 248 245 } 249 246 } 250 #ifdef KS_DEBUG 251 cout << "The center direction of plotting grids: [" << centx << ", " << centy << "] (rad)" <<endl; 252 #endif 247 os << "Grid center: ( " << centx << " rad , " << centy << " rad ) " << LogIO::POST; 253 248 254 249 // cell 255 250 if (cellx.empty() && celly.empty()){ 251 os << "cell size is not specified. Using cell size to cover all pointings in the scantable." << LogIO::POST; 256 252 if (!stset) 257 253 throw AipsError("Scantable is not set. Could not resolve cell size."); 258 #ifdef KS_DEBUG 259 cout << "Using cell size defined from DIRECTION column" << endl; 260 #endif 254 261 255 Vector<Double> centpix; 262 256 MDirection centmd = MDirection(Quantum<Double>(centx, "rad"), … … 273 267 incy = wy / max(ny - 1., 1.); 274 268 } else { 275 #ifdef KS_DEBUG 276 cout << "Using user defined cell size" << endl; 277 #endif 269 os << "Using user defined cell size" << LogIO::POST; 278 270 Quantum<Double> qcellx, qcelly; 279 271 if (!cellx.empty() && !celly.empty()){ … … 290 282 incy = qcelly.getValue("rad"); 291 283 } 292 #ifdef KS_DEBUG 293 cout << "The cell size of plotting grids: [" << incx << ", " << incy << "] (rad)" <<endl; 294 #endif 284 // inc should be negative to transpose plot 285 incx = -abs(incx); 286 incy = -abs(incy); 287 288 os << "Spacing: ( " << abs(incx) << " rad , " << abs(incy) << " rad )" <<endl; 295 289 296 290 Matrix<Double> xform(2,2) ; … … 302 296 0.5*Double(nx), 303 297 0.5*Double(ny)) ; // pixel at center 304 os << "Successfully finished generation of Direction Coordinate" << LogIO::POST; 298 {//Summary 299 os << "Successfully generated grid coordinate:" << LogIO::POST; 300 Vector<String> units = dircoord_->worldAxisUnits(); 301 Vector<Double> refv = dircoord_->referenceValue(); 302 os <<"- Reference Direction : " << MDirection::showType(dircoord_->directionType()) 303 << " " << refv[0] << units[0] << " " << refv[1] << units[1] << LogIO::POST; 304 Vector<Double> refpix = dircoord_->referencePixel(); 305 os <<"- Reference Pixel : [" << refpix[0] << ", " << refpix[1] << "]" << LogIO::POST; 306 Vector<Double> inc = dircoord_->increment(); 307 os <<"- Increments : [" << inc[0] << ", " << inc[1] << "]" << LogIO::POST; 308 os <<"- Projection Type : " << dircoord_->projection().name() << LogIO::POST; 309 } 305 310 }; 306 311 … … 309 314 const double centx, const double centy, 310 315 const string epoch, const string projname){ 316 LogIO os(LogOrigin("PlotHelper","setGridParamVal()", WHERE)); 311 317 // Value check of nx and ny 312 318 if (nx < 1) … … 343 349 // 0.5*Double(nx-1), 344 350 // 0.5*Double(ny-1)) ; // pixel at grid 345 #ifdef KS_DEBUG 346 {//Debug outputs 347 cout << "Direction coordinate is set: " << endl; 348 Vector<String> units = dircoord_->worldAxisUnits(); 349 Vector<Double> refv = dircoord_->referenceValue(); 350 cout <<"Reference: " << MDirection::showType(dircoord_->directionType()) << " " << refv[0] << units[0] << " " << refv[1] << units[1] << endl; 351 Vector<Double> refpix = dircoord_->referencePixel(); 352 cout <<"Reference Pixel: [" << refpix[0] << ", " << refpix[1] << "]" << endl; 353 Vector<Double> inc = dircoord_->increment(); 354 cout <<"Increments: [" << inc[0] << ", " << inc[1] << "]" << endl; 355 cout <<"Projection: " << dircoord_->projection().name() << endl; 356 } 357 #endif 351 {//Summary 352 os << "Successfully generated grid coordinate:" << LogIO::POST; 353 Vector<String> units = dircoord_->worldAxisUnits(); 354 Vector<Double> refv = dircoord_->referenceValue(); 355 os <<"- Reference Direction : " << MDirection::showType(dircoord_->directionType()) 356 << " " << refv[0] << units[0] << " " << refv[1] << units[1] << LogIO::POST; 357 Vector<Double> refpix = dircoord_->referencePixel(); 358 os <<"- Reference Pixel : [" << refpix[0] << ", " << refpix[1] << "]" << LogIO::POST; 359 Vector<Double> inc = dircoord_->increment(); 360 os <<"- Increments : [" << inc[0] << ", " << inc[1] << "]" << LogIO::POST; 361 os <<"- Projection Type : " << dircoord_->projection().name() << LogIO::POST; 362 } 358 363 }; 359 364
Note:
See TracChangeset
for help on using the changeset viewer.