Commits

Kumar Golap authored 690bca1d3ad
Some chunking change

casa5/code/synthesis/ImagerObjects/test/tAWProjectCube.cc

Modified
1 1 /*
2 2 * tSynthesisImager.cc
3 3 *SynthesisImager.cc: test of SynthesisImager
4 -//# Copyright (C) 2013
4 +//# Copyright (C) 2021
5 5 //# Associated Universities, Inc. Washington DC, USA.
6 6 //#
7 7 //# This program is free software; you can redistribute it and/or modify it
8 8 //# under the terms of the GNU General Public License as published by the Free
9 9 //# Software Foundation; either version 2 of the License, or (at your option)
10 10 //# any later version.
11 11 //#
12 12 //# This program is distributed in the hope that it will be useful, but WITHOUT
13 13 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 14 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 17 //# You should have received a copy of the GNU General Public License along
18 18 //# with this program; if not, write to the Free Software Foundation, Inc.,
19 19 //# 675 Massachusetts Ave, Cambridge, MA 02139, USA.
20 20 //#
21 21 //# Correspondence concerning AIPS++ should be addressed as follows:
22 22 //# Internet email: aips2-request@nrao.edu.
23 23 //# Postal address: AIPS++ Project Office
24 24 //# National Radio Astronomy Observatory
25 25 //# 520 Edgemont Road
26 26 //# Charlottesville, VA 22903-2475 USA
27 - * Created on: Jun 27, 2013
28 - * Author: kgolap
27 + * Created on: April 01 2021
28 + *
29 29 */
30 30
31 31
32 -
33 -
34 -
35 32 #include <casa/iostream.h>
36 33 #include <casa/aips.h>
37 34 #include <casa/Exceptions/Error.h>
38 35 #include <casa/BasicSL/String.h>
39 36 #include <casa/Containers/Block.h>
40 37 #include <measures/Measures/MRadialVelocity.h>
41 38 #include <coordinates/Coordinates/CoordinateSystem.h>
42 39 #include <casa/Logging/LogIO.h>
43 40 #include <synthesis/ImagerObjects/SynthesisImagerVi2.h>
44 41 #include <synthesis/ImagerObjects/SynthesisUtilMethods.h>
193 190 CountedPtr<ImageInterface<Float> > psf=si->psf();
194 191 CountedPtr<ImageInterface<Float> > wgt=si->weight();
195 192 CountedPtr<ImageInterface<Float> > sumwt=si->sumwt();
196 193 CountedPtr<ImageInterface<Float> > mod=si->model();
197 194 CountedPtr<ImageInterface<Float> > restor=si->image();
198 195 CountedPtr<ImageInterface<Float> > pb=si->pb();
199 196 /////Imaging a channel at a time
200 197 ////you could do a chunk at a time if memory allows
201 198
202 199 {
203 -
204 - for (Int k=0; k < nchan; ++k){
205 -
200 + Int chunksize=4;
201 + for (Int k=0; k < nchan/chunksize; ++k){
202 + Int startchan=k*chunksize;
203 + Int endchan=k*chunksize+chunksize-1;
206 204
207 - std::shared_ptr<ImageInterface<Float> >subresid(SpectralImageUtil::getChannel(*resid, k, k, true));
208 - std::shared_ptr<ImageInterface<Float> >subpsf(SpectralImageUtil::getChannel(*psf, k, k, true));
209 - std::shared_ptr<ImageInterface<Float> > subwgt(SpectralImageUtil::getChannel(*wgt, k, k, true));
210 - std::shared_ptr<ImageInterface<Float> > subsumwt(SpectralImageUtil::getChannel(*sumwt, k, k, true));
211 - std::shared_ptr<ImageInterface<Float> > submod( SpectralImageUtil::getChannel(*mod, k, k, true));
212 - std::shared_ptr<ImageInterface<Float> > subrestor(SpectralImageUtil::getChannel(*restor, k, k, true));
213 - std::shared_ptr<ImageInterface<Float> > subpb(SpectralImageUtil::getChannel(*pb, k, k, true));
205 + std::shared_ptr<ImageInterface<Float> >subresid(SpectralImageUtil::getChannel(*resid, startchan, endchan, true));
206 + std::shared_ptr<ImageInterface<Float> >subpsf(SpectralImageUtil::getChannel(*psf, startchan, endchan, true));
207 + std::shared_ptr<ImageInterface<Float> > subwgt(SpectralImageUtil::getChannel(*wgt, startchan, endchan, true));
208 + std::shared_ptr<ImageInterface<Float> > subsumwt(SpectralImageUtil::getChannel(*sumwt, startchan, endchan, true));
209 + std::shared_ptr<ImageInterface<Float> > submod( SpectralImageUtil::getChannel(*mod, startchan, endchan, true));
210 + std::shared_ptr<ImageInterface<Float> > subrestor(SpectralImageUtil::getChannel(*restor, startchan, endchan, true));
211 + std::shared_ptr<ImageInterface<Float> > subpb(SpectralImageUtil::getChannel(*pb, startchan, endchan, true));
214 212 /*
215 213 std::shared_ptr<ImageInterface<Float> >subresid=std::make_shared<SubImage<Float> >(SpectralImageUtil::getChannel(*resid, k, k, true));
216 214
217 215 std::shared_ptr<ImageInterface<Float> >subpsf= std::make_shared<SubImage<Float> >(SpectralImageUtil::getChannel(*psf, k, k, true));
218 216 std::shared_ptr<ImageInterface<Float> > subwgt= std::make_shared<SubImage<Float> >(SpectralImageUtil::getChannel(*wgt, k, k, true));
219 217 std::shared_ptr<ImageInterface<Float> > subsumwt= std::make_shared<SubImage<Float> >(SpectralImageUtil::getChannel(*sumwt, k, k, true));
220 218 std::shared_ptr<ImageInterface<Float> > submod=std::make_shared<SubImage<Float> >( SpectralImageUtil::getChannel(*mod, k, k, true));
221 219 std::shared_ptr<ImageInterface<Float> > subrestor= std::make_shared<SubImage<Float> >(SpectralImageUtil::getChannel(*restor, k, k, true));
222 220 */
223 221 CountedPtr<SIImageStore> subImStor=new SimpleSIImageStore(submod, subresid, subpsf, subwgt, subrestor, nullptr, subsumwt, nullptr, subpb, nullptr, nullptr, true);

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut