Changeset 2951


Ignore:
Timestamp:
06/23/14 20:14:08 (11 years ago)
Author:
Kana Sugimoto
Message:

New Development: No

JIRA Issue: Yes (CAS-5870)

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs: sdplot with plottype='grid' and polaverage=True

Put in Release Notes: No

Module(s): sdplot, PlotHelper

Description: Fixed a bug reported by Shinya. There was an issue in auto center and cell size resolution when scantable has only one pointing.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/PlotHelper.cpp

    r2719 r2951  
    2424#include "PlotHelper.h"
    2525
    26 //#ifndef KS_DEBUG
    27 //#define KS_DEBUG
    28 //#endif
     26#define SMALL_ANGLE 1.0e-7
     27
     28// #ifndef KS_DEBUG
     29// #define KS_DEBUG
     30// #endif
    2931
    3032using namespace std ;
     
    101103  incx = abs(xmax - xmin) / (double) nx * cos(centy);
    102104  incy = abs(ymax - ymin) / (double) ny;
     105  // Direction coordinate seems not work well with inc=0. set very small value.
     106  if (incx == 0.) incx = SMALL_ANGLE;
     107  if (incy == 0.) incy = SMALL_ANGLE;
    103108  // Generate a temporal direction coordinte
    104109  coord = DirectionCoordinate(mdt, ptype,
     
    266271    cout << "- got centpix [" << centpix[0] << ", " << centpix[1] << "]" <<endl;
    267272#endif
    268     Double wx = max( abs(stxmax-centpix[0]), abs(stxmin-centpix[0]) )
     273    // Direction coordinate seems not work well with inc=0. set very small value.
     274    Double wx = max( max( abs(stxmax-centpix[0]), abs(stxmin-centpix[0]) ), 0.5 )
    269275      * 2 * stincx.getValue("rad");
    270     Double wy = max( abs(stymax-centpix[1]), abs(stymin-centpix[1]) )
     276    Double wy = max( max( abs(stymax-centpix[1]), abs(stymin-centpix[1]) ), 0.5 )
    271277      * 2 * stincy.getValue("rad");
    272278    incx = wx / max(nx - 1., 1.);
Note: See TracChangeset for help on using the changeset viewer.