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

orbitbk.hh

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 1999-2003 Bert Kampes
00003  * Copyright (c) 1999-2003 Delft University of Technology, The Netherlands
00004  *
00005  * This file is part of Doris, the Delft o-o radar interferometric software.
00006  *
00007  * Doris program is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License, or
00010  * (at your option) any later version.
00011  *
00012  * Doris is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020  *
00021  * Publications that contain results produced by the Doris software should
00022  * contain an acknowledgment. (For example: The interferometric processing
00023  * was performed using the freely available Doris software package developed
00024  * by the Delft Institute for Earth-Oriented Space Research (DEOS), Delft
00025  * University of Technology, or include a reference to: Bert Kampes and
00026  * Stefania Usai. \"Doris: The Delft Object-oriented Radar Interferometric
00027  * software.\" In: proceedings 2nd ITC ORS symposium, August 1999. (cdrom)).
00028  *
00029  */
00030 /****************************************************************
00031  * $Source: /users/kampes/DEVELOP/DORIS/doris/src/RCS/orbitbk.hh,v $    *
00032  * $Revision: 3.10 $                                            *
00033  * $Date: 2005/04/11 13:47:45 $                                 *
00034  * $Author: kampes $                                            *
00035  *                                                              *
00036  * implementation of orbit class.                               *
00037  * - orbit interpolation.                                       * 
00038  * - baseline estimation.                                       *
00039  * - utility dumping etc.                                       *
00040  *                                                              *
00041  * Compilation with: g++ -D__TESTMAIN__ orbit.cc -o testorbit   *
00042  * creates a standalone executable for testing of the functions *
00043  * of the orbit class. Please see below: "main program".        *
00044  ****************************************************************/
00045 
00046 
00047 #ifndef ORBITBK_H               // guard
00048 #define ORBITBK_H
00049 
00050 
00051 #include "matrixbk.hh"          // my matrix class, only 2b included once...
00052 #include "slcimage.hh"          // my slc image class
00053 #include "constants.hh"         // global constants
00054 #include "readinput.hh"         // input structs
00055 
00056 
00057 
00058 
00059 // ====== Some inline functions ======
00060 // make these private..., but doesn't seem to work ok that way, so do it like this
00061 // ______ The setofequation for t2xyz ______
00062 inline real8 eq1_doppler(cn velocity, cn dsat_P)
00063   {return velocity.in(dsat_P);}
00064 inline real8 eq2_range(cn dsat_P, real8 rangetime)
00065   {return dsat_P.in(dsat_P)-sqr(SOL*rangetime);}
00066 inline real8 eq3_ellipsoid(cn P, real8 semimajora, real8 semiminorb)
00067   {return ((sqr(P.x)+sqr(P.y))/sqr(semimajora))+sqr(P.z/semiminorb)-1.;}
00068 
00069 // ______ The partial to Pxyz of the 3 eq. for t2xyz ______
00070 // they are best evaluated within calling function:
00071 // dE1/dx  dE1/dy  dE1/dz   vel.x                ~y  ~z
00072 // dE2/dx  dE2/dy  dE2/dz = 2*(pos.x-sat.x)      ~y  ~z
00073 // dE3/dx  dE3/dy  dE3/dz   (2*pos.x)/sqr(ell.a) ~y  (2*pos.z)/sqr(ell.b);
00074 
00075 // ______ The partial to time of dopplereq. for xyz2t ______
00076 inline real8 eq1_doppler_dt(cn dsat_P, cn velocity, cn accerelation)
00077   {return accerelation.in(dsat_P)-sqr(velocity.x)-sqr(velocity.y)-sqr(velocity.z);}
00078 
00079 
00080 
00081 
00082 // ====== The orbit class itself ======
00083 class orbit
00084   {
00085   // ====== Private data, functions ======
00086   private:
00087     // ______ Data ______
00088     //char system[80];                  // WGS84, GRS80, Bessel, etc.
00089     int16 interp_method;                // 0: cubic spline, x: polyfit(x)
00090     int32 numberofpoints;               // ...
00091     int32 klo;                          // index in timevector correct
00092     int32 khi;                          // +part piecewize polynomial
00093     matrix<real8> time;                 // vector (numberofpoints,1)
00094     matrix<real8> data_x;               // vector (numberofpoints,1)
00095     matrix<real8> data_y;               // vector (numberofpoints,1)
00096     matrix<real8> data_z;               // vector (numberofpoints,1)
00097     matrix<real8> coef_x;               // vector (numberofpoints,1)
00098     matrix<real8> coef_y;               // vector (numberofpoints,1)
00099     matrix<real8> coef_z;               // vector (numberofpoints,1)
00100 
00101     // ______ Functions ______
00102     void computecoefficients();         // pp coeffs.
00103     void getklokhi(real8 t);            // piecewize polynomial indices
00104 
00105 
00106   // ====== Public data, functions ======
00107   public:
00108     //default method is polynomial degree=npoints, but max degree=5.
00109     //orbit() {interp_method=ORB_SPLINE;}// constructor
00110     //orbit() {interp_method=4;}// constructor
00111     orbit() {interp_method=ORB_DEFAULT;numberofpoints=0;}// constructor
00112     int32 npoints()     {return numberofpoints;}
00113     void set_interp_method(int16 m){interp_method=m;}
00114 
00115     // ______ Read from file&store t,x,y,z; compute coefficients ______ 
00116     // ______ function initialize should be called first! ______
00117     void initialize (const char *file); // do all...
00118     bool is_initialized() {return (numberofpoints!=0) ? true : false;}// constructor
00119     void showdata   ();                 // debugging...
00120 
00121     // ====== Interpolation ======
00122     //cn getxyz       (real8 time) const; // not const, klo/hi updated
00123     cn getxyz       (real8 time);
00124     cn getxyzdot    (real8 time);
00125     cn getxyzddot   (real8 time);
00126 
00127     // ====== Conversion between coordinate systems ======
00128     // ______ radar coordinate line/pixel to xyz on ellipsoid ______
00129     friend int32 lp2xyz(
00130         real8            line,
00131         real8            pixel,
00132         const input_ell &ell,
00133         const slcimage  &image,
00134         orbit           &orb,
00135         cn              &returnpos,
00136         int32            MAXITER=10,            // [.] defaults
00137         real8            CRITERPOS=1e-6);       // [m]
00138 
00139     // ______ xyz cartesian on ellipsoid to orbital coord. ______
00140     friend int32 xyz2orb(
00141         cn              &returnpossat,
00142         const slcimage  &image,
00143         orbit           &orb,
00144         const cn        &pointonellips,
00145         int32            MAXITER=10,            // [.] defaults
00146         real8            CRITERTIM=1e-10);      // [s]
00147 
00148     // ______ xyz cartesian on ellipsoid to azimuth/range time ______
00149     friend int32 xyz2t(
00150         real8           &returntazi,            // azimuth
00151         real8           &returntran,            // and range time
00152         const slcimage  &image,
00153         orbit           &orb,
00154         const cn        &pos,
00155         int32            MAXITER=10,            // [.] defaults
00156         real8            CRITERTIM=1e-10);      // [s]
00157 
00158     // ______ convert xyz-ellipsoid to line/pixel ______
00159     friend int32 xyz2lp(
00160         real8           &returnline,
00161         real8           &returnpixel,
00162         const slcimage  &image,
00163         orbit           &orb,
00164         const cn        &pos,
00165         int32            MAXITER=10,             // defaults
00166         real8            CRITERTIM=1e-10);       // seconds
00167 
00168     // ______ Convert ellipsoid to radar coordinates ______
00169     friend int32 ell2lp(
00170         real8           &returnline,
00171         real8           &returnpixel,
00172         const input_ell &ell,
00173         const slcimage  &image,
00174         orbit           &orb,
00175         real8            phi,
00176         real8            lambda,
00177         real8            height,
00178         int32            MAXITER=10,
00179         real8            CRITERTIM=1e-10);  // seconds
00180 
00181     // ______ Convert radar coordinates to ellipsoidal coordinates ______
00182     friend int32 lp2ell(
00183         real8            line,
00184         real8            pixel,
00185         const input_ell &ell,
00186         const slcimage  &image,
00187         orbit           &orb,
00188         real8           &returnphi,
00189         real8           &returnlambda,
00190         real8           &returnheight,
00191         int32            MAXITER=10,
00192         real8            CRITERPOS=1e-6);   // meter
00193 
00194     // ====== baseline modelling? ======
00195     // ?
00196 
00197     // ====== Information/debugging ======
00198     // ______ dump computed coeffs, interpolated orbit, etc. ______
00199     void dumporbit(
00200         const input_pr_orbits &inputorb,
00201         const int16      ID);
00202 
00203     // ______ compute baseline on a grid ______
00204     friend void compbaseline(
00205         const input_gen &generalinput,
00206         const slcimage &master,
00207         const slcimage &slave,
00208         orbit           &masterorbit,
00209         orbit           &slaveorbit);
00210 
00211   }; // END class orbit
00212 
00213 #endif // ORBITBK_H guard
00214 
00215 

Generated on Fri Apr 22 15:57:57 2005 for Doris by doxygen 1.3.6