00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
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