Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

lenslet_array.h

Go to the documentation of this file.
00001 /*
00002 Arroyo - software for the simulation of electromagnetic wave propagation
00003 through turbulence and optics.
00004 
00005 Copyright (c) 2000-2004 California Institute of Technology.  Written by
00006 Dr. Matthew Britton.  For comments or questions about this software,
00007 please contact the author at mbritton@astro.caltech.edu.
00008 
00009 This program is free software; you can redistribute it and/or modify it
00010 under the terms of the GNU General Public License as  published by the
00011 Free Software Foundation; either version 2 of the License, or (at your
00012 option) any later version.
00013 
00014 This program is provided "as is" and distributed in the hope that it
00015 will be useful, but WITHOUT ANY WARRANTY; without even the implied
00016 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  In no
00017 event shall California Institute of Technology be liable to any party
00018 for direct, indirect, special, incidental or consequential damages,
00019 including lost profits, arising out of the use of this software and its
00020 documentation, even if the California Institute of Technology has been
00021 advised of the possibility of such damage.   The California Institute of
00022 Technology has no obligation to provide maintenance, support, updates,
00023 enhancements or modifications.  See the GNU General Public License for
00024 more details.
00025 
00026 You should have received a copy of the GNU General Public License along
00027 with this program; if not, write to the Free Software
00028 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
00029 */
00030 
00031 #ifndef LENSLET_ARRAY_H
00032 #define LENSLET_ARRAY_H
00033 
00034 #include "optic.h"
00035 
00036 namespace Arroyo {
00037 
00038   using std::string;
00039   using std::vector;
00040   using std::ostream;
00041 
00045 
00046   class lenslet_array_base :
00047     public plane_optic,
00048     public one_to_one_optic {
00049 
00050     public:
00051 
00054     lenslet_array_base(){};
00055 
00058     lenslet_array_base(const lenslet_array_base & labase);
00059 
00062     virtual ~lenslet_array_base(){};
00063 
00066     virtual void write(iofits & iof) const = 0;
00067 
00070     lenslet_array_base & operator=(const lenslet_array_base & labase);
00071 
00074     static lenslet_array_base * lenslet_array_base_factory(const char * filename);
00075 
00078     static lenslet_array_base * lenslet_array_base_factory(const iofits & iof);
00079 
00080   };
00081 
00108 
00109   class square_lenslet_array :
00110     public lenslet_array_base {
00111 
00112     private:
00113 
00114     static const bool factory_registration;
00115 
00118     string unique_name() const {return(string("square lenslet array"));};
00119     
00126     template<class T>
00127       void private_transform(diffractive_wavefront<T> & wf) const;
00128 
00129     protected:
00130 
00132     vector<long> axes;
00133 
00135     double focal_length;
00136     
00138     double lenslet_pitch;
00139 
00148     double final_wavefront_propagation_distance;
00149     
00152     long final_wavefront_pixels_per_lenslet;
00153 
00158     long final_wavefront_pixels_per_transform;
00159 
00162     square_lenslet_array(){};
00163 
00164     public:
00165 
00168     square_lenslet_array(const square_lenslet_array & sq_lns_arr);
00169 
00172     square_lenslet_array(const char * filename);
00173 
00176     square_lenslet_array(const iofits & iof);
00177 
00189     square_lenslet_array(vector<long> array_axes,
00190                          double flength,
00191                          double lnslt_pitch,
00192                          long pix_per_lenslet,
00193                          long pix_per_xform);
00194 
00197     ~square_lenslet_array(){};
00198 
00201     square_lenslet_array & operator=(const square_lenslet_array & sq_lns_arr);
00202 
00205     void read(const char * filename);
00206 
00209     void read(const iofits & iof);
00210  
00213     void write(const char * filename) const;
00214 
00217     void write(iofits & iof) const;
00218 
00221     void print(ostream & os, const char * prefix="") const;
00222 
00225     double get_final_wavefront_propagation_distance() const {return final_wavefront_propagation_distance;};
00226    
00231     void set_final_wavefront_propagation_distance(double wf_prop_dist) {final_wavefront_propagation_distance = wf_prop_dist;};
00232    
00235     long get_final_wavefront_pixels_per_lenslet() const {return final_wavefront_pixels_per_lenslet;};
00236    
00239     void set_final_wavefront_pixels_per_lenslet(long pix_per_lnslt);
00240    
00243     long get_final_wavefront_pixels_per_transform() const {return final_wavefront_pixels_per_transform;};
00244    
00247     void set_final_wavefront_pixels_per_transform(long pix_per_xform);
00248    
00251     vector<long> get_axes() const {return(axes);};
00252    
00255     double get_lenslet_pitch() const {return(lenslet_pitch);};
00256    
00259     double get_focal_length() const {return(focal_length);};
00260    
00270     rectangular_region get_covering_region(const three_frame & tf) const;
00271 
00274     void transform(diffractive_wavefront<float> & wf) const;
00275 
00278     void transform(diffractive_wavefront<double> & wf) const;
00279 
00280   };
00281 }
00282 
00283 #endif

Generated on Thu Nov 29 17:16:29 2007 for arroyo by  doxygen 1.3.9.1