Index: trunk/ippScripts/scripts/register_imfile.pl
===================================================================
--- trunk/ippScripts/scripts/register_imfile.pl	(revision 23501)
+++ trunk/ippScripts/scripts/register_imfile.pl	(revision 23540)
@@ -112,9 +112,9 @@
 
 # we require at a minimum: -telescope, -inst, -filelevel, -class_id, -exp_type
-if (uc(&value_for_flag ($cmdflags, "-telescope")) == 0) { &my_die ("telescope not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }
-if (uc(&value_for_flag ($cmdflags, "-inst"))      == 0) { &my_die ("inst      not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }
-if (uc(&value_for_flag ($cmdflags, "-filelevel")) == 0) { &my_die ("filelevel not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }
-if (uc(&value_for_flag ($cmdflags, "-class_id"))  == 0) { &my_die ("class_id  not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }
-if (uc(&value_for_flag ($cmdflags, "-exp_type"))  == 0) { &my_die ("exp_type  not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }
+if (uc(&value_for_flag ($cmdflags, "NULL", "-telescope")) eq "NULL") { &my_die ("telescope not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }
+if (uc(&value_for_flag ($cmdflags, "NULL", "-inst"))      eq "NULL") { &my_die ("inst      not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }
+if (uc(&value_for_flag ($cmdflags, "NULL", "-filelevel")) eq "NULL") { &my_die ("filelevel not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }
+if (uc(&value_for_flag ($cmdflags, "NULL", "-class_id"))  eq "NULL") { &my_die ("class_id  not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }
+if (uc(&value_for_flag ($cmdflags, "NULL", "-exp_type"))  eq "NULL") { &my_die ("exp_type  not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }
 
 my $command = "$regtool -addprocessedimfile";
@@ -128,10 +128,10 @@
 
 # determine solar-system parameters
-my $longitude = &value_for_flag($cmdflags, "-longitude");
-my $latitude  = &value_for_flag($cmdflags, "-latitude");
-my $elevation = &value_for_flag($cmdflags, "-elevation");
-my $ra        = &value_for_flag($cmdflags, "-ra");
-my $dec       = &value_for_flag($cmdflags, "-decl");
-my $dateobs   = &value_for_flag($cmdflags, "-dateobs");
+my $longitude = &value_for_flag($cmdflags, 0.0, "-longitude");
+my $latitude  = &value_for_flag($cmdflags, 0.0, "-latitude");
+my $elevation = &value_for_flag($cmdflags, 0.0, "-elevation");
+my $ra        = &value_for_flag($cmdflags, 0.0, "-ra");
+my $dec       = &value_for_flag($cmdflags, 0.0, "-decl");
+my $dateobs   = &value_for_flag($cmdflags, 0.0, "-dateobs");
 
 # if the needed data is available, pass it to sunmoon:
@@ -193,7 +193,8 @@
 {
     my $cmdflags = shift;
+    my $default = shift;
     my $flag = shift;
 
-    my $value = 0.0;
+    my $value = $default;
     if ($cmdflags =~ m|$flag|) {
         ($value) = $cmdflags =~ m|$flag\s+(\S+)|;
