Browse Source

Use dark scale

Matthias Vogelgesang 9 years ago
parent
commit
ecce9aa6e2
1 changed files with 24 additions and 20 deletions
  1. 24 20
      lamino.c

+ 24 - 20
lamino.c

@@ -10,6 +10,7 @@ typedef struct {
     gint height;
     guint num_radios;
     guint num_darks;
+    gdouble dark_scale;
     gdouble theta;
     gdouble tau;
     gdouble psi;
@@ -223,6 +224,7 @@ run_reconstruction (Params *params)
         dark_reader = make_task (pm, "reader");
         ffc = make_task (pm, "flat-field-correction");
 
+        g_object_set (ffc, "dark-scale", params->dark_scale, NULL);
         g_object_set (flat_reader, "path", params->flats, NULL);
         g_object_set (dark_reader, "path", params->darks, NULL);
 
@@ -280,26 +282,27 @@ parse_params (Params *params, int argc, char **argv)
     GError *error = NULL;
 
     GOptionEntry entries[] = {
-        { "width", 0, 0, G_OPTION_ARG_INT, &params->width, "Width", "" },
-        { "height", 0, 0, G_OPTION_ARG_INT, &params->height, "Height", "" },
-        { "num-radios", 0, 0, G_OPTION_ARG_INT, &params->num_radios, "Number of radios", "" },
-        { "num-darks", 0, 0, G_OPTION_ARG_INT, &params->num_darks, "Number of darks", "" },
-        { "radios", 0, 0, G_OPTION_ARG_STRING, &params->radios, "Radios", "" },
-        { "darks", 0, 0, G_OPTION_ARG_STRING, &params->darks, "Darks", "" },
-        { "flats", 0, 0, G_OPTION_ARG_STRING, &params->flats, "Flats", "" },
-        { "output", 0, 0, G_OPTION_ARG_STRING, &params->output, "Output", "" },
-        { "theta", 0, 0, G_OPTION_ARG_DOUBLE, &params->theta, "Tilt (theta)", "" },
-        { "tau", 0, 0, G_OPTION_ARG_DOUBLE, &params->tau, "Pixel size (theta)", "" },
-        { "psi", 0, 0, G_OPTION_ARG_DOUBLE, &params->psi, "Misalignment (psi)", "" },
-        { "px", 0, 0, G_OPTION_ARG_DOUBLE, &params->px, "X coordinate of axis", "" },
-        { "py", 0, 0, G_OPTION_ARG_DOUBLE, &params->py, "Y coordinate of axis", "" },
-        { "px-variation", 0, 0, G_OPTION_ARG_DOUBLE, &params->px_variation, "X axis variation", "" },
-        { "vx", 0, 0, G_OPTION_ARG_DOUBLE, &params->v_origin[0], "X coordinate of box origin", "" },
-        { "vy", 0, 0, G_OPTION_ARG_DOUBLE, &params->v_origin[1], "Y coordinate of box origin", "" },
-        { "vz", 0, 0, G_OPTION_ARG_DOUBLE, &params->v_origin[2], "Z coordinate of box origin", "" },
-        { "vw", 0, 0, G_OPTION_ARG_INT, &params->v_size[0], "Width of box", "" },
-        { "vh", 0, 0, G_OPTION_ARG_INT, &params->v_size[1], "Height of box", "" },
-        { "vd", 0, 0, G_OPTION_ARG_INT, &params->v_size[2], "Depth of box", "" },
+        { "width", 0, 0, G_OPTION_ARG_INT, &params->width, "Width", "[int]" },
+        { "height", 0, 0, G_OPTION_ARG_INT, &params->height, "Height", "[int]" },
+        { "num-radios", 0, 0, G_OPTION_ARG_INT, &params->num_radios, "Number of radios", "[int]" },
+        { "num-darks", 0, 0, G_OPTION_ARG_INT, &params->num_darks, "Number of darks", "[int]" },
+        { "radios", 0, 0, G_OPTION_ARG_STRING, &params->radios, "Radios", "[path|glob]" },
+        { "darks", 0, 0, G_OPTION_ARG_STRING, &params->darks, "Darks", "[path|glob]" },
+        { "flats", 0, 0, G_OPTION_ARG_STRING, &params->flats, "Flats", "[path|glob]" },
+        { "dark-scale", 0, 0, G_OPTION_ARG_DOUBLE, &params->dark_scale, "Dark scale", "[float]" },
+        { "output", 0, 0, G_OPTION_ARG_STRING, &params->output, "Output", "[path]" },
+        { "theta", 0, 0, G_OPTION_ARG_DOUBLE, &params->theta, "Tilt (theta)", "[float]" },
+        { "tau", 0, 0, G_OPTION_ARG_DOUBLE, &params->tau, "Pixel size (theta)", "[float]" },
+        { "psi", 0, 0, G_OPTION_ARG_DOUBLE, &params->psi, "Misalignment (psi)", "[float]" },
+        { "px", 0, 0, G_OPTION_ARG_DOUBLE, &params->px, "X coordinate of axis", "[float]" },
+        { "py", 0, 0, G_OPTION_ARG_DOUBLE, &params->py, "Y coordinate of axis", "[float]" },
+        { "px-variation", 0, 0, G_OPTION_ARG_DOUBLE, &params->px_variation, "X axis variation", "[float]" },
+        { "vx", 0, 0, G_OPTION_ARG_DOUBLE, &params->v_origin[0], "X coordinate of box origin", "[float]" },
+        { "vy", 0, 0, G_OPTION_ARG_DOUBLE, &params->v_origin[1], "Y coordinate of box origin", "[float]" },
+        { "vz", 0, 0, G_OPTION_ARG_DOUBLE, &params->v_origin[2], "Z coordinate of box origin", "[float]" },
+        { "vw", 0, 0, G_OPTION_ARG_INT, &params->v_size[0], "Width of box", "[int]" },
+        { "vh", 0, 0, G_OPTION_ARG_INT, &params->v_size[1], "Height of box", "[int]" },
+        { "vd", 0, 0, G_OPTION_ARG_INT, &params->v_size[2], "Depth of box", "[int]" },
         { NULL }
     };
 
@@ -336,6 +339,7 @@ main (int argc, char **argv)
         .num_radios = 0,
         .num_darks = 1,
         .theta = G_MAXDOUBLE,
+        .dark_scale = 1.0,
         .tau = 1.0,
         .psi = 0.0,
         .px = G_MAXDOUBLE,