Main Page   Namespace List   Compound List   File List   Namespace Members   Compound Members   File Members  

weif.hxx

Go to the documentation of this file.
00001 /*--------------------------------------------------------------------------*/
00055 /* This header file is equipped with documentation made in comments in a
00056 * format suitable fro production of LaTeX or HTML documentation with the
00057 * doxygen software.
00058 * Editor tabular size: 4                                                    */
00059 /****************************************************************************/
00060 
00061 #ifndef _WEIF_H
00062 #define _WEIF_H
00063 
00064 #include "scind.hxx"
00065 #include "nrutil.h"
00066 
00067 /****************************************************************************/
00068 /*                     Weight function structure                            */
00069 /****************************************************************************/
00070 
00093 class wf_t {
00094         
00095         double * zgrid ;                        
00097         int nz ;                                        
00099         double z0 ;     
00100         double zmax ;   
00101         double dz ;             
00102         double dzmin ;  
00104         double ** ws ;                          
00106         int naper ;                                     
00108         double diam ;           
00109 
00110         double * eps_inn ;      
00112         double * eps_out ;      
00114         double leff ;   
00116         double lblue ;  
00117         double lred ;   
00118         bool staticapert ;      
00121         int readhdr(const char* file, double * weightscale) ;   
00122 public:
00123              
00124 /****************************************************************************/
00125 /*             Declarations of public member functions:                     */
00126 /****************************************************************************/
00127 
00131 wf_t() ;
00132 
00141 void clear() ;
00142 
00149 ~wf_t() { setaper(0) ; }
00150 
00188 void setaper(int nap, double diam=0, double * eps_in=0, double * eps_ou=0) ;
00189 
00195 int     getnaper() const { return naper ; }
00196 
00205 int     getnw() const { return sc::napcomb(naper) ; }
00206 
00219 const char * name(int index) const {
00220         if ((index>=getnw()) || (index<0))
00221                 /* Set the error which would be set otherwise by sc::apername */
00222                 nr::nrerror("WEIF: name(): invalid weight index",nr::ERPAR);
00223         return sc::apername(naper,index) ;
00224 }
00225 
00276 void setzgrid(double z0, double zmax, double dz, double dzmin);
00277 
00283 int getnz() const { return nz ; }
00284 
00332 void write(const char * filename) const ;
00333 
00373 int checkfile(const char * filename) const ;
00374 
00402 int read(const char * filename) ;
00403 
00450 void calc(double * lambda, double * edist, int nedist, void (*progress)(int));
00451 
00484 int calcleff(double * lambda, double * edist, int nedist, int fix);
00485 
00521 void interpolate(wf_t * refwf, double shift, 
00522         double * maxerr = 0, int * iz_maxerr = 0, int * iw_maxerr = 0);
00523 
00527 double getleff() const { return leff ;}
00528 
00532 double getblue() const { return lblue ; }
00533 
00537 double getred() const { return lred ; }
00538 
00547 double getval(int iz, int iw) const ;
00548 
00563 void copy(int lowiz, int hiiz, int iw, double * dest) const ;
00564 
00570 double getalt(int iz) const ;
00571 
00572 } ;     /* of the class wf_t */
00573 
00580 namespace wf {
00581 
00594 double getzshift(double foclen_feed, double foclen_conj) ;
00595 
00603 void progress(int stage) ;
00604 
00605 /***************************************************************************/
00606 /*                  Constant definitions                                   */
00607 /***************************************************************************/
00608 
00610 const double MAX_DIAM = 1000 ;
00611 
00613 const int MAXNZ = 10000 ;
00614 
00616 /* ATTENTION! Should always be purely logarithmic al: 1E10 or 1E11 or... */
00617 const double WSCALE     = 1E11 ;
00618 
00620 const int WVALEN  = 15 ;
00621 
00623 const double Z0 = 0 ;
00624 
00626 const double ZMAX = 30 ;
00627 
00629 const double DZ = 0.2 ;
00630 
00632 const double DZMIN  = 0.04 ;
00633 
00635 const double EPSD = 2E-2 ;
00636 
00640 const double EPSLEFF = 0.003 ;
00641 
00644 enum {LEFFTEST=0, LEFFFIX=1} ;
00645 
00648 const double EPSDZ = 1.5 ;
00649 
00651 const int LTEXT = 80 ;
00652 
00653 /* Weight interpolation: type of the function - polynomial or rational func. */
00654 /*#define POLINT*/      /* Use polint() recipe from NR */
00655 /* ATTENTION! If no POLINT set, the 
00656   SPLINE interpolation is used. As far as we know, its the BEST choice,
00657   at least with INTPOW=6. */
00658 
00659 #ifdef POLINT
00660 
00661 const int INTPOW  = 6 ;
00662 
00664 /*#define INTRELERR*/
00665 #endif
00666 
00667 /* Weight file delimiters: */
00668 const char FDELIM[] = " \t\n\r" ;
00669 
00670 /* Error codes and messages are all collected in SCIND */
00671 
00672 }       /* of namespace wf */ 
00673 
00674 #endif

Generated on Wed Jan 16 00:40:06 2002 for MASS Software by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001