Commits
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 | |
36 33 | |
37 34 | |
38 35 | |
39 36 | |
40 37 | |
41 38 | |
42 39 | |
43 40 | |
44 41 | |
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); |