// // C++ Interface: STGrid // // Description: // // // Author: Takeshi Nakazato , (C) 2011 // // Copyright: See COPYING file that comes with this distribution // // #ifndef ASAPSTGRID_H #define ASAPSTGRID_H #include #include #include #include #include #include #include #include #include #include #include //#include // #include // #include "Scantable.h" using namespace std ; using namespace casa ; namespace asap { class STGrid { public: STGrid() ; STGrid( const string infile ) ; virtual ~STGrid() {} ; void setFileIn( const string infile ) ; void setIF( unsigned int ifno ) { ifno_ = ifno ; } ; void setPolList( vector pols ) ; void setScanList( vector scans ) ; void defineImage( int nx=-1, int ny=-1, string scellx="", string scelly="", string scenter="" ) ; void setFunc( string convtype="box", int convsupport=-1 ) ; void setWeight( const string wType="uniform" ) ; void grid() ; string saveData( string outfile="" ) ; private: void init() ; // actual gridding void gridPerRow() ; void gridPerPol() ; void setupGrid() ; void setupGrid( Int &nx, Int &ny, String &cellx, String &celly, Double &xmin, Double &xmax, Double &ymin, Double &ymax, String ¢er ) ; void mapExtent( Double &xmin, Double &xmax, Double &ymin, Double &ymax ) ; void setData( Array &gdata, Array &gwgt ) ; void getDataPerPol( Array &spectra, Array &direction, Array &flagtra, Array &rflag, Array &weight ) ; void getDataPerPol( Array &spectra, Array &direction, Array &flagtra, Array &rflag, Array &weight ) ; Int getDataChunk( Array &spectra, Array &direction, Array &flagtra, Array &rflag, Array &weight ) ; Int getDataChunk( Array &spectra, Array &direction, Array &flagtra, Array &rflag, Array &weight ) ; void getWeight( Array &w, Array &tsys, Array &tint ) ; void toInt( Array &u, Array &v ) ; void toInt( Array &u, Array &v ) ; void toPixel( Array &world, Array &pixel ) ; void boxFunc( Vector &convFunc, Int &convSize ) ; void spheroidalFunc( Vector &convFunc ) ; void gaussFunc( Vector &convFunc ) ; void pbFunc( Vector &convFunc ) ; void setConvFunc( Vector &convFunc ) ; void prepareTable( Table &tab, String &name ) ; Bool pastEnd() ; void selectData() ; void setupArray() ; Bool examine() ; void attach( Table &tab ) ; void call_ggridsd( Array &xy, Array &values, Int &nvispol, Int &nvischan, Array &flag, Array &rflag, Array &weight, Int &nrow, Int &irow, Array &grid, Array &wgrid, Int &nx, Int &ny, Int &npol, Int &nchan, Int &support, Int &sampling, Vector &convFunc, Int *chanMap, Int *polMap ) ; void initPol( Int ipol ) ; Bool isMultiIF( Table &tab ) ; // user input Int nxUI_ ; Int nyUI_ ; String cellxUI_ ; String cellyUI_ ; String centerUI_ ; Block infileList_ ; Int ifno_ ; Int nx_ ; Int ny_ ; Int npol_ ; Int npolOrg_ ; Int nchan_ ; Int nrow_ ; Double cellx_ ; Double celly_ ; Vector center_ ; String convType_ ; Int convSupport_ ; Int userSupport_ ; Int convSampling_ ; Array data_ ; Vector pollist_ ; Vector scanlist_ ; String wtype_ ; Table tab_ ; Block tableList_ ; Table ptab_ ; ROArrayColumn spectraCol_ ; ROArrayColumn flagtraCol_ ; ROArrayColumn directionCol_ ; ROScalarColumn flagRowCol_ ; ROArrayColumn tsysCol_ ; ROScalarColumn intervalCol_ ; Int nprocessed_ ; Vector rows_ ; Int nchunk_ ; Array spectraF_ ; Array flagtraUC_ ; Array rflagUI_ ; }; } #endif