casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Feather.h
Go to the documentation of this file.
1 //# Feather.h: Helper for feathering
2 //# Copyright (C) 1996-2012
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be adressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //#
27 //# $Id$
28 #ifndef SYNTHESIS_FEATHER_H
29 #define SYNTHESIS_FEATHER_H
30 
31 #include <casa/BasicSL/String.h>
32 #include <casa/BasicSL.h>
33 #include <casa/Quanta/Quantum.h>
36 
37 namespace casacore{
38 
39  template<class T> class ImageInterface;
40  template<class T> class Vector;
41 }
42 
43 namespace casa { //# NAMESPACE CASA - BEGIN
44  //Forward declaration
45  // <summary> Class that contains functions needed for feathering</summary>
46 
47  class Feather{
48 
49  public:
50 
51  //default constructor
52  Feather();
53  //Constructor
55  //Destructor
56  virtual ~Feather();
57 
58  //Clear the weight flags. Used when changing between the
59  //SDimage and the dirty image.
60  void clearWeightFlags();
61 
62  //set the SDimage and casacore::Int images
63  void setSDScale(casacore::Float sdscale=1.0);
66  //set and get effective dish diameter to be used in feathering function
67  //setEffectiveDishDiam will return false if you are trying to assign a finer resolution than what
68  //the original data came with
71  //Get the 1-D slices of amplitude along the x and y axis of the FFT of images
72  //if radial is set to true then the 1D slice is the the circular average rather that X and Y cuts...only the x-values are valid then
73  //Note the SD image is already feathered by its beam..you cannot get unfeathered SD data as it implies deconvolution
76  //Get the 1-D slices of the feathering function that will be applied on SD and INTerf data
77  //If normalize=false for the SD then the value for Jy/beam correction to final beam size is multiplied to
78  //the function
81  //Get 1-D slices of the feathered data ...
82  //note for SD this
83  //should return the same values as getFTCutSDImage
86  //This function convolves the INT image to the new GaussianBeam
87  //So the INT image stored in this object is going to be replaced by the new convolved image
88  void convolveINT(const casacore::GaussianBeam& newHighBeam);
89 
90  //write the feathered image to disk
98 
99 
101  static void feather(const casacore::String& image, const casacore::ImageInterface<casacore::Float>& high, const casacore::ImageInterface<casacore::Float>& low, const casacore::Float& sdScale=1.0, const casacore::String& lowPSF="", const casacore::Bool useDefault=true, const casacore::String& vpTable="" , casacore::Float effSDDiam=-1.0, const casacore::Bool lowpassfiltersd=false);
102 
103  static casacore::Double worldFreq(const casacore::CoordinateSystem& cs, casacore::Int spectralpix=0);
104 
105 
106  private:
109 
110 
111 
112 
121  //calculate the complex weight image to apply on the interf image
122  static void getLowBeam(const casacore::ImageInterface<casacore::Float>& low0, const casacore::String& lowPSF, const casacore::Bool useDefaultPB, const casacore::String& vpTableStr, casacore::GaussianBeam& lBeam);
123  void calcCWeightImage();
124  void applyFeather();
125  static void getRadialUVval(const casacore::Int npix, const casacore::IPosition& imshape, const casacore::CoordinateSystem& csys, casacore::Vector<casacore::Float>& radius);
134  };
135 
136 
137 
138 } //# NAMESPACE CASA - END
139 
140 #endif
casacore::GaussianBeam hBeam_p
Definition: Feather.h:126
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
void setSDImage(const casacore::ImageInterface< casacore::Float > &SDImage)
int Int
Definition: aipstype.h:50
std::vector< double > Vector
Definition: ds9context.h:24
casacore::Bool cweightCalced_p
Definition: Feather.h:130
Forward declaration.
Definition: Feather.h:47
casacore::CountedPtr< casacore::ImageInterface< casacore::Float > > lowIm_p
Definition: Feather.h:113
casacore::Bool cweightApplied_p
Definition: Feather.h:131
static void getRadialUVval(const casacore::Int npix, const casacore::IPosition &imshape, const casacore::CoordinateSystem &csys, casacore::Vector< casacore::Float > &radius)
static void getRadialCut(casacore::Vector< casacore::Float > &radius, casacore::Vector< casacore::Float > &radialAmp, const casacore::ImageInterface< casacore::Float > &image)
casacore::CountedPtr< casacore::ImageInterface< casacore::Complex > > cwHighIm_p
Definition: Feather.h:117
void getEffectiveDishDiam(casacore::Float &xdiam, casacore::Float &ydiam)
casacore::Float dishDiam_p
Definition: Feather.h:129
void fillXVectors(casacore::Vector< casacore::Float > &ux, casacore::Vector< casacore::Float > &uy) const
casacore::Bool saveFeatheredImage(const casacore::String &imagename)
write the feathered image to disk
void getFeatheredCutINT(casacore::Vector< casacore::Float > &ux, casacore::Vector< casacore::Float > &xamp, casacore::Vector< casacore::Float > &uy, casacore::Vector< casacore::Float > &yamp, casacore::Bool radial=false)
casacore::GaussianBeam lBeamOrig_p
Definition: Feather.h:128
Represents a Gaussian restoring beam associated with an image.
Definition: GaussianBeam.h:68
void getFeatherSD(casacore::Vector< casacore::Float > &ux, casacore::Vector< casacore::Float > &xamp, casacore::Vector< casacore::Float > &uy, casacore::Vector< casacore::Float > &yamp, casacore::Bool radial=false, casacore::Bool normalize=true)
Get the 1-D slices of the feathering function that will be applied on SD and INTerf data If normalize...
void setINTImage(const casacore::ImageInterface< casacore::Float > &IntImage)
casacore::GaussianBeam lBeam_p
Definition: Feather.h:127
Referenced counted pointer for constant data.
Definition: VisModelData.h:42
casacore::Float sdScale_p
Definition: Feather.h:132
double Double
Definition: aipstype.h:55
Feather()
default constructor
static void applyDishDiam(casacore::ImageInterface< casacore::Complex > &image, casacore::GaussianBeam &beam, casacore::Float effDiam, casacore::ImageInterface< casacore::Float > &newbeam, casacore::Vector< casacore::Quantity > &extraconv)
casacore::CoordinateSystem csysHigh_p
Definition: Feather.h:133
virtual ~Feather()
Destructor.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::CountedPtr< casacore::ImageInterface< casacore::Float > > lowImOrig_p
Definition: Feather.h:114
float Float
Definition: aipstype.h:54
static casacore::Double worldFreq(const casacore::CoordinateSystem &cs, casacore::Int spectralpix=0)
void clearWeightFlags()
Clear the weight flags.
static void getLowBeam(const casacore::ImageInterface< casacore::Float > &low0, const casacore::String &lowPSF, const casacore::Bool useDefaultPB, const casacore::String &vpTableStr, casacore::GaussianBeam &lBeam)
calculate the complex weight image to apply on the interf image
static void getCutXY(casacore::Vector< casacore::Float > &ux, casacore::Vector< casacore::Float > &xamp, casacore::Vector< casacore::Float > &uy, casacore::Vector< casacore::Float > &yamp, const casacore::ImageInterface< casacore::Float > &image)
casacore::CountedPtr< casacore::ImageInterface< casacore::Float > > highIm_p
Definition: Feather.h:115
void getFeatherINT(casacore::Vector< casacore::Float > &ux, casacore::Vector< casacore::Float > &xamp, casacore::Vector< casacore::Float > &uy, casacore::Vector< casacore::Float > &yamp, casacore::Bool radial=false)
void getFTCutSDImage(casacore::Vector< casacore::Float > &ux, casacore::Vector< casacore::Float > &xamp, casacore::Vector< casacore::Float > &uy, casacore::Vector< casacore::Float > &yamp, const casacore::Bool radial=false)
Get the 1-D slices of amplitude along the x and y axis of the FFT of images if radial is set to true ...
static void feather(const casacore::String &image, const casacore::ImageInterface< casacore::Float > &high, const casacore::ImageInterface< casacore::Float > &low, const casacore::Float &sdScale=1.0, const casacore::String &lowPSF="", const casacore::Bool useDefault=true, const casacore::String &vpTable="", casacore::Float effSDDiam=-1.0, const casacore::Bool lowpassfiltersd=false)
void applyFeather()
void getFTCutIntImage(casacore::Vector< casacore::Float > &ux, casacore::Vector< casacore::Float > &xamp, casacore::Vector< casacore::Float > &uy, casacore::Vector< casacore::Float > &yamp, casacore::Bool radial=false)
casacore::Bool setEffectiveDishDiam(const casacore::Float xdiam, const casacore::Float ydiam=-1.0)
set and get effective dish diameter to be used in feathering function setEffectiveDishDiam will retur...
void setSDScale(casacore::Float sdscale=1.0)
set the SDimage and casacore::Int images
void calcCWeightImage()
String: the storage and methods of handling collections of characters.
Definition: String.h:223
void convolveINT(const casacore::GaussianBeam &newHighBeam)
This function convolves the INT image to the new GaussianBeam So the INT image stored in this object ...
void getFeatheredCutSD(casacore::Vector< casacore::Float > &ux, casacore::Vector< casacore::Float > &xamp, casacore::Vector< casacore::Float > &uy, casacore::Vector< casacore::Float > &yamp, casacore::Bool radial=false)
Get 1-D slices of the feathered data...
casacore::CountedPtr< casacore::ImageInterface< casacore::Complex > > cwImage_p
Definition: Feather.h:116
Interconvert pixel and world coordinates.
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42