[GRASS-SVN] r55087 - in grass/trunk/imagery/i.ortho.photo: . i.ortho.init

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Feb 17 12:49:20 PST 2013


Author: mmetz
Date: 2013-02-17 12:49:13 -0800 (Sun, 17 Feb 2013)
New Revision: 55087

Added:
   grass/trunk/imagery/i.ortho.photo/i.ortho.init/
   grass/trunk/imagery/i.ortho.photo/i.ortho.init/i.ortho.init.html
Removed:
   grass/trunk/imagery/i.ortho.photo/i.ortho.init/description.html
   grass/trunk/imagery/i.ortho.photo/i.ortho.init/globals.h
   grass/trunk/imagery/i.ortho.photo/i.ortho.init/mod_info.c
Modified:
   grass/trunk/imagery/i.ortho.photo/i.ortho.init/Makefile
   grass/trunk/imagery/i.ortho.photo/i.ortho.init/main.c
Log:
add i.ortho.init

Modified: grass/trunk/imagery/i.ortho.photo/i.ortho.init/Makefile
===================================================================
--- grass/branches/develbranch_6/imagery/i.ortho.photo/i.photo.init/Makefile	2013-01-25 14:53:29 UTC (rev 54769)
+++ grass/trunk/imagery/i.ortho.photo/i.ortho.init/Makefile	2013-02-17 20:49:13 UTC (rev 55087)
@@ -1,16 +1,13 @@
 MODULE_TOPDIR = ../../..
 
-PGM = i.photo.init
+PGM = i.ortho.init
 
-EXTRA_CFLAGS = -I../libes
+EXTRA_CFLAGS = -I../lib
 
-LIBES     = $(IORTHOLIB) $(IMAGERYLIB) $(DISPLAYLIB) $(RASTERLIB) $(GISLIB) $(VASKLIB) $(CURSES) $(GMATHLIB)
-DEPENDENCIES= $(IMAGERYDEP) $(DISPLAYDEP) $(RASTERDEP) $(IORTHODEP) $(GISDEP) $(VASKDEP) $(GMATHDEP)
+LIBES     = $(IORTHOLIB) $(IMAGERYLIB) $(RASTERLIB) $(GISLIB) $(GMATHLIB)
+DEPENDENCIES= $(IMAGERYDEP) $(RASTERDEP) $(IORTHODEP) $(GISDEP) $(GMATHDEP)
 
 include $(MODULE_TOPDIR)/include/Make/Module.make
 
-default: etc
+default: cmd
 
-$(PGM).tmp.html: description.html
-	$(INSTALL_DATA) $< $@
-

Deleted: grass/trunk/imagery/i.ortho.photo/i.ortho.init/description.html
===================================================================
--- grass/branches/develbranch_6/imagery/i.ortho.photo/i.photo.init/description.html	2013-01-25 14:53:29 UTC (rev 54769)
+++ grass/trunk/imagery/i.ortho.photo/i.ortho.init/description.html	2013-02-17 20:49:13 UTC (rev 55087)
@@ -1,109 +0,0 @@
-<H2>DESCRIPTION</H2>
-
-Aerial photographs may be either vertical or oblique. Vertical photographs
-can be truly vertical (nadir), or slightly tilted (less than 3 degree
-from the vertical). Usually aerial photos are tilted to some degree. We
-refer to the term <i>vertical photograph</i> up to a tilt of 3 degree.
-<br>
-Oblique aerial photographs are purposely taken with an
-angle between 3 and 90 degree from the nadir direction.
-<P>
-<b>The use of <EM>i.photo.init</EM> (menu 6) is only required when rectifying a
-tilted or oblique aerial photo.</b>
-<P>
-<EM>i.photo.init</EM> creates or modifies entries in a camera initial exposure
-station file for imagery group referenced by a sub-block.  These entries
-include: the (XC,YC,ZC) standard (e.g. UTM) approximate coordinates of the camera exposure
-station; initial roll, pitch, and yaw angles (in degrees) of the cameras
-attitude; and the <EM>a priori</EM> standard deviations for these
-parameters. During the imagery program, <EM>i.photo.rectify</EM>, the initial camera
-exposure station file is used for computation of the ortho-rectification
-parameters.  If no initial camera exposure station file exist, the default
-values are computed from the control points file created in <EM><A
-HREF="i.photo.2target.html">i.photo.2target</A></EM>.
-
-
-<P>
-
-The following menu is displayed:
-<PRE>
-        Please provide the following information
-
-	INITIAL XC: Meters                __________
-	INITIAL YC: Meters                __________
-	INITIAL ZC: Meters                __________
-	INITIAL omega (roll) degrees:     __________
-	INITIAL phi  (pitch) degrees:     __________
-	INITIAL kappa  (yaw) degrees:     __________
-
-	Standard Deviation XC: Meters     __________
-	Standard Deviation YC: Meters     __________
-	Standard Deviation ZC: Meters     __________
-	Std. Dev. omega (roll) degrees:   __________
-	Std. Dev. phi  (pitch) degrees:   __________
-	Std. Dev. kappa  (yaw) degrees:   __________
-
-        Use these values at run time? (1=yes, 0=no)
-
-     AFTER COMPLETING ALL ANSWERS, HIT <ESC> TO CONTINUE
-                  (OR <Ctrl-C> TO CANCEL)
-</PRE>
-
-<P>
-The INITIAL values for (XC,YC,ZC) are expressed in standard (e.g. UTM) coordinates, and
-represent an approximation for the location of the camera at the time of 
-exposure.
-
-<ul>
-<li> X: East aircraft position;
-<li> Y: North aircraft position;
-<li> Z: Flight altitude above sea level
-</ul>
-
-<P>
-
-The INITIAL values for (omega,phi,kappa) are expressed in degrees, and
-represent an approximation for the cameras attitude  at the time of 
-exposure. 
-
-<ul>
-<li> Omega (roll): Raising or lowering of the wings (turning around the
-  aircraft's axis);
-<li> Phi (pitch): Raising or lowering of the aircraft's front (turning
-  around the wings' axis);
-<li> Kappa (yaw): Rotation needed to align the aerial photo to true north:
-  needs to be denoted as +90 degree for clockwise turn and -90 degree for
-  a counterclockwise turn.
-</ul>
-<P>
-
-The standard deviations for (XC,YC,ZC) are expressed in meters, and
-are used as <EM>a priori</EM> values for the standard deviations used in 
-computation of the ortho rectification parameters.
-<P>
-
-The standard deviations for (omega,phi,kappa) are expressed in degrees, and
-are used as <EM>a priori</EM> values for the standard deviations used in 
-computation of the ortho rectification parameters.
-
-<P>
-If <i>Use these values at run time? (1=yes, 0=no)</i> is set to 0, the
-values in this menu are not used.
-
-<H2>SEE ALSO</H2>
-
-<EM>
-<A HREF="i.ortho.photo.html">i.ortho.photo</A>,
-<A HREF="i.photo.camera.html">i.photo.camera</A>,
-<A HREF="i.photo.2image.html">i.photo.2image</A>,
-<A HREF="i.photo.2target.html">i.photo.2target</A>,
-<A HREF="i.photo.rectify.html">i.photo.rectify</A>
-</EM>
-
-
-
-<H2>AUTHOR</H2>
-
-Mike Baba,  DBA Systems, Inc.
-<p>
-<i>Last changed: $Date$</i>

Deleted: grass/trunk/imagery/i.ortho.photo/i.ortho.init/globals.h
===================================================================
--- grass/branches/develbranch_6/imagery/i.ortho.photo/i.photo.init/globals.h	2013-01-25 14:53:29 UTC (rev 54769)
+++ grass/trunk/imagery/i.ortho.photo/i.ortho.init/globals.h	2013-02-17 20:49:13 UTC (rev 55087)
@@ -1,26 +0,0 @@
-#ifdef MAIN
-#define GLOBAL
-#else
-#define GLOBAL extern
-#endif
-
-#include "orthophoto.h"
-
-/* State flags  Most are Toggles */
-GLOBAL char Data_Loaded;	/* is there data in memory */
-
-				/* used for abnormal exit logic */
-GLOBAL char Files_Open;		/* is there data in memory */
-
-GLOBAL struct Ortho_Image_Group group;
-
-/* hold the names of files etc.  mostly used by main.c */
-GLOBAL char *N_path;
-GLOBAL char *N_name;
-GLOBAL char *N_camera;
-
-#define DEG_TO_RADS 0.01745329
-#define RAD_TO_DEGS 57.29578
-
-/* mod_info.c */
-int mod_init_info(int, struct Ortho_Camera_Exp_Init *);

Copied: grass/trunk/imagery/i.ortho.photo/i.ortho.init/i.ortho.init.html (from rev 54769, grass/branches/develbranch_6/imagery/i.ortho.photo/i.photo.init/description.html)
===================================================================
--- grass/trunk/imagery/i.ortho.photo/i.ortho.init/i.ortho.init.html	                        (rev 0)
+++ grass/trunk/imagery/i.ortho.photo/i.ortho.init/i.ortho.init.html	2013-02-17 20:49:13 UTC (rev 55087)
@@ -0,0 +1,109 @@
+<H2>DESCRIPTION</H2>
+
+Aerial photographs may be either vertical or oblique. Vertical photographs
+can be truly vertical (nadir), or slightly tilted (less than 3 degree
+from the vertical). Usually aerial photos are tilted to some degree. We
+refer to the term <i>vertical photograph</i> up to a tilt of 3 degree.
+<br>
+Oblique aerial photographs are purposely taken with an
+angle between 3 and 90 degree from the nadir direction.
+<P>
+<b>The use of <EM>i.photo.init</EM> (menu 6) is only required when rectifying a
+tilted or oblique aerial photo.</b>
+<P>
+<EM>i.photo.init</EM> creates or modifies entries in a camera initial exposure
+station file for imagery group referenced by a sub-block.  These entries
+include: the (XC,YC,ZC) standard (e.g. UTM) approximate coordinates of the camera exposure
+station; initial roll, pitch, and yaw angles (in degrees) of the cameras
+attitude; and the <EM>a priori</EM> standard deviations for these
+parameters. During the imagery program, <EM>i.photo.rectify</EM>, the initial camera
+exposure station file is used for computation of the ortho-rectification
+parameters.  If no initial camera exposure station file exist, the default
+values are computed from the control points file created in <EM><A
+HREF="i.photo.2target.html">i.photo.2target</A></EM>.
+
+
+<P>
+
+The following menu is displayed:
+<PRE>
+        Please provide the following information
+
+	INITIAL XC: Meters                __________
+	INITIAL YC: Meters                __________
+	INITIAL ZC: Meters                __________
+	INITIAL omega (roll) degrees:     __________
+	INITIAL phi  (pitch) degrees:     __________
+	INITIAL kappa  (yaw) degrees:     __________
+
+	Standard Deviation XC: Meters     __________
+	Standard Deviation YC: Meters     __________
+	Standard Deviation ZC: Meters     __________
+	Std. Dev. omega (roll) degrees:   __________
+	Std. Dev. phi  (pitch) degrees:   __________
+	Std. Dev. kappa  (yaw) degrees:   __________
+
+        Use these values at run time? (1=yes, 0=no)
+
+     AFTER COMPLETING ALL ANSWERS, HIT <ESC> TO CONTINUE
+                  (OR <Ctrl-C> TO CANCEL)
+</PRE>
+
+<P>
+The INITIAL values for (XC,YC,ZC) are expressed in standard (e.g. UTM) coordinates, and
+represent an approximation for the location of the camera at the time of 
+exposure.
+
+<ul>
+<li> X: East aircraft position;
+<li> Y: North aircraft position;
+<li> Z: Flight altitude above sea level
+</ul>
+
+<P>
+
+The INITIAL values for (omega,phi,kappa) are expressed in degrees, and
+represent an approximation for the cameras attitude  at the time of 
+exposure. 
+
+<ul>
+<li> Omega (roll): Raising or lowering of the wings (turning around the
+  aircraft's axis);
+<li> Phi (pitch): Raising or lowering of the aircraft's front (turning
+  around the wings' axis);
+<li> Kappa (yaw): Rotation needed to align the aerial photo to true north:
+  needs to be denoted as +90 degree for clockwise turn and -90 degree for
+  a counterclockwise turn.
+</ul>
+<P>
+
+The standard deviations for (XC,YC,ZC) are expressed in meters, and
+are used as <EM>a priori</EM> values for the standard deviations used in 
+computation of the ortho rectification parameters.
+<P>
+
+The standard deviations for (omega,phi,kappa) are expressed in degrees, and
+are used as <EM>a priori</EM> values for the standard deviations used in 
+computation of the ortho rectification parameters.
+
+<P>
+If <i>Use these values at run time? (1=yes, 0=no)</i> is set to 0, the
+values in this menu are not used.
+
+<H2>SEE ALSO</H2>
+
+<EM>
+<A HREF="i.ortho.photo.html">i.ortho.photo</A>,
+<A HREF="i.photo.camera.html">i.photo.camera</A>,
+<A HREF="i.photo.2image.html">i.photo.2image</A>,
+<A HREF="i.photo.2target.html">i.photo.2target</A>,
+<A HREF="i.photo.rectify.html">i.photo.rectify</A>
+</EM>
+
+
+
+<H2>AUTHOR</H2>
+
+Mike Baba,  DBA Systems, Inc.
+<p>
+<i>Last changed: $Date$</i>

Modified: grass/trunk/imagery/i.ortho.photo/i.ortho.init/main.c
===================================================================
--- grass/branches/develbranch_6/imagery/i.ortho.photo/i.photo.init/main.c	2013-01-25 14:53:29 UTC (rev 54769)
+++ grass/trunk/imagery/i.ortho.photo/i.ortho.init/main.c	2013-02-17 20:49:13 UTC (rev 55087)
@@ -19,69 +19,243 @@
  *
  *****************************************************************************/
 
-#define  MAIN  1
 #include <stdlib.h>
 #include <string.h>
+#include <stdio.h>
 #include <grass/gis.h>
 #include <grass/glocale.h>
-#include "globals.h"
+#include "orthophoto.h"
 
 
 int main(int argc, char *argv[])
 {
     struct GModule *module;
-    struct Option *group_opt;
+    struct Option *group_opt,
+		  *xc_opt, *yc_opt, *zc_opt,
+		  *xcsd_opt, *ycsd_opt, *zcsd_opt,
+		  *omega_opt, *phi_opt, *kappa_opt,
+		  *omegasd_opt, *phisd_opt, *kappasd_opt;
+    struct Flag *use_flag, *print_flag;
 
-    char name[GNAME_MAX];
-    int have_old;
+    struct Ortho_Image_Group group;
+    struct Ortho_Camera_Exp_Init *init_info;
+    double deg2rad, rad2deg;
 
-    /* must run in a term window */
-    G_putenv("GRASS_UI_TERM", "1");
-
     G_gisinit(argv[0]);
 
     module = G_define_module();
-    module->keywords = _("imagery, orthorectify");
+    G_add_keyword(_("imagery"));
+    G_add_keyword(_("orthorectify"));
     module->description =
 	_("Interactively creates or modifies entries in a camera "
 	  "initial exposure station file for imagery group referenced "
 	  "by a sub-block.");
 
     group_opt = G_define_standard_option(G_OPT_I_GROUP);
+    group_opt->required = YES;
     group_opt->description =
 	_("Name of imagery group for ortho-rectification");
 
+    xc_opt = G_define_option();
+    xc_opt->key = "xc";
+    xc_opt->type = TYPE_DOUBLE;
+    xc_opt->description = _("Initial Camera Exposure X-coordinate");
+
+    yc_opt = G_define_option();
+    yc_opt->key = "yc";
+    yc_opt->type = TYPE_DOUBLE;
+    yc_opt->description = _("Initial Camera Exposure Y-coordinate");
+
+    zc_opt = G_define_option();
+    zc_opt->key = "zc";
+    zc_opt->type = TYPE_DOUBLE;
+    zc_opt->description = _("Initial Camera Exposure Z-coordinate");
+
+    xcsd_opt = G_define_option();
+    xcsd_opt->key = "xc_sd";
+    xcsd_opt->type = TYPE_DOUBLE;
+    xcsd_opt->description = _("X-coordinate standard deviation");
+
+    ycsd_opt = G_define_option();
+    ycsd_opt->key = "yc_sd";
+    ycsd_opt->type = TYPE_DOUBLE;
+    ycsd_opt->description = _("Y-coordinate standard deviation");
+
+    zcsd_opt = G_define_option();
+    zcsd_opt->key = "zc_sd";
+    zcsd_opt->type = TYPE_DOUBLE;
+    zcsd_opt->description = _("Z-coordinate standard deviation");
+    
+    omega_opt = G_define_option();
+    omega_opt->key = "omega";
+    omega_opt->type = TYPE_DOUBLE;
+    omega_opt->description = _("Initial Camera Omega (roll) degrees");
+
+    phi_opt = G_define_option();
+    phi_opt->key = "omega";
+    phi_opt->type = TYPE_DOUBLE;
+    phi_opt->description = _("Initial Camera Phi (pitch) degrees");
+
+    kappa_opt = G_define_option();
+    kappa_opt->key = "omega";
+    kappa_opt->type = TYPE_DOUBLE;
+    kappa_opt->description = _("Initial Camera Kappa (yaw) degrees");
+
+    omegasd_opt = G_define_option();
+    omegasd_opt->key = "omega";
+    omegasd_opt->type = TYPE_DOUBLE;
+    omegasd_opt->description = _("Omega (roll) standard deviation");
+
+    phisd_opt = G_define_option();
+    phisd_opt->key = "omega";
+    phisd_opt->type = TYPE_DOUBLE;
+    phisd_opt->description = _("Phi (pitch) standard deviation");
+
+    kappasd_opt = G_define_option();
+    kappasd_opt->key = "omega";
+    kappasd_opt->type = TYPE_DOUBLE;
+    kappasd_opt->description = _("Kappa (yaw) standard deviation");
+
+    use_flag = G_define_flag();
+    use_flag->key = 'r';
+    use_flag->description = _("Use initial values at run time");
+
+    print_flag = G_define_flag();
+    print_flag->key = 'p';
+    print_flag->description = _("Print initial values");
+
     if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
+    deg2rad = M_PI / 180.;
+    rad2deg = 180. / M_PI;
 
-    strcpy(name, group_opt->answer);
-
     /* get group ref */
-    strcpy(group.name, name);
+    strcpy(group.name, group_opt->answer);
 
     if (!I_find_group(group.name)) {
-	G_fatal_error(_("Group [%s] not found"), name);
+	G_fatal_error(_("Group [%s] not found"), group.name);
     }
     G_debug(1, "Found group %s", group.name);
 
+    /* get initial camera exposure info */
+    if (I_find_initial(group.name)) {
+	I_get_init_info(group.name, &group.camera_exp);
+    }
+    else {
+	/* create new initial camera exposure info */
+	
+	/* all values must be given */
+	if (!xc_opt->answer) {
+	    G_fatal_error(_("Option '%s' is required for new exposure info"),
+			    xc_opt->key);
+	}
+	if (!yc_opt->answer) {
+	    G_fatal_error(_("Option '%s' is required for new exposure info"),
+			    yc_opt->key);
+	}
+	if (!zc_opt->answer) {
+	    G_fatal_error(_("Option '%s' is required for new exposure info"),
+			    zc_opt->key);
+	}
+	if (!xcsd_opt->answer) {
+	    G_fatal_error(_("Option '%s' is required for new exposure info"),
+			    xcsd_opt->key);
+	}
+	if (!ycsd_opt->answer) {
+	    G_fatal_error(_("Option '%s' is required for new exposure info"),
+			    ycsd_opt->key);
+	}
+	if (!zcsd_opt->answer) {
+	    G_fatal_error(_("Option '%s' is required for new exposure info"),
+			    zcsd_opt->key);
+	}
+	if (!omega_opt->answer) {
+	    G_fatal_error(_("Option '%s' is required for new exposure info"),
+			    omega_opt->key);
+	}
+	if (!phi_opt->answer) {
+	    G_fatal_error(_("Option '%s' is required for new exposure info"),
+			    phi_opt->key);
+	}
+	if (!kappa_opt->answer) {
+	    G_fatal_error(_("Option '%s' is required for new exposure info"),
+			    kappa_opt->key);
+	}
+	if (!omegasd_opt->answer) {
+	    G_fatal_error(_("Option '%s' is required for new exposure info"),
+			    omegasd_opt->key);
+	}
+	if (!phisd_opt->answer) {
+	    G_fatal_error(_("Option '%s' is required for new exposure info"),
+			    phisd_opt->key);
+	}
+	if (!kappasd_opt->answer) {
+	    G_fatal_error(_("Option '%s' is required for new exposure info"),
+			    kappasd_opt->key);
+	}
+    }
 
-/*******************
-    I_get_Ortho_Image_Group_Ref(group.name, &group.group_ref);
-    nfiles = block.block_ref.nfiles;
-    G_debug(1, "Got group ref");
-*******************/
+    /* modify info */
+    init_info = &group.camera_exp;
 
+    if (xc_opt->answer) {
+	init_info->XC_init = atof(xc_opt->answer);
+    }
+    if (yc_opt->answer) {
+	init_info->YC_init = atof(yc_opt->answer);
+    }
+    if (zc_opt->answer) {
+	init_info->ZC_init = atof(zc_opt->answer);
+    }
+    if (xcsd_opt->answer) {
+	init_info->XC_var = atof(xcsd_opt->answer);
+    }
+    if (ycsd_opt->answer) {
+	init_info->YC_var = atof(ycsd_opt->answer);
+    }
+    if (zcsd_opt->answer) {
+	init_info->ZC_var = atof(zcsd_opt->answer);
+    }
+    if (omega_opt->answer) {
+	init_info->omega_init = atof(omega_opt->answer) * deg2rad;
+    }
+    if (phi_opt->answer) {
+	init_info->phi_init = atof(phi_opt->answer) * deg2rad;
+    }
+    if (kappa_opt->answer) {
+	init_info->kappa_init = atof(kappa_opt->answer) * deg2rad;
+    }
+    if (omegasd_opt->answer) {
+	init_info->omega_var = atof(omegasd_opt->answer) * deg2rad;
+    }
+    if (phisd_opt->answer) {
+	init_info->phi_var = atof(phisd_opt->answer) * deg2rad;
+    }
+    if (kappasd_opt->answer) {
+	init_info->kappa_var = atof(kappasd_opt->answer) * deg2rad;
+    }
+    init_info->status = use_flag->answer != 0;
+    
+    if (print_flag->answer) {
+	/* do not translate, scripts might want to parse the output */
+	fprintf(stdout, "xc=%.17g\n", init_info->XC_init);
+	fprintf(stdout, "yc=%.17g\n", init_info->YC_init);
+	fprintf(stdout, "zc=%.17g\n", init_info->ZC_init);
+	fprintf(stdout, "xc_sd=%.17g\n", init_info->XC_var);
+	fprintf(stdout, "yc_sd=%.17g\n", init_info->YC_var);
+	fprintf(stdout, "zc_sd=%.17g\n", init_info->ZC_var);
 
-    /* get initial camera exposure infor */
-    if (I_find_initial(group.name)) {
-	have_old = 1;
-	I_get_init_info(group.name, &group.camera_exp);
+	fprintf(stdout, "omega=%.17g\n", init_info->omega_init * rad2deg);
+	fprintf(stdout, "phi=%.17g\n", init_info->phi_init * rad2deg);
+	fprintf(stdout, "kappa=%.17g\n", init_info->kappa_init * rad2deg);
+	fprintf(stdout, "omega_sd=%.17g\n", init_info->omega_var * rad2deg);
+	fprintf(stdout, "phi_sd=%.17g\n", init_info->phi_var * rad2deg);
+	fprintf(stdout, "kappa_sd=%.17g\n", init_info->kappa_var * rad2deg);
+	
+	fprintf(stdout, "use=%d", init_info->status);
     }
 
-    /* modifiy infor */
-    mod_init_info(have_old, &group.camera_exp);
-
     /* save info */
     I_put_init_info(group.name, &group.camera_exp);
 

Deleted: grass/trunk/imagery/i.ortho.photo/i.ortho.init/mod_info.c
===================================================================
--- grass/branches/develbranch_6/imagery/i.ortho.photo/i.photo.init/mod_info.c	2013-01-25 14:53:29 UTC (rev 54769)
+++ grass/trunk/imagery/i.ortho.photo/i.ortho.init/mod_info.c	2013-02-17 20:49:13 UTC (rev 55087)
@@ -1,80 +0,0 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <curses.h>
-#include <grass/vask.h>
-#include "globals.h"
-
-int mod_init_info(int have_old, struct Ortho_Camera_Exp_Init *init_info)
-{
-    double omega_deg, phi_deg, kappa_deg;
-    double omega_var, phi_var, kappa_var;
-
-    if (!have_old) {
-	/* make zero */
-    }
-
-    /* convert from radians to degrees */
-    omega_deg = init_info->omega_init * RAD_TO_DEGS;
-    phi_deg = init_info->phi_init * RAD_TO_DEGS;
-    kappa_deg = init_info->kappa_init * RAD_TO_DEGS;
-
-    omega_var = init_info->omega_var * RAD_TO_DEGS;
-    phi_var = init_info->phi_var * RAD_TO_DEGS;
-    kappa_var = init_info->kappa_var * RAD_TO_DEGS;
-
-
-    V_clear();
-    V_line(1, "                   Please provide the following information:");
-    V_line(2,
-	   "+------------------------------------------------------------------------------+");
-    V_line(4, "     Initial Camera Exposure X-coordinate Meters:");
-    V_line(5, "     Initial Camera Exposure Y-coordinate Meters:");
-    V_line(6, "     Initial Camera Exposure Z-coordinate Meters:");
-    V_line(7, "     Initial Camera Omega (roll) degrees:");
-    V_line(8, "     Initial Camera Phi  (pitch) degrees:");
-    V_line(9, "     Initial Camera Kappa  (yaw) degrees:");
-
-    V_line(11, "     Apriori standard deviation X-coordinate Meters:");
-    V_line(12, "     Apriori standard deviation Y-coordinate Meters:");
-    V_line(13, "     Apriori standard deviation Z-coordinate Meters:");
-    V_line(14, "     Apriori standard deviation Omega (roll) degrees:");
-    V_line(15, "     Apriori standard deviation Phi  (pitch) degrees:");
-    V_line(16, "     Apriori standard deviation Kappa  (yaw) degrees:");
-
-    V_line(18, "     Use these values at run time? (1=yes, 0=no)");
-    V_line(19,
-	   "+------------------------------------------------------------------------------+");
-
-    V_ques(&(init_info->XC_init), 'd', 4, 60, 15 - 1);
-    V_ques(&(init_info->YC_init), 'd', 5, 60, 15 - 1);
-    V_ques(&(init_info->ZC_init), 'd', 6, 60, 15 - 1);
-
-    V_ques(&omega_deg, 'd', 7, 60, 15 - 1);
-    V_ques(&phi_deg, 'd', 8, 60, 15 - 1);
-    V_ques(&kappa_deg, 'd', 9, 60, 15 - 1);
-
-    V_ques(&(init_info->XC_var), 'd', 11, 60, 15 - 1);
-    V_ques(&(init_info->YC_var), 'd', 12, 60, 15 - 1);
-    V_ques(&(init_info->ZC_var), 'd', 13, 60, 15 - 1);
-
-    V_ques(&omega_var, 'd', 14, 60, 15 - 1);
-    V_ques(&phi_var, 'd', 15, 60, 15 - 1);
-    V_ques(&kappa_var, 'd', 16, 60, 15 - 1);
-    V_ques(&(init_info->status), 'i', 18, 60, 2);
-
-    V_intrpt_ok();
-    if (!V_call()) {
-	exit(0);
-    }
-
-    /* convert back to radians */
-    init_info->omega_init = omega_deg * DEG_TO_RADS;
-    init_info->phi_init = phi_deg * DEG_TO_RADS;
-    init_info->kappa_init = kappa_deg * DEG_TO_RADS;
-
-    init_info->omega_var = omega_var * DEG_TO_RADS;
-    init_info->phi_var = phi_var * DEG_TO_RADS;
-    init_info->kappa_var = kappa_var * DEG_TO_RADS;
-
-    return 0;
-}



More information about the grass-commit mailing list