//# Copyright (C) 1998,1999,2000,2001,2003
//# Associated Universities, Inc. Washington DC, USA.
//# This program is free software; you can redistribute it and/or modify it
//# under the terms of the GNU General Public License as published by the Free
//# Software Foundation; either version 2 of the License, or (at your option)
//# This program is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
//# You should have received a copy of the GNU General Public License along
//# with this program; if not, write to the Free Software Foundation, Inc.,
//# 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: aips2-request@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# Charlottesville, VA 22903-2475 USA
#include <imageanalysis/ImageAnalysis/ImageTask.h>
#include <coordinates/Coordinates/DirectionCoordinate.h>
#include <casa/IO/FilebufIO.h>
#include <casa/OS/Directory.h>
#include <casa/OS/RegularFile.h>
#include <casa/OS/SymLink.h>
#include <images/Images/FITSImage.h>
#include <images/Images/ImageUtilities.h>
#include <images/Images/MIRIADImage.h>
#include <images/Images/PagedImage.h>
#include <images/Images/TempImage.h>
#include <tables/Tables/PlainTable.h>
#include <imageanalysis/ImageAnalysis/ImageHistory.h>
#include <imageanalysis/ImageAnalysis/ImageInputProcessor.h>
#include <imageanalysis/ImageAnalysis/ImageMask.h>
#include <imageanalysis/ImageAnalysis/SubImageFactory.h>
#include <imageanalysis/IO/LogFile.h>
#include <stdcasa/variant.h>
template <class T> ImageTask<T>::ImageTask(
const casacore::String& region, const casacore::Record *const ®ionPtr,
const casacore::String& box, const casacore::String& chanInp,
const casacore::String& stokes, const casacore::String& maskInp,
const casacore::String& outname, casacore::Bool overwrite
) : _image(image), _regionPtr(regionPtr),_region(region), _box(box),
_chan(chanInp), _stokesString(stokes), _mask(maskInp),
_outname(outname), _overwrite(overwrite), _stretch(false),
template <class T> ImageTask<T>::ImageTask(
const SPCIIT image, const casacore::Record *const ®ionPtr,
const casacore::String& mask, const casacore::String& outname,
) : _image(image), _regionPtr(regionPtr),
_region(), _box(), _chan(), _stokesString(), _mask(mask),
_outname(outname), _overwrite(overwrite) {}
template <class T> ImageTask<T>::~ImageTask() {}
template <class T> std::vector<OutputDestinationChecker::OutputStruct> ImageTask<T>::_getOutputStruct() {
std::vector<OutputDestinationChecker::OutputStruct> outputs;
if (! _outname.empty()) {
OutputDestinationChecker::OutputStruct outputImage;
outputImage.label = "output image";
outputImage.outputFile = &_outname;
outputImage.required = true;
outputImage.replaceable = _overwrite;
outputs.push_back(outputImage);
template <class T> void ImageTask<T>::_construct(casacore::Bool verbose) {
! _supportsMultipleBeams() && _image->imageInfo().hasMultipleBeams(),
"This application does not support images with multiple "
"beams. Please convolve your image with a single beam "
"and run this application using that image"
casacore::String diagnostics;