|
30 | 30 | #include <libracore/MakeComponents.h> |
31 | 31 |
|
32 | 32 | #include <coyote.h> |
33 | | - |
34 | | -// |
35 | | -//-------------------------------------------------------------------------- |
36 | | -// |
37 | | -PagedImage<Complex> makeEmptySkyImage4CF(VisibilityIterator2& vi2, |
38 | | - const MeasurementSet& selectedMS, |
39 | | - MSSelection& msSelection, |
40 | | - const String& imageName, |
41 | | - const Vector<Int>& imSize, const float& cellSize, |
42 | | - const String& phaseCenter, const String& stokes, |
43 | | - const String& refFreq) |
44 | | -{ |
45 | | - Vector<Quantity> qCellSize(2); |
46 | | - for (int i=0;i<2;i++) |
47 | | - { |
48 | | - String qUnit("arcsec"); |
49 | | - qCellSize[i]=Quantity(cellSize, qUnit); |
50 | | - } |
51 | | - |
52 | | - int imStokes=1; |
53 | | - if (stokes=="I") imStokes=1; |
54 | | - else if (stokes=="IV") imStokes=2; |
55 | | - else if (stokes=="IQUV") imStokes=4; |
56 | | - |
57 | | - int imNChan=1; |
58 | | - |
59 | | - MDirection mphaseCenter; |
60 | | - mdFromString(mphaseCenter, phaseCenter); |
61 | | - |
62 | | - SynthesisParamsGrid gridParams; |
63 | | - SynthesisParamsImage imageParams; |
64 | | - imageParams.imageName=imageName; |
65 | | - imageParams.imsize=imSize; |
66 | | - imageParams.cellsize=qCellSize; |
67 | | - imageParams.phaseCenter = mphaseCenter; |
68 | | - imageParams.stokes=stokes; |
69 | | - imageParams.mode=String("mfs"); |
70 | | - imageParams.frame=String("LSRK"); |
71 | | - imageParams.veltype=String("radio"); |
72 | | - |
73 | | - // |
74 | | - // There are two items related to ref. freq. "reffreq" (a String) and "refFreq" (a Quantity). |
75 | | - // Set them both. |
76 | | - // |
77 | | - if (refFreq != "") |
78 | | - { |
79 | | - imageParams.reffreq=refFreq; |
80 | | - |
81 | | - // Parse the user string. It may be parse as a pure numerical |
82 | | - // value, or as a numerical value with units. |
83 | | - // If no units were provided, it is assumed to be Hz. |
84 | | - // |
85 | | - // refFreq element of the imageParams struct requires a Quantity |
86 | | - // in GHz units. We provide it as such, without understanding |
87 | | - // why it is required in these units, or even why this element |
88 | | - // is required at all (given that imageParams.reffreq also |
89 | | - // exist which takes the frequency as a string). |
90 | | - try |
91 | | - { |
92 | | - imageParams.refFreq=SynthesisUtils::makeFreqQuantity(refFreq,"GHz"); |
93 | | - } |
94 | | - catch (AipsError& e) |
95 | | - { |
96 | | - string msg("reffreq setting: "); msg+=e.what(); |
97 | | - throw(AipsError(msg)); |
98 | | - } |
99 | | - } |
100 | | - |
101 | | - casacore::Block<const casacore::MeasurementSet *> msList(1); msList[0]=&selectedMS; |
102 | | - CoordinateSystem csys = imageParams.buildCoordinateSystem(vi2,makeTheChanSelMap(msSelection),msList); |
103 | | - IPosition imshape(4,imSize(0),imSize(1),imStokes,imNChan); |
104 | | - return PagedImage<Complex>(imshape, csys, imageParams.imageName); |
105 | | -} |
106 | 33 | // |
107 | 34 | //-------------------------------------------------------------------------- |
108 | 35 | // |
@@ -343,18 +270,22 @@ void Coyote(//bool &restartUI, int &argc, char **argv, |
343 | 270 | // This is inherited from ImageInterface so should be able to pass |
344 | 271 | // an image interface object from it. |
345 | 272 | // |
346 | | - PagedImage<Complex> cgrid = |
347 | | - makeEmptySkyImage4CF(*(db.vi2_l), db.selectedMS, db.msSelection, |
348 | | - imageName, imSize, cellSize, phaseCenter, |
349 | | - stokes, refFreqStr); |
| 273 | + // PagedImage<Complex> cgrid = |
| 274 | + // makeEmptySkyImage4CF(*(db.vi2_l), db.selectedMS, db.msSelection, |
| 275 | + // imageName, imSize, cellSize, phaseCenter, |
| 276 | + // stokes, refFreqStr); |
| 277 | + TempImage<Complex> cgrid = |
| 278 | + makeEmptySkyImage(*(db.vi2_l), db.selectedMS, db.msSelection, |
| 279 | + imageName, String(""),imSize, cellSize, phaseCenter, |
| 280 | + stokes, refFreqStr,String("mfs")); |
350 | 281 | // |
351 | 282 | // Save the coordinate system in a record and make it persistent in |
352 | 283 | // the CFCache. |
353 | 284 | // |
354 | 285 | // String targetName=String(cfCacheName); |
355 | 286 | ImageInformation<Complex> imInfo(cgrid,casacore::String(cfCacheName)); |
356 | 287 | imInfo.save(); |
357 | | - cgrid.table().markForDelete(); |
| 288 | + // cgrid.table().markForDelete(); |
358 | 289 |
|
359 | 290 | //------------------------------------------------------------------------------------------------- |
360 | 291 |
|
|
0 commit comments