casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
RIorAParray.h
Go to the documentation of this file.
00001 //# RIorAParray.h: Definition for RI/AP on-demand converter
00002 //# Copyright (C) 2012                                     
00003 //# Associated Universities, Inc. Washington DC, USA.                                         
00004 //#                                                                                           
00005 //# This library is free software; you can redistribute it and/or modify it                   
00006 //# under the terms of the GNU Library General Public License as published by                 
00007 //# the Free Software Foundation; either version 2 of the License, or (at your                
00008 //# option) any later version.                                                                
00009 //#                                                                                           
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT               
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or                     
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public                     
00013 //# License for more details.                                                                 
00014 //#                                                                                           
00015 //# You should have received a copy of the GNU Library General Public License                 
00016 //# along with this library; if not, write to the Free Software Foundation,                   
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.                                    
00018 //#                                                                                           
00019 //# Correspondence concerning AIPS++ should be adressed as follows:                           
00020 //#        Internet email: aips2-request@nrao.edu.                                            
00021 //#        Postal address: AIPS++ Project Office                                              
00022 //#                        National Radio Astronomy Observatory                               
00023 //#                        520 Edgemont Road                                                  
00024 //#                        Charlottesville, VA 22903-2475 USA                                 
00025 //#                                                                                           
00026 //#                                                                                           
00027 
00028 #ifndef CALTABLES_RIORAPARRAY_H
00029 #define CALTABLES_RIORAPARRAY_H
00030 
00031 #include <casa/aips.h>
00032 #include <casa/BasicSL/Constants.h>
00033 #include <casa/Arrays/Array.h>
00034 #include <casa/Logging/LogMessage.h>
00035 #include <casa/Logging/LogSink.h>
00036 
00037 namespace casa { //# NAMESPACE CASA - BEGIN                                                   
00038 
00039 
00040 class RIorAPArray
00041 {
00042 public:
00043   // Construct empty
00044   RIorAPArray();
00045 
00046   // Construct from external Complex Array
00047   RIorAPArray(const Array<Complex>& c);
00048 
00049   // Construct from external Float Array
00050   RIorAPArray(const Array<Float>& f);
00051 
00052   // Destructor
00053   ~RIorAPArray();
00054 
00055   // Set data
00056   void setData(const Array<Complex>& c);
00057   void setData(const Array<Float>& f);
00058 
00059   // State
00060   void state(Bool verbose=False);
00061 
00062   // Render Complex version (calc from Float, if necessary)
00063   Array<Complex> c();
00064 
00065   // Render Float version (calc from Complex, if necessary)
00066   Array<Float> f(Bool trackphase);
00067 
00068 private:
00069 
00070   // Resize internal target arrays
00071   void resizec_();
00072   void resizef_();
00073 
00074   // Perform the actual calculation
00075   void calc_c();
00076   void calc_f(Bool trackphase);
00077 
00078   // Unwind phase
00079   void trackPhase(Array<Float>& ph);
00080 
00081   // State of Complex and Float versions
00082   Bool c_ok_, f_ok_;
00083 
00084   Bool phaseTracked_;
00085 
00086   // Internal Arrays for Complex and Float versions
00087   Array<Complex> c_;
00088   Array<Float> f_;
00089 
00090 };
00091 
00092 } //# NAMESPACE CASA - END
00093 
00094 #endif
00095