00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef SYNTHESIS_IMAGER_H
00028 #define SYNTHESIS_IMAGER_H
00029
00030 #include <casa/aips.h>
00031 #include <casa/OS/Timer.h>
00032 #include <casa/Containers/Record.h>
00033 #include <ms/MeasurementSets/MeasurementSet.h>
00034 #include <casa/Arrays/IPosition.h>
00035 #include <casa/Quanta/Quantum.h>
00036 #include <components/ComponentModels/ConstantSpectrum.h>
00037
00038 #include <measures/Measures/MDirection.h>
00039 #include <components/ComponentModels/FluxStandard.h>
00040
00041 #include <measures/Measures/MPosition.h>
00042 #include <measures/Measures/MRadialVelocity.h>
00043
00044 #include <synthesis/TransformMachines/FTMachine.h>
00045 #include <synthesis/TransformMachines/StokesImageUtil.h>
00046
00047 #include <synthesis/MeasurementComponents/CleanImageSkyModel.h>
00048 #include <synthesis/TransformMachines/EVLAAperture.h>
00049 #include <synthesis/TransformMachines/BeamSquint.h>
00050 #include <synthesis/MeasurementComponents/WFCleanImageSkyModel.h>
00051 #include <synthesis/MeasurementComponents/ClarkCleanImageSkyModel.h>
00052 #include <synthesis/MeasurementEquations/SkyEquation.h>
00053 #include <synthesis/TransformMachines/ATerm.h>
00054 #include <graphics/GenericPlotter/SimplePlotter.h>
00055
00056
00057 namespace casa {
00058
00059
00060 class VisSet;
00061 class VisImagingWeight_p;
00062 class MSHistoryHandler;
00063 class PBMath;
00064 class MeasurementSet;
00065 class MDirection;
00066 class MFrequency;
00067 class File;
00068 class VPSkyJones;
00069 class EPJones;
00070 class ViewerProxy;
00071 template<class T> class ImageInterface;
00072
00073
00074
00075
00076 class Imager
00077 {
00078 public:
00079
00080
00081 Imager();
00082
00083 Imager(MeasurementSet& ms, Bool compress=False, Bool useModel=False);
00084 Imager(MeasurementSet& ms, Bool compress=False);
00085
00086
00087 Imager(const Imager&);
00088 Imager& operator=(const Imager&);
00089
00090
00091 virtual ~Imager();
00092
00093
00094 virtual Bool openSubTables();
00095
00096
00097
00098 virtual Bool lock();
00099
00100
00101 virtual Bool unlock();
00102
00103
00104
00105
00106 Bool selectDataChannel(Vector<Int>& spectralwindowids,
00107 String& dataMode,
00108 Vector<Int>& dataNchan,
00109 Vector<Int>& dataStart, Vector<Int>& dataStep,
00110 MRadialVelocity& mDataStart,
00111 MRadialVelocity& mDataStep);
00112
00113
00114 virtual Bool checkCoord(const CoordinateSystem& coordsys,
00115 const String& imageName);
00116
00117 virtual void setImageParam(Int& nx, Int& ny, Int& npol, Int& nchan);
00118
00119
00120 virtual void makeVisSet(MeasurementSet& ms,
00121 Bool compress=False, Bool mosaicOrder=False);
00122
00123
00124
00125
00126 virtual void writeHistory(LogIO& os);
00127
00128 virtual void writeCommand(LogIO& os);
00129
00130
00131 Bool makeEmptyImage(CoordinateSystem& imageCoord, String& name, Int fieldID=0);
00132
00133
00134 Bool makePBImage(ImageInterface<Float>& pbImage,
00135 Bool useSymmetricBeam=True);
00136 Bool makePBImage(const CoordinateSystem& imageCoord,
00137 const String& telescopeName, const String& diskPBName,
00138 Bool useSymmetricBeam=True, Double dishdiam=-1.0);
00139
00140 Bool makePBImage(const CoordinateSystem& imageCoord,
00141 const Table& vpTable, const String& diskPBName);
00142
00143 Bool makePBImage(const Table& vpTable, ImageInterface<Float>& pbImage);
00144
00145 Bool makePBImage(const CoordinateSystem& imageCoord, PBMath& pbMath, const String& diskPBName);
00146
00147 Bool makePBImage(PBMath& pbMath, ImageInterface<Float>& pbImage);
00148
00149 void setObsInfo(ObsInfo& obsinfo);
00150 ObsInfo& latestObsInfo();
00151
00152
00153
00154 Bool open(MeasurementSet &thems, Bool compress=False, Bool useModel=False);
00155
00156
00157
00158 Bool close();
00159
00160
00161 String name() const;
00162
00163
00164
00165
00166 virtual Bool setimage(const Int nx, const Int ny,
00167 const Quantity& cellx, const Quantity& celly,
00168 const String& stokes,
00169 Bool doShift,
00170 const MDirection& phaseCenter,
00171 const Quantity& shiftx, const Quantity& shifty,
00172 const String& mode, const Int nchan,
00173 const Int start, const Int step,
00174 const MRadialVelocity& mStart, const MRadialVelocity& mStep,
00175 const Vector<Int>& spectralwindowids, const Int fieldid,
00176 const Int facets, const Quantity& distance);
00177
00178 virtual Bool defineImage(const Int nx, const Int ny,
00179 const Quantity& cellx, const Quantity& celly,
00180 const String& stokes,
00181 const MDirection& phaseCenter,
00182 const Int fieldid,
00183 const String& mode, const Int nchan,
00184 const Int start, const Int step,
00185 const MFrequency& mFreqStart,
00186 const MRadialVelocity& mStart,
00187 const Quantity& qStep,
00188 const Vector<Int>& spectralwindowids,
00189 const Int facets=1,
00190 const Quantity& restFreq=Quantity(0,"Hz"),
00191 const MFrequency::Types& mFreqFrame=MFrequency::LSRK,
00192 const Quantity& distance=Quantity(0,"m"),
00193 const Bool trackSource=False, const MDirection&
00194 trackDir=MDirection(Quantity(0.0, "deg"),
00195 Quantity(90.0, "deg")));
00196
00197
00198
00199
00200 virtual Bool setDataPerMS(const String& msname, const String& mode,
00201 const Vector<Int>& nchan,
00202 const Vector<Int>& start,
00203 const Vector<Int>& step,
00204 const Vector<Int>& spectralwindowids,
00205 const Vector<Int>& fieldid,
00206 const String& msSelect="",
00207 const String& timerng="",
00208 const String& fieldnames="",
00209 const Vector<Int>& antIndex=Vector<Int>(),
00210 const String& antnames="",
00211 const String& spwstring="",
00212 const String& uvdist="",
00213 const String& scan="",
00214 const String& intent="",
00215 const String& obs="",
00216 const Bool useModelCol=False,
00217 const Bool readonly=False);
00218
00219
00220
00221
00222 Bool setdata(const String& mode, const Vector<Int>& nchan,
00223 const Vector<Int>& start,
00224 const Vector<Int>& step, const MRadialVelocity& mStart,
00225 const MRadialVelocity& mStep,
00226 const Vector<Int>& spectralwindowids,
00227 const Vector<Int>& fieldid,
00228 const String& msSelect="",
00229 const String& timerng="",
00230 const String& fieldnames="",
00231 const Vector<Int>& antIndex=Vector<Int>(),
00232 const String& antnames="",
00233 const String& spwstring="",
00234 const String& uvdist="",
00235 const String& scan="",
00236 const String& intent="",
00237 const String& obs="",
00238 const Bool usemodelCol=False,
00239 const Bool be_calm=false);
00240
00241
00242 Bool setoptions(const String& ftmachine, const Long cache, const Int tile,
00243 const String& gridfunction, const MPosition& mLocation,
00244 const Float padding,
00245 const Int wprojplanes=-1,
00246 const String& epJTableName="",
00247 const Bool applyPointingOffsets=True,
00248 const Bool doPointingCorrection=True,
00249 const String& cfCacheDirName="",
00250 const Float& rotpastep=5.0,
00251 const Float& computepastep=360.0,
00252 const Float& pbLimit=5.0e-2,
00253 const String& freqinterpmethod="linear",
00254 const Int imageTileSizeInPix=0,
00255 const Bool singleprecisiononly=False,
00256 const Int numthreads=-1,
00257 const Bool psTermOn=True,
00258 const Bool aTermOn=True,
00259 const Bool mTermOn=False,
00260 const Bool wbAWP=False,
00261 const Bool conjBeams=True);
00262
00263
00264 Bool setsdoptions(const Float scale, const Float weight,
00265 const Int convsupport=-1, String pointingColToUse="DIRECTION",
00266 const Quantity truncate=Quantity(),
00267 const Quantity gwidth=Quantity(),
00268 const Quantity jwidth=Quantity(),
00269 const Float minweight=0.,
00270 const Bool clipminmax=False);
00271
00272
00273 Bool setvp(const Bool dovp,
00274 const Bool defaultVP,
00275 const String& vpTable,
00276 const Bool doSquint,
00277 const Quantity &parAngleInc,
00278 const Quantity &skyPosThreshold,
00279 String defaultTel="",
00280 const Bool verbose=true);
00281
00282
00283 Bool setscales(const String& scaleMethod,
00284 const Int inscales,
00285 const Vector<Float>& userScaleSizes);
00286
00287 Bool setSmallScaleBias(const Float inbias);
00288
00289
00290
00291 Bool settaylorterms(const Int intaylor,
00292 const Double inreffreq);
00293
00294
00295
00296
00297 Bool advise(const Bool takeAdvice, const Float amplitudeloss,
00298 const Quantity& fieldOfView,
00299 Quantity& cell, Int& npixels, Int& facets,
00300 MDirection& phaseCenter);
00301
00302
00303 Bool summary();
00304
00305
00306 String state();
00307
00308
00309
00310
00311 uInt count_visibilities(ROVisibilityIterator *rvi,
00312 const Bool unflagged_only, const Bool must_have_imwt);
00313
00314
00315 Bool imagecoordinates(CoordinateSystem& coordInfo, const Bool verbose=true);
00316
00317 Bool imagecoordinates2(CoordinateSystem& coordInfo, const Bool verbose=true);
00318
00319
00320 IPosition imageshape() const;
00321
00322
00323
00324
00325
00326 Bool weight(const String& algorithm, const String& rmode,
00327 const Quantity& noise, const Double robust,
00328 const Quantity& fieldofview, const Int npixels, const Bool multiField=False);
00329
00330
00331 Bool filter(const String& type, const Quantity& bmaj, const Quantity& bmin,
00332 const Quantity& bpa);
00333
00334
00335 Bool uvrange(const Double& uvmin, const Double& uvmax);
00336
00337
00338 Bool sensitivity(Quantity& pointsourcesens, Double& relativesens, Double& sumwt,
00339 Double& effectiveBandwidth, Double& effectiveIntegration, Int& mBaselines,
00340 Matrix<Int>& mssChanSel,
00341 Vector<Vector<Int> >& nData,
00342 Vector<Vector<Double> >& sumwtChan,
00343 Vector<Vector<Double> >& sumwtsqChan,
00344 Vector<Vector<Double> >& sumInverseVarianceChan);
00345
00346
00347
00348 Bool apparentSensitivity(Double& effSensitivity,
00349 Double& relToNat);
00350
00351
00352 Bool makeimage(const String& type, const String& imageName,
00353 const String& complexImageName="", const Bool verbose=true);
00354
00355
00356 Bool boxmask(const String& mask, const Vector<Int>& blc,
00357 const Vector<Int>& trc,const Float value);
00358
00359
00360
00361
00362
00363
00364 Bool regionmask(const String& maskimage, Record* imageRegRec,
00365 Matrix<Quantity>& blctrcs, Matrix<Float>& circles,
00366 const Float& value=1.0);
00367
00368 static Bool regionToImageMask(const String& maskimage, Record* imageRegRec,
00369 Matrix<Quantity>& blctrcs,
00370 Matrix<Float>& circles,
00371 const Float& value=1.0);
00372
00373 Bool clipimage(const String& image, const Quantity& threshold);
00374
00375
00376 static Bool mask(const String& mask, const String& imageName,
00377 const Quantity& threshold);
00378
00379
00380 Bool restore(const Vector<String>& model, const String& complist,
00381 const Vector<String>& image, const Vector<String>& residual);
00382
00383
00384
00385
00386 Bool updateresidual(const Vector<String>& model, const String& complist,
00387 const Vector<String>& image, const Vector<String>& residual);
00388
00389
00390 Bool setbeam(const ImageBeamSet& beam);
00391
00392
00393 Bool residual(const Vector<String>& model, const String& complist,
00394 const Vector<String>& image);
00395
00396
00397 Bool approximatepsf(const String& psf);
00398
00399
00400 Bool smooth(const Vector<String>& model,
00401 const Vector<String>& image, Bool usefit,
00402 ImageBeamSet& mbeam,
00403 Bool normalizeVolume);
00404
00405
00406 Record clean(const String& algorithm,
00407 const Int niter,
00408 const Float gain,
00409 const Quantity& threshold,
00410 const Bool displayProgress,
00411 const Vector<String>& model, const Vector<Bool>& fixed,
00412 const String& complist,
00413 const Vector<String>& mask,
00414 const Vector<String>& restored,
00415 const Vector<String>& residual,
00416 const Vector<String>& psf=Vector<String>(0),
00417 const Bool firstrun=true);
00418
00419 Record iClean(const String& algorithm,
00420 const Int niter,
00421 const Double gain,
00422
00423 const Quantity& threshold,
00424 const Bool displayprogress,
00425 const Vector<String>& model,
00426 const Vector<Bool>& keepfixed, const String& complist,
00427 const Vector<String>& mask,
00428 const Vector<String>& image,
00429 const Vector<String>& residual,
00430 const Vector<String>& psfnames,
00431 const Bool interactive, const Int npercycle,
00432 const String& masktemplate);
00433
00434
00435 Bool mem(const String& algorithm,
00436 const Int niter, const Quantity& sigma,
00437 const Quantity& targetflux,
00438 const Bool constrainflux,
00439 const Bool displayProgress,
00440 const Vector<String>& model, const Vector<Bool>& fixed,
00441 const String& complist,
00442 const Vector<String>& prior,
00443 const Vector<String>& mask,
00444 const Vector<String>& restored,
00445 const Vector<String>& residual);
00446
00447
00448 Bool pixon(const String& algorithm,
00449 const Quantity& sigma,
00450 const String& model);
00451
00452
00453 Bool nnls(const String& algorithm, const Int niter, const Float tolerance,
00454 const Vector<String>& model, const Vector<Bool>& fixed,
00455 const String& complist,
00456 const Vector<String>& fluxMask, const Vector<String>& dataMask,
00457 const Vector<String>& restored,
00458 const Vector<String>& residual);
00459
00460
00461
00462
00463 Bool setmfcontrol(const Float cyclefactor,
00464 const Float cyclespeedup,
00465 const Float cyclemaxpsffraction,
00466 const Int stoplargenegatives,
00467 const Int stoppointmode,
00468 const String& scaleType,
00469 const Float minPB,
00470 const Float constPB,
00471 const Vector<String>& fluxscale,
00472 const Bool flatnoise=True);
00473
00474
00475 Bool feather(const String& image,
00476 const String& highres,
00477 const String& lowres,
00478 const String& lowpsf, const Float dishDiam=-1.0, const Bool lowPassFilterSD=False);
00479
00480
00481 Bool pb(const String& inimage,
00482 const String& outimage,
00483 const String& incomps,
00484 const String& outcomps,
00485 const String& operation,
00486 const MDirection& pointngCenter,
00487 const Quantity& pa,
00488 const String& pborvp);
00489
00490
00491 Bool linearmosaic(const String& mosaic,
00492 const String& fluxscale,
00493 const String& sensitivity,
00494 const Vector<String>& images,
00495 const Vector<Int>& fieldids);
00496
00497
00498
00499 Bool ft(const Vector<String>& model, const String& complist,
00500 Bool incremental=False);
00501
00502
00503 Bool setjy(const Int fieldid, const Int spectralwindowid,
00504 const Vector<Double>& fluxDensity, const String& standard);
00505 Bool setjy(const Vector<Int>& fieldid, const Vector<Int>& spectralwindowid,
00506 const String& fieldnames, const String& spwstring,
00507 const Vector<Double>& fluxDensity, const String& standard);
00508
00509
00510
00511
00512
00513 Record setjy(const Vector<Int>& fieldid,
00514 const Vector<Int>& spectralwindowid,
00515 const String& fieldnames, const String& spwstring,
00516 const String& model,
00517 const Vector<Double>& fluxDensity, const String& standard,
00518 const Bool chanDep=False,
00519 const Vector<Double>& spix=Vector<Double>(),
00520 const MFrequency& reffreq=MFrequency(Quantity(1.0, "GHz"),
00521 MFrequency::LSRK),
00522 const Vector<Double>& pipars=Vector<Double>(),
00523 const Vector<Double>& papars=Vector<Double>(),
00524 const Double& rotMeas=0.0,
00525 const String& timerange="", const String& scanstr="",
00526 const String& intentstr="", const String& obsidstr="",
00527 const String& interpolation="nearest");
00528
00529
00530 Bool make(const String& model);
00531
00532
00533
00534
00535 Bool makemodelfromsd(const String& sdImage, const String& modelimage,
00536 const String& lowPSF,
00537 String& maskImage);
00538
00539
00540
00541 String make_comp(const String& objName, const String& standard,
00542 const MEpoch& mtime, const Vector<MFrequency>& freqv,
00543 const String& prefix);
00544
00545
00546 static Bool clone(const String& imageName, const String& newImageName);
00547
00548
00549 Bool fitpsf(const String& psf, ImageBeamSet& mbeam);
00550
00551
00552 Bool correct(const Bool doparallactic, const Quantity& t);
00553
00554
00555 Bool plotuv(const Bool rotate);
00556
00557
00558 Bool plotvis(const String& type, const Int increment);
00559
00560
00561 Bool plotweights(const Bool gridded, const Int increment);
00562
00563
00564 Bool plotsummary();
00565
00566
00567 Bool clipvis(const Quantity& threshold);
00568
00569
00570
00571 Bool valid() const;
00572
00573
00574
00575
00576 Int interactivemask(const String& imagename, const String& maskname,
00577 Int& niter, Int& ncycles, String& threshold, const Bool forceReload=False);
00578
00579
00580
00581
00582 static Bool copyMask(ImageInterface<Float>& out, const ImageInterface<Float>& in, String maskname="mask0", Bool setdefault=True);
00583
00584
00585
00586
00587
00588
00589
00590 static Bool expand_blank_sel(Vector<Int>& v, const uInt nelem);
00591
00592
00593 Bool calcImFreqs(Vector<Double>& imfreqs, Vector<Double>& imfreqres,
00594 const MFrequency::Types& oldRefFrame,
00595 const MEpoch& obsEpoch, const MPosition& obsPosition,
00596 const Double& restFreq);
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609
00610 Bool adviseChanSelex(Double& freqStart, Double& freqEnd,
00611 const Double& freqStep, const MFrequency::Types& freqframe,
00612 Vector< Vector<Int> >& spw, Vector< Vector<Int> >& start,
00613 Vector< Vector<Int> >& nchan, const String& msname="",
00614 const Int fieldid=0, const Bool getFreqRange=False,
00615 const String spwselection="");
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628 Bool getWeightGrid(Block<Matrix<Float> >&weightgrid, const String& type, const Vector<String>& weightImagenames=Vector<String>());
00629 Bool setWeightGrid(const Block<Matrix<Float> >& weightgrid, const String& type);
00630 String dQuantitytoString(const Quantity& dq);
00631
00632
00633
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644 virtual Bool mapExtent(const String &referenceFrame, const String &movingSource,
00645 const String &pointingColumn, Vector<Double> ¢er, Vector<Double> &blc,
00646 Vector<Double> &trc, Vector<Double> &extent);
00647
00648
00649
00650 static void transferHistory(LoggerHolder& imageLog, ROMSHistoryColumns& msHis);
00651
00652 protected:
00653
00654 CountedPtr<MeasurementSet> ms_p;
00655 CountedPtr<MSHistoryHandler> hist_p;
00656 Table antab_p;
00657 Table datadesctab_p;
00658 Table feedtab_p;
00659 Table fieldtab_p;
00660 Table obstab_p;
00661 Table pointingtab_p;
00662 Table poltab_p;
00663 Table proctab_p;
00664 Table spwtab_p;
00665 Table statetab_p;
00666 Table dopplertab_p;
00667 Table flagcmdtab_p;
00668 Table freqoffsettab_p;
00669 Table historytab_p;
00670 Table sourcetab_p;
00671 Table syscaltab_p;
00672 Table weathertab_p;
00673 Int lockCounter_p;
00674 Int nx_p, ny_p, npol_p, nchan_p;
00675 ObsInfo latestObsInfo_p;
00676
00677 Int imageTileVol_p;
00678
00679
00680
00681 String msname_p;
00682 CountedPtr<MeasurementSet> mssel_p;
00683 VisSet *vs_p;
00684 ROVisibilityIterator* rvi_p;
00685 VisibilityIterator* wvi_p;
00686 FTMachine *ft_p;
00687 ComponentFTMachine *cft_p;
00688 SkyEquation* se_p;
00689 CleanImageSkyModel* sm_p;
00690 VPSkyJones* vp_p;
00691 VPSkyJones* gvp_p;
00692
00693 Bool setimaged_p, nullSelect_p;
00694 Bool redoSkyModel_p;
00695
00696 Float rotPAStep_p, computePAStep_p, pbLimit_p;
00697 Int facets_p;
00698 Int wprojPlanes_p;
00699 Quantity mcellx_p, mcelly_p;
00700 String stokes_p;
00701 String dataMode_p;
00702 String imageMode_p;
00703 Vector<Int> dataNchan_p;
00704 Int imageNchan_p;
00705 Vector<Int> dataStart_p, dataStep_p;
00706 Int imageStart_p, imageStep_p;
00707 MRadialVelocity mDataStart_p, mImageStart_p;
00708 MRadialVelocity mDataStep_p, mImageStep_p;
00709 MFrequency mfImageStart_p, mfImageStep_p;
00710 MFrequency::Types freqFrame_p;
00711 MDirection phaseCenter_p;
00712 Quantity restFreq_p;
00713 Quantity distance_p;
00714 Bool doShift_p;
00715 Quantity shiftx_p;
00716 Quantity shifty_p;
00717 String ftmachine_p, gridfunction_p;
00718 Bool wfGridding_p;
00719 Long cache_p;
00720 Int tile_p;
00721 MPosition mLocation_p;
00722 Bool doVP_p;
00723 ImageBeamSet beam_p;
00724 Bool beamValid_p;
00725 Float padding_p;
00726 Float sdScale_p;
00727 Float sdWeight_p;
00728 Int sdConvSupport_p;
00729
00730 Quantity qtruncate_p;
00731 Quantity qgwidth_p;
00732 Quantity qjwidth_p;
00733
00734 Float minWeight_p;
00735
00736 Bool clipminmax_p;
00737
00738
00739 Float cyclefactor_p;
00740 Float cyclespeedup_p;
00741 Float cyclemaxpsffraction_p;
00742 Int stoplargenegatives_p;
00743 Int stoppointmode_p;
00744 Vector<String> fluxscale_p;
00745 String scaleType_p;
00746 Float minPB_p;
00747 Float constPB_p;
00748
00749 Vector<Int> spectralwindowids_p;
00750 Int fieldid_p;
00751
00752 Vector<Int> dataspectralwindowids_p;
00753 Vector<Int> datadescids_p;
00754 Vector<Int> datafieldids_p;
00755
00756 Cube<Int> spwchansels_p;
00757 Matrix<Double> freqrange_p;
00758 Matrix<Double> mssFreqSel_p;
00759 Matrix<Int> mssChanSel_p;
00760
00761 Int numMS_p;
00762
00763 String telescope_p;
00764 String vpTableStr_p;
00765
00766 Quantity parAngleInc_p;
00767 Quantity skyPosThreshold_p;
00768 BeamSquint::SquintType squintType_p;
00769 Bool doDefaultVP_p;
00770
00771
00772 Bool doMultiFields_p;
00773 Bool multiFields_p;
00774
00775 Bool doWideBand_p;
00776 String freqInterpMethod_p;
00777
00778 Bool flatnoise_p;
00779
00780
00781 void defaults();
00782
00783
00784 Bool detached() const;
00785
00786
00787
00788 virtual Bool createFTMachine();
00789
00790 void openSubTable (const Table & otherTable, Table & table, const TableLock & tableLock);
00791
00792 Bool removeTable(const String& tablename);
00793 Bool updateSkyModel(const Vector<String>& model,
00794 const String complist);
00795 Bool createSkyEquation(const String complist="");
00796 Bool createSkyEquation(const Vector<String>& image,
00797 const Vector<Bool>& fixed,
00798 const String complist="");
00799 Bool createSkyEquation(const Vector<String>& image,
00800 const String complist="");
00801 Bool createSkyEquation(const Vector<String>& image,
00802 const Vector<Bool>& fixed,
00803 const Vector<String>& mask,
00804 const String complist="");
00805 Bool createSkyEquation(const Vector<String>& image,
00806 const Vector<Bool>& fixed,
00807 const Vector<String>& mask,
00808 const Vector<String>& fluxMask,
00809 const String complist="");
00810 ATerm* createTelescopeATerm(MeasurementSet& ms, const Bool& isATermOn=True);
00811 void destroySkyEquation();
00812
00813
00814 Bool addResiduals(const Vector<String>& residual);
00815
00816 Bool addResidualsToSkyEquation(const Vector<String>& residual);
00817
00818
00819 Bool addMasksToSkyEquation(const Vector<String>& mask, const Vector<Bool>& fixed=Vector<Bool>(0));
00820
00821
00822
00823 Bool getRestFreq(Vector<Double>& restFreq, const Int& spw);
00824
00825 Bool restoreImages(const Vector<String>& restored, Bool modresiduals=True);
00826
00827
00828 Bool writeFluxScales(const Vector<String>& fluxScaleNames);
00829
00830
00831 Unit sjy_setup_arrs(Vector<Vector<Flux<Double> > >& returnFluxes,
00832 Vector<Vector<Flux<Double> > >& returnFluxErrs,
00833 Vector<Vector<Double> >& fluxUsed,
00834 Vector<String>& tempCLs,
00835 Vector<Vector<MFrequency> >& mfreqs,
00836 const ROMSSpWindowColumns& spwcols, const uInt nspws,
00837 const Vector<Int>& selToRawSpwIds, const Bool chanDep);
00838
00839 Bool sjy_make_visibilities(TempImage<Float> *tmodimage, LogIO& os,
00840
00841
00842
00843
00844 const Int rawspwid, const Int fldid,
00845 const String& clname, const String& timerange="",
00846 const String& scanstr="",
00847 const String& obsidstr="",
00848 const String& intentstr="",
00849 const Vector<Double>& freqofscale=Vector<Double>(0),
00850 const Vector<Double>& scale=Vector<Double>(0) );
00851
00852 Bool sjy_concatComponentLists(LogIO& os, const Vector<String>& tempCLs, const String& outTempCL);
00853
00854 Bool sjy_computeFlux(LogIO& os, FluxStandard& fluxStd,
00855 Vector<Vector<Flux<Double> > >& returnFluxes,
00856 Vector<Vector<Flux<Double> > >& returnFluxErrs,
00857 Vector<String>& tempCLs,
00858
00859 Vector<Vector<Double> >& fluxUsed,
00860 String& fluxScaleName, MEpoch& aveEpoch,
00861 const Vector<Vector<MFrequency> >& mfreqs,
00862 const String& model, const String& fieldName,
00863 const ROMSColumns& msc, const Int fldid,
00864 const MDirection& fieldDir, const Vector<Int>& selToRawSpwIds,
00865 const String& standard);
00866
00867 void sjy_makeComponentList(LogIO& os, Vector<String>& tempCLs,
00868 Vector<Vector<Flux<Double> > >& returnFluxes,
00869 const Vector<Double>& fluxUsed,
00870 const Vector<Int>& selToRawSpwIds,
00871 const Vector<Vector<MFrequency> >& mfreqs,
00872 const String& fieldName,
00873 const MDirection& fieldDir,
00874 const Vector<Double>& spix,
00875 const Vector<Double>& pipars,
00876 const Vector<Double>& papars,
00877 const Double& rotMeas,
00878
00879 const MFrequency& reffreq,
00880 const MEpoch& aveEpoch,
00881 const Int fldId);
00882
00883
00884 TempImage<Float>* sjy_prepImage(LogIO& os, FluxStandard& fluxStd,
00885 Vector<Double>& fluxUsed,
00886 Vector<Double>& freq,
00887 Vector<Double>& scale, const String& model,
00888 const ROMSSpWindowColumns& spwcols,
00889
00890 const Vector<Int> rawspwids, const Bool chanDep,
00891 const Vector<Vector<MFrequency> >& mfreqs,
00892
00893 const String& fieldName,
00894 const MDirection& fieldDir, const Unit& freqUnit,
00895 const Vector<Double>& fluxdens,
00896 const Bool precompute,
00897
00898 const Vector<Double>& spix,
00899 const MFrequency& reffreq,
00900 const MEpoch& aveEpoch, const Int fieldId);
00901
00902 Bool sjy_regridCubeChans(TempImage<Float>* tmodimage,
00903 PagedImage<Float>& modimage, Int freqAxis);
00904
00905
00906
00907 Bool sjy_setRadiusLimit(TempImage<Float>* tmodimage,
00908 PagedImage<Float>& modimage, const String& model,
00909 DirectionCoordinate& dircsys);
00910
00911 Bool sjy_calciflux(const Vector<MFrequency>& freqs, const MFrequency& reffreq,
00912 const Double refflux, const Vector<Double>& vspix, Vector<Double>& iflux);
00913
00914 Bool sjy_calcquflux(const Vector<Double>& pipars, const Vector<Double>& papars,
00915 const Vector<Double>& iflux, const Double rotMeas,
00916 const Vector<MFrequency>& freqs,
00917 const MFrequency& reffreq, Vector<Double>& qflux,
00918 Vector<Double>& uflux);
00919
00920 String imageName();
00921
00922 Bool pbguts(ImageInterface<Float>& in,
00923 ImageInterface<Float>& out,
00924 const MDirection&,
00925 const Quantity&);
00926
00927
00928
00929 void printbeam(CleanImageSkyModel *sm_p, LogIO &os, const Bool firstrun=true);
00930
00931
00932
00933 String tangentPoint();
00934
00935
00936 Bool assertDefinedImageParameters() const;
00937
00938
00939
00940
00941 virtual void setWFCleanImageSkyModel()
00942 {sm_p = new WFCleanImageSkyModel(facets_p, wfGridding_p); return;};
00943
00944 virtual void setClarkCleanImageSkyModel()
00945 {sm_p = new ClarkCleanImageSkyModel(); return;};
00946 virtual void setSkyEquation();
00947
00948 virtual void savePSF(const Vector<String>& psf);
00949
00950 String frmtTime(const Double time);
00951
00952
00953 static Bool regionToMask(ImageInterface<Float>& maskImage, ImageRegion& imagreg, const Float& value=1.0);
00954
00955
00956 virtual void setMosaicFTMachine(Bool useDoublePrec=False);
00957
00958
00959
00960 String makeComponentList(const String& fieldName, const Int spwid,
00961 const Flux<Double>& fluxval,
00962 const ComponentShape& cmp,
00963 const ConstantSpectrum& cspectrum) const;
00964
00965 Vector<Int> decideNPolPlanes(Bool checkwithMS);
00966
00967
00968 Bool nonDefaultLocation();
00969
00970
00971 Bool getMapExtent(const MeasurementSet &ms,
00972 const String &referenceFrame, const String &movingSource,
00973 const String &pointingColumn, Vector<Double> ¢er, Vector<Double> &blc,
00974 Vector<Double> &trc, Vector<Double> &extent);
00975
00976 ComponentList* componentList_p;
00977
00978 String scaleMethod_p;
00979 Int nscales_p;
00980 Int ntaylor_p;
00981 Double reffreq_p;
00982 Bool useNewMTFT_p;
00983 Vector<Float> userScaleSizes_p;
00984 Bool scaleInfoValid_p;
00985 Float smallScaleBias_p;
00986 Int nmodels_p;
00987
00988
00989 Block<CountedPtr<PagedImage<Float> > > images_p;
00990 Block<CountedPtr<PagedImage<Float> > > masks_p;
00991 Block<CountedPtr<PagedImage<Float> > > fluxMasks_p;
00992 Block<CountedPtr<PagedImage<Float> > > residuals_p;
00993
00994
00995 Bool freqFrameValid_p;
00996
00997
00998 StokesImageUtil::PolRep polRep_p;
00999
01000
01001 Bool useModelCol_p;
01002
01003
01004 Bool singlePrec_p;
01005
01006 LogSink logSink_p;
01007
01008
01009
01010
01011
01012 EPJones *epJ;
01013 String epJTableName_p, cfCacheDirName_p;
01014 Bool doPointing, doPBCorr, psTermOn_p, aTermOn_p, mTermOn_p, wbAWP_p, conjBeams_p;
01015
01016 Record interactiveState_p;
01017
01018
01019 Bool doTrackSource_p;
01020 MDirection trackDir_p;
01021 String pointingDirCol_p;
01022 VisImagingWeight imwgt_p;
01023
01024
01025 ViewerProxy *viewer_p;
01026 int clean_panel_p;
01027 int image_id_p;
01028 int mask_id_p;
01029 int prev_image_id_p;
01030 int prev_mask_id_p;
01031
01032 Int numthreads_p;
01033 Bool avoidTempLatt_p;
01034 };
01035
01036
01037 }
01038
01039 #endif