Changeset 23186
- Timestamp:
- Mar 4, 2009, 4:17:15 PM (17 years ago)
- Location:
- trunk/ippScripts/scripts
- Files:
-
- 27 edited
-
calibrate_dvo.pl (modified) (7 diffs)
-
camera_exp.pl (modified) (3 diffs)
-
chip_imfile.pl (modified) (3 diffs)
-
detrend_correct_imfile.pl (modified) (2 diffs)
-
detrend_norm_apply.pl (modified) (2 diffs)
-
detrend_norm_calc.pl (modified) (2 diffs)
-
detrend_norm_exp.pl (modified) (2 diffs)
-
detrend_process_exp.pl (modified) (2 diffs)
-
detrend_process_imfile.pl (modified) (4 diffs)
-
detrend_reject_exp.pl (modified) (2 diffs)
-
detrend_resid_exp.pl (modified) (2 diffs)
-
detrend_resid_imfile.pl (modified) (4 diffs)
-
detrend_stack.pl (modified) (2 diffs)
-
diff_skycell.pl (modified) (2 diffs)
-
fake_imfile.pl (modified) (2 diffs)
-
ipp_cleanup.pl (modified) (9 diffs)
-
ipp_maskscript.pl (modified) (6 diffs)
-
magic_definerun.pl (modified) (2 diffs)
-
magic_destreak.pl (modified) (3 diffs)
-
magic_mask.pl (modified) (2 diffs)
-
magic_process.pl (modified) (3 diffs)
-
magic_tree.pl (modified) (2 diffs)
-
register_exp.pl (modified) (2 diffs)
-
register_imfile.pl (modified) (2 diffs)
-
stack_skycell.pl (modified) (3 diffs)
-
warp_overlap.pl (modified) (3 diffs)
-
warp_skycell.pl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/calibrate_dvo.pl
r20100 r23186 52 52 my $caltool = can_run('caltool') or (warn "Can't find caltool" and $missing_tools = 1); 53 53 54 if ($missing_tools) { 54 if ($missing_tools) { 55 55 warn ("Can't find required tools"); 56 exit($PS_EXIT_CONFIG_ERROR); 56 exit($PS_EXIT_CONFIG_ERROR); 57 57 } 58 58 … … 74 74 cache_run(command => $command, verbose => 1); 75 75 76 unless ($success) { 76 unless ($success) { 77 77 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 78 78 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $cal_id, $region, "RESORT", $status, $dbname); … … 83 83 { 84 84 foreach my $filter (@filters) { 85 my $command = "$relphot $filter";86 $command .= "-D CATDIR $dvodb";87 $command .= "-region $RAs $RAe $DECs $DECe";85 my $command = "$relphot $filter"; 86 $command .= "-D CATDIR $dvodb"; 87 $command .= "-region $RAs $RAe $DECs $DECe"; 88 88 89 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =90 cache_run(command => $command, verbose => 1);89 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 90 cache_run(command => $command, verbose => 1); 91 91 92 unless ($success) { 93 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);94 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $cal_id, $region, "RELPHOT", $status, $dbname);95 }92 unless ($success) { 93 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 94 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $cal_id, $region, "RELPHOT", $status, $dbname); 95 } 96 96 } 97 97 } … … 101 101 if (0) { 102 102 foreach my $filter (@filters) { 103 my $command = "$uniphot $filter";104 $command .= "-D CATDIR $dvodb";105 $command .= "-region $RAs $RAe $DECs $DECe";103 my $command = "$uniphot $filter"; 104 $command .= "-D CATDIR $dvodb"; 105 $command .= "-region $RAs $RAe $DECs $DECe"; 106 106 107 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =108 cache_run(command => $command, verbose => 1);107 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 108 cache_run(command => $command, verbose => 1); 109 109 110 unless ($success) { 111 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);112 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $cal_id, $region, "UNIPHOT", $status, $dbname);113 }110 unless ($success) { 111 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 112 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $cal_id, $region, "UNIPHOT", $status, $dbname); 113 } 114 114 } 115 115 } … … 121 121 122 122 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 123 cache_run(command => $command, verbose => 1);123 cache_run(command => $command, verbose => 1); 124 124 125 unless ($success) { 126 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);127 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $cal_id, $region, "RELASTRO.OBJECTS", $status, $dbname);125 unless ($success) { 126 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 127 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $cal_id, $region, "RELASTRO.OBJECTS", $status, $dbname); 128 128 } 129 129 } … … 135 135 136 136 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 137 cache_run(command => $command, verbose => 1);137 cache_run(command => $command, verbose => 1); 138 138 139 unless ($success) { 140 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);141 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $cal_id, $region, "RELASTRO.IMAGES", $status, $dbname);139 unless ($success) { 140 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 141 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $cal_id, $region, "RELASTRO.IMAGES", $status, $dbname); 142 142 } 143 143 } … … 169 169 my $region = shift; 170 170 my $last_step = shift; 171 my $status = shift;172 my $dbname = shift;171 my $status = shift; 172 my $dbname = shift; 173 173 174 174 carp($msg); 175 175 if (defined $cal_id && defined $region && defined $last_step && defined $status and not $no_update) { 176 176 my $command = "$caltool -addcalrun"; 177 $command .= " -cal_id $cal_id";177 $command .= " -cal_id $cal_id"; 178 178 $command .= " -region $region"; 179 $command .= " -last_step $last_step";180 $command .= " -state $status";179 $command .= " -last_step $last_step"; 180 $command .= " -state $status"; 181 181 $command .= " -dbname $dbname" if defined $dbname; 182 182 system ($command); -
trunk/ippScripts/scripts/camera_exp.pl
r22430 r23186 22 22 use PS::IPP::Config 1.01 qw( :standard ); 23 23 use File::Temp qw( tempfile ); 24 25 my $ipprc = PS::IPP::Config->new(); # IPP configuration26 24 27 25 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 70 68 defined $camera; 71 69 72 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 73 $SIG{__DIE__} = sub { die @_ if $^S; 74 my_die( $_[0], $cam_id, $PS_EXIT_UNKNOWN_ERROR ); }; 75 76 $ipprc->define_camera($camera); 70 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $cam_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 77 71 78 72 my $logDest = $ipprc->filename("LOG.EXP", $outroot) or &my_die("Missing entry from camera config", $cam_id, $PS_EXIT_CONFIG_ERROR); … … 84 78 85 79 if ($redirect) { 86 $ipprc->redirect_output($logDest) ;80 $ipprc->redirect_output($logDest) or my_die( "Unable to redirect output", $cam_id, $PS_EXIT_SYS_ERROR ); 87 81 print "\n\n"; 88 82 print "Starting script $0 on $host\n\n"; -
trunk/ippScripts/scripts/chip_imfile.pl
r22430 r23186 20 20 use PS::IPP::Metadata::Config; 21 21 use PS::IPP::Config 1.01 qw( :standard ); 22 23 my $ipprc = PS::IPP::Config->new(); # IPP configuration24 22 25 23 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 70 68 defined $run_state; 71 69 72 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 73 $SIG{__DIE__} = sub { die @_ if $^S; 74 my_die( $_[0], $exp_id, $chip_id, $class_id, $PS_EXIT_UNKNOWN_ERROR ); }; 75 76 $ipprc->define_camera($camera); 70 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 77 71 78 72 my $logDest = $ipprc->filename("LOG.IMFILE", $outroot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR); … … 80 74 81 75 if ($redirect) { 82 $ipprc->redirect_output($logDest) ;76 $ipprc->redirect_output($logDest) or my_die( "Unable to redirect output", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR ); 83 77 print STDOUT "\n\n"; 84 78 print STDOUT "Starting script $0 on $host\n\n"; -
trunk/ippScripts/scripts/detrend_correct_imfile.pl
r22430 r23186 18 18 use PS::IPP::Metadata::Config; 19 19 use PS::IPP::Config 1.01 qw( :standard ); 20 21 my $ipprc = PS::IPP::Config->new(); # IPP configuration22 20 23 21 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 60 58 and defined $camera; 61 59 62 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 63 $SIG{__DIE__} = sub { die @_ if $^S; 64 my_die( $_[0], $det_id, $class_id, $PS_EXIT_UNKNOWN_ERROR ); }; 65 66 # XXX this exits with status = 0 on failure 67 $ipprc->define_camera($camera); 68 60 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $det_id, $class_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 69 61 if ($redirect) { 70 62 my $logDest = $ipprc->filename("LOG.IMFILE", $outroot, $class_id) 71 63 or &my_die("Missing entry from camera config", $det_id, $class_id, $PS_EXIT_CONFIG_ERROR); 72 $ipprc->redirect_output($logDest) ;64 $ipprc->redirect_output($logDest) or my_die( "Unable to redirect output", $det_id, $class_id, $PS_EXIT_SYS_ERROR ); 73 65 } 74 66 -
trunk/ippScripts/scripts/detrend_norm_apply.pl
r22430 r23186 17 17 use PS::IPP::Metadata::Config; 18 18 use PS::IPP::Config 1.01 qw( :standard ); 19 20 my $ipprc = PS::IPP::Config->new(); # IPP configuration21 19 22 20 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 64 62 defined $outroot; 65 63 66 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 67 $SIG{__DIE__} = sub { die @_ if $^S; 68 my_die( $_[0], $det_id, $iter, $class_id, $PS_EXIT_UNKNOWN_ERROR ); }; 69 70 $ipprc->define_camera($camera); 64 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 71 65 72 66 my $logDest = $ipprc->filename("LOG.IMFILE", $outroot, $class_id) 73 67 or &my_die("Missing entry from camera config", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR); 74 $ipprc->redirect_output($logDest) if $redirect;68 $ipprc->redirect_output($logDest) or my_die( "Unable to redirect output", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR ) if $redirect; 75 69 76 70 my $RECIPE_PPIMAGE = 'PPIMAGE_N'; # Recipe to use with ppImage -
trunk/ippScripts/scripts/detrend_norm_calc.pl
r22430 r23186 19 19 use PS::IPP::Metadata::List qw( parse_md_list ); 20 20 use PS::IPP::Config 1.01 qw( :standard ); 21 22 my $ipprc = PS::IPP::Config->new(); # IPP configuration23 21 24 22 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 57 55 defined $outroot; 58 56 59 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 60 $SIG{__DIE__} = sub { die @_ if $^S; 61 my_die( $_[0], $det_id, $iter, $PS_EXIT_UNKNOWN_ERROR ); }; 57 my $ipprc = PS::IPP::Config->new() or my_die( "Unable to set up", $det_id, $iter, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 62 58 63 59 my $logfile = $outroot . ".log"; 64 65 $ipprc->redirect_output($logfile) if $redirect; 60 $ipprc->redirect_output($logfile) or my_die( "Unable to redirect output", $det_id, $iter, $PS_EXIT_SYS_ERROR ) if $redirect; 66 61 67 62 use constant STATISTIC => 'bg'; # Background statistic to use from the database -
trunk/ippScripts/scripts/detrend_norm_exp.pl
r22430 r23186 19 19 use PS::IPP::Metadata::List qw( parse_md_list ); 20 20 use File::Temp qw( tempfile ); 21 22 my $ipprc = PS::IPP::Config->new(); # IPP configuration23 21 24 22 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 60 58 defined $outroot; 61 59 62 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 63 $SIG{__DIE__} = sub { die @_ if $^S; 64 my_die( $_[0], $det_id, $iter, $PS_EXIT_UNKNOWN_ERROR ); }; 65 60 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $det_id, $iter, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 66 61 my $logfile = $outroot . ".log"; 67 68 $ipprc->redirect_output($logfile) if $redirect; 69 70 $ipprc->define_camera($camera); 62 $ipprc->redirect_output($logfile) or my_die( "Unable to redirect output", $det_id, $iter, $PS_EXIT_SYS_ERROR ) if $redirect; 71 63 72 64 # Recipes to use based on reduction class -
trunk/ippScripts/scripts/detrend_process_exp.pl
r22430 r23186 19 19 use PS::IPP::Metadata::List qw( parse_md_list ); 20 20 use File::Temp qw( tempfile ); 21 22 my $ipprc = PS::IPP::Config->new(); # IPP configuration23 21 24 22 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 63 61 defined $outroot; 64 62 65 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 66 $SIG{__DIE__} = sub { die @_ if $^S; 67 my_die( $_[0], $det_id, $exp_id, $PS_EXIT_UNKNOWN_ERROR ); }; 68 69 $ipprc->define_camera($camera); 70 63 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $det_id, $exp_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 71 64 if ($redirect) { 72 65 my $logDest = $ipprc->filename("LOG.EXP", $outroot, "NONE") 73 66 or &my_die("Missing entry in file rules", $det_id, $exp_id, $PS_EXIT_CONFIG_ERROR); 74 $ipprc->redirect_output($logDest) ;67 $ipprc->redirect_output($logDest) or my_die( "Unable to redirect output", $det_id, $exp_id, $PS_EXIT_SYS_ERROR ); 75 68 } 76 69 -
trunk/ippScripts/scripts/detrend_process_imfile.pl
r23183 r23186 17 17 use PS::IPP::Metadata::Config; 18 18 use PS::IPP::Config 1.01 qw( :standard ); 19 20 my $ipprc = PS::IPP::Config->new(); # IPP configuration21 19 22 20 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 65 63 defined $outroot; 66 64 67 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 68 $SIG{__DIE__} = sub { die @_ if $^S; 69 my_die( $_[0], $det_id, $exp_id, $class_id, $PS_EXIT_UNKNOWN_ERROR ); }; 70 71 # XXX this exits with status = 0 on failure 72 $ipprc->define_camera($camera); 73 65 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $det_id, $exp_id, $class_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 74 66 my $logDest = $ipprc->filename("LOG.IMFILE", $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_CONFIG_ERROR); 75 76 $ipprc->redirect_output($logDest) if $redirect; 67 $ipprc->redirect_output($logDest) or my_die( "Unable to redirect output", $det_id, $exp_id, $class_id, $PS_EXIT_SYS_ERROR ) if $redirect; 77 68 78 69 # Recipes to use as a function of detrend type … … 113 104 my $cmdflags; 114 105 115 my $outputImage = $ipprc->filename("PPIMAGE.OUTPUT", $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR); 106 my $filerule = $FILERULES->{$det_type}; # File rule to use for output 107 $filerule = "PPIMAGE.OUTPUT" unless defined $filerule; 108 109 my $outputImage = $ipprc->filename($filerule, $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR); 116 110 my $outputBin1 = $ipprc->filename("PPIMAGE.BIN1", $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR); 117 111 my $outputBin2 = $ipprc->filename("PPIMAGE.BIN2", $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR); 118 112 my $outputStats = $ipprc->filename("PPIMAGE.STATS", $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR); 119 113 my $traceDest = $ipprc->filename("TRACE.IMFILE", $outroot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $exp_id, $class_id, $PS_EXIT_CONFIG_ERROR); 114 115 120 116 # Run ppImage 121 117 unless ($no_op) { … … 125 121 $command .= " -recipe PPSTATS DETSTATS"; 126 122 $command .= " -stats $outputStats"; 127 $command .= " -F PPIMAGE.OUTPUT $FILERULES{$det_type}" if defined $FILERULES{$det_type}; 128 123 $command .= " -F PPIMAGE.OUTPUT $filerule" if $filerule ne "PPIMAGE.OUTPUT"; 129 124 $command .= " -tracedest $traceDest -log $logDest"; 130 125 $command .= " -threads $threads" if defined $threads; -
trunk/ippScripts/scripts/detrend_reject_exp.pl
r22430 r23186 20 20 use PS::IPP::Metadata::List qw( parse_md_list ); 21 21 use Statistics::Descriptive; 22 23 my $ipprc = PS::IPP::Config->new(); # IPP configuration24 22 25 23 my $ITER_LIMIT = 20; … … 60 58 defined $outroot; 61 59 62 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 63 $SIG{__DIE__} = sub { die @_ if $^S; 64 my_die( $_[0], $det_id, $iter, $PS_EXIT_UNKNOWN_ERROR ); }; 65 66 # check for existing directory, generate if needed 67 $ipprc->outroot_prepare($outroot); 68 60 my $ipprc = PS::IPP::Config->new() or my_die( "Unable to set up", $det_id, $iter, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 61 $ipprc->outroot_prepare($outroot) or my_die( "Unable to prepare output root", $det_id, $iter, $PS_EXIT_SYS_ERROR ); 69 62 my $logName = "$outroot.log"; # Name for log 70 71 $ipprc->redirect_output($logName) if $redirect; 63 $ipprc->redirect_output($logName) or my_die( "Unable to redirect", $det_id, $iter, $PS_EXIT_SYS_ERROR ) if $redirect; 72 64 73 65 # values to extract from output metadata and the stats to calculate -
trunk/ippScripts/scripts/detrend_resid_exp.pl
r22430 r23186 30 30 use File::Temp qw( tempfile ); # tools to construct temp files 31 31 use PS::IPP::Config 1.01 qw( :standard ); 32 33 my $ipprc = PS::IPP::Config->new(); # IPP configuration34 32 35 33 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); # option parsing … … 79 77 defined $outroot; 80 78 81 # Unhandled exceptions should be passed on to my_die so they get pushed into the database82 $SIG{__DIE__} = sub { die @_ if $^S;83 my_die( $_[0], $det_id, $iter, $exp_id, $PS_EXIT_UNKNOWN_ERROR ); };84 85 79 # load IPP config information for the specified camera 86 $ipprc->define_camera($camera); 87 80 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $det_id, $iter, $exp_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 88 81 my $logDest = $ipprc->filename("LOG.EXP", $outroot) or &my_die("Missing entry from camera config", $det_id, $iter, $exp_id, $PS_EXIT_CONFIG_ERROR); 89 90 $ipprc->redirect_output($logDest) if $redirect; 82 $ipprc->redirect_output($logDest) or my_die( "Unable to redirect output", $det_id, $iter, $exp_id, $PS_EXIT_SYS_ERROR ) if $redirect; 91 83 92 84 # Recipes to use based on reduction class -
trunk/ippScripts/scripts/detrend_resid_imfile.pl
r23183 r23186 17 17 use PS::IPP::Metadata::Config; 18 18 use PS::IPP::Config 1.01 qw( :standard ); 19 20 my $ipprc = PS::IPP::Config->new(); # IPP configuration21 19 22 20 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 76 74 defined $detrend; 77 75 78 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 79 $SIG{__DIE__} = sub { die @_ if $^S; 80 my_die( $_[0], $det_id, $iter, $exp_id, $class_id, $PS_EXIT_UNKNOWN_ERROR ); }; 81 82 $ipprc->define_camera($camera); 83 my $logDest = $ipprc->filename("LOG.IMFILE", $outroot, $class_id); 84 if ($redirect) { 85 $ipprc->redirect_output($logDest); 86 } 76 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $det_id, $iter, $exp_id, $class_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 77 my $logDest = $ipprc->filename("LOG.IMFILE", $outroot, $class_id) or my_die( "Unable to find LOG.IMFILE", $det_id, $iter, $exp_id, $class_id, $PS_EXIT_CONFIG_ERROR ); 78 $ipprc->redirect_output($logDest) or my_die( "Unable to find LOG.IMFILE", $det_id, $iter, $exp_id, $class_id, $PS_EXIT_SYS_ERROR ) if $redirect; 87 79 88 80 # Recipes to use as a function of detrend type and mode … … 155 147 # my $outputName = $ipprc->filename("PPIMAGE.OUTPUT", $outroot, $class_id); 156 148 157 my $outputName = $ipprc->filename("PPIMAGE.OUTPUT.RESID", $outroot, $class_id); 149 my $filerule = $FILERULES->{$det_type}; # File rule to use 150 151 my $outputName = $ipprc->filename($filerule, $outroot, $class_id); 158 152 my $bin1Name = $ipprc->filename("PPIMAGE.BIN1", $outroot, $class_id); 159 153 my $bin2Name = $ipprc->filename("PPIMAGE.BIN2", $outroot, $class_id); … … 169 163 $command .= " -recipe JPEG $jpeg_recipe"; 170 164 $command .= " -recipe PPSTATS RESIDUAL"; 171 $command .= " -F PPIMAGE.OUTPUT $ FILERULES{$det_type}" if defined $FILERULES{$det_type};165 $command .= " -F PPIMAGE.OUTPUT $filerule"; 172 166 $command .= " -stats $outputStats"; 173 167 $command .= " -tracedest $traceDest -log $logDest"; -
trunk/ippScripts/scripts/detrend_stack.pl
r22430 r23186 18 18 use PS::IPP::Metadata::List qw( parse_md_list ); 19 19 use PS::IPP::Config 1.01 qw( :standard ); 20 21 my $ipprc = PS::IPP::Config->new(); # IPP configuration22 20 23 21 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 63 61 defined $outroot; 64 62 65 $ipprc->define_camera($camera);66 63 $det_type = uc($det_type); 67 64 65 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 68 66 my $logDest = $ipprc->filename("LOG.IMFILE", $outroot, $class_id) 69 67 or &my_die("Missing entry in file rules", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR); 70 71 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 72 $SIG{__DIE__} = sub { die @_ if $^S; 73 my_die( $_[0], $det_id, $iter, $class_id, $PS_EXIT_UNKNOWN_ERROR ); }; 74 75 # optionally redirect the outputs from this script to LOG.IMFILE 76 $ipprc->redirect_output($logDest) if $redirect; 68 $ipprc->redirect_output($logDest) or my_die( "Unable to redirect output", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR ) if $redirect; 77 69 78 70 # Recipes to use as a function of detrend type -
trunk/ippScripts/scripts/diff_skycell.pl
r22433 r23186 21 21 use Data::Dumper; 22 22 use PS::IPP::Config 1.01 qw( :standard ); 23 24 my $ipprc = PS::IPP::Config->new(); # IPP configuration25 23 26 24 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 62 60 and defined $outroot; 63 61 64 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 65 $SIG{__DIE__} = sub { die @_ if $^S; 66 my_die( $_[0], $diff_id, $skycell_id, $PS_EXIT_UNKNOWN_ERROR ); }; 62 my $ipprc = PS::IPP::Config->new() or my_die( "Unable to set up", $diff_id, $skycell_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 67 63 68 64 # XXX camera is not known here; cannot use filerules... 69 65 # my $logDest = $ipprc->filename("LOG.EXP", $outroot); 70 66 my $logDest = "$outroot.log"; 71 $ipprc->redirect_output($logDest) if $redirect;67 $ipprc->redirect_output($logDest) or my_die( "Unable to redirect output", $diff_id, $skycell_id, $PS_EXIT_SYS_ERROR ) if $redirect; 72 68 73 69 my $source_id = $ipprc->source_id($dbname, $PS_TABLE_ID_DIFF); -
trunk/ippScripts/scripts/fake_imfile.pl
r22430 r23186 36 36 use PS::IPP::Metadata::Config; 37 37 use PS::IPP::Config 1.01 qw( :standard ); 38 39 my $ipprc = PS::IPP::Config->new(); # IPP configuration40 38 41 39 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 82 80 defined $outroot; 83 81 84 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 85 $SIG{__DIE__} = sub { die @_ if $^S; 86 my_die( $_[0], $exp_id, $fake_id, $class_id, $PS_EXIT_UNKNOWN_ERROR ); }; 87 88 $ipprc->define_camera($camera); 89 90 my $logDest = $ipprc->filename("LOG.IMFILE", $outroot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $fake_id, $class_id, $PS_EXIT_CONFIG_ERROR); 91 92 $ipprc->redirect_output($logDest) if $redirect; 82 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $exp_id, $fake_id, $class_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 83 my $logDest = $ipprc->filename("LOG.IMFILE", $outroot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $fake_id, $class_id, $PS_EXIT_CONFIG_ERROR); 84 $ipprc->redirect_output($logDest) or my_die( "Unable to redirect output", $exp_id, $fake_id, $class_id, $PS_EXIT_SYS_ERROR ) if $redirect; 93 85 94 86 # Recipes to use based on reduction class -
trunk/ippScripts/scripts/ipp_cleanup.pl
r22750 r23186 18 18 use Pod::Usage qw( pod2usage ); 19 19 20 my $ipprc = PS::IPP::Config->new(); # this is used for PATH, NEB filename conversions21 22 20 # Parse the command-line arguments 23 21 my ($stage, $camera, $stage_id, $mode, $path_base, $dbname, $verbose, $no_op, $helplist); 24 22 GetOptions('stage=s' => \$stage, # which analysis stage to clean? 25 'camera|i=s' => \$camera, # user-supplied camera name26 'stage_id=s' => \$stage_id, # id for this stage (only needed for certain stages)27 'mode|m=s' => \$mode, # cleanup mode (clean / purge)28 'path_base=s' => \$path_base, # basename for files29 'dbname|d=s' => \$dbname, # Database name23 'camera|i=s' => \$camera, # user-supplied camera name 24 'stage_id=s' => \$stage_id, # id for this stage (only needed for certain stages) 25 'mode|m=s' => \$mode, # cleanup mode (clean / purge) 26 'path_base=s' => \$path_base, # basename for files 27 'dbname|d=s' => \$dbname, # Database name 30 28 'verbose' => \$verbose, # Print to stdout 31 'no-op' => \$no_op, # pretend but don't actually inject32 'helplist' => \$helplist # give help listing33 ) or pod2usage( 2 );34 35 pod2usage( -msg => "remove temporary / all data files for an IPP analysis stage", 36 -exitval => 2) if defined $helplist;37 38 pod2usage( -msg => "Usage: $0 --camera (name) --stage (stage) --stage_id (stage_id) --mode (mode) [--path_base (path)] [--dbname dbname] [--no-op] [--help]", 39 -exitval => 2 ) if scalar @ARGV;29 'no-op' => \$no_op, # pretend but don't actually inject 30 'helplist' => \$helplist # give help listing 31 ) or pod2usage( 2 ); 32 33 pod2usage( -msg => "remove temporary / all data files for an IPP analysis stage", 34 -exitval => 2) if defined $helplist; 35 36 pod2usage( -msg => "Usage: $0 --camera (name) --stage (stage) --stage_id (stage_id) --mode (mode) [--path_base (path)] [--dbname dbname] [--no-op] [--help]", 37 -exitval => 2 ) if scalar @ARGV; 40 38 41 39 pod2usage( -msg => "Required options:--camera (name) --stage (stage) --mode (mode)", 42 -exitval => 3) unless 40 -exitval => 3) unless 43 41 defined $camera and 44 42 defined $stage and 45 43 defined $mode; 46 44 45 my $ipprc = PS::IPP::Config->new( $camera ) or my_die("Unable to set up", $stage_id, $PS_EXIT_CONFIG_ERROR); # this is used for PATH, NEB filename conversions 46 47 47 # $mode must be one of "goto_cleaned", "goto_scrubbed", or "goto_purged" 48 # goto_cleaned and goto_scrubbed both result in 'cleaned': scrubbed allows chips without config files to 48 # goto_cleaned and goto_scrubbed both result in 'cleaned': scrubbed allows chips without config files to 49 49 # be cleaned (they cannot be recovered, but the small data is left behind) 50 50 unless (($mode eq "goto_cleaned") || ($mode eq "goto_scrubbed") || ($mode eq "goto_purged")) { 51 die "invalid cleanup mode $mode\n"; 51 die "invalid cleanup mode $mode\n"; 52 52 } 53 53 … … 57 57 } 58 58 59 $ipprc->define_camera($camera);60 61 59 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 62 60 63 61 # choice of files to delete depends on the stage 64 62 if ($stage eq "chip") { 65 63 66 64 die "--stage_id required for stage chip\n" if !$stage_id; 67 65 ### select the imfiles for this entry … … 89 87 # loop over all of the imfiles, determine the path_base and class_id for each 90 88 foreach my $imfile (@$imfiles) { 91 my $class_id = $imfile->{class_id};92 my $path_base = $imfile->{path_base};89 my $class_id = $imfile->{class_id}; 90 my $path_base = $imfile->{path_base}; 93 91 my $status = 1; 94 92 95 93 # don't clean up unless the data needed to update is available 96 # modes goto_purged and goto_scrubbed will remove files even if the config is non-existent94 # modes goto_purged and goto_scrubbed will remove files even if the config is non-existent 97 95 if ($mode eq "goto_cleaned") { 98 96 my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base, $class_id); … … 127 125 addFilename (\@files, "PPIMAGE.CONFIG", $path_base, $class_id); 128 126 } 129 127 130 128 # actual command to delete the files 131 129 $status = &delete_files (\@files); 132 130 } 133 131 134 if ($status) {135 my $command = "$chiptool -chip_id $stage_id -class_id $class_id";132 if ($status) { 133 my $command = "$chiptool -chip_id $stage_id -class_id $class_id"; 136 134 if ($mode eq "goto_purged") { 137 135 $command .= " -topurgedimfile"; 138 136 } elsif ($mode eq "goto_scrubbed") { 139 137 $command .= " -tocleanedimfile_from_scrubbed"; 140 } else {138 } else { 141 139 $command .= " -tocleanedimfile"; 142 140 } 143 $command .= " -dbname $dbname" if defined $dbname;144 145 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =141 $command .= " -dbname $dbname" if defined $dbname; 142 143 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 146 144 run(command => $command, verbose => $verbose); 147 unless ($success) {148 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);149 &my_die("Unable to perform chiptool: $error_code", "chip", $stage_id, $error_code);150 }145 unless ($success) { 146 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 147 &my_die("Unable to perform chiptool: $error_code", "chip", $stage_id, $error_code); 148 } 151 149 } else { 152 # if an error happens for one chip, the chipRun will stay in goto_*, but the chips will stop be run153 my $command = "$chiptool -updateprocessedimfile -chip_id $stage_id -class_id $class_id -code 1";154 $command .= " -dbname $dbname" if defined $dbname;155 156 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =150 # if an error happens for one chip, the chipRun will stay in goto_*, but the chips will stop be run 151 my $command = "$chiptool -updateprocessedimfile -chip_id $stage_id -class_id $class_id -code 1"; 152 $command .= " -dbname $dbname" if defined $dbname; 153 154 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 157 155 run(command => $command, verbose => $verbose); 158 unless ($success) {159 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);160 &my_die("Unable to perform chiptool: $error_code", "chip", $stage_id, $error_code);161 }162 }156 unless ($success) { 157 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 158 &my_die("Unable to perform chiptool: $error_code", "chip", $stage_id, $error_code); 159 } 160 } 163 161 } 164 162 exit 0; 165 } 163 } 166 164 167 165 if ($stage eq "camera") { … … 244 242 } 245 243 exit 0; 246 } 244 } 247 245 248 246 if ($stage eq "warp") { … … 305 303 } 306 304 307 if ($status) {308 my $command = "$warptool -warp_id $stage_id -skycell_id $skycell_id";305 if ($status) { 306 my $command = "$warptool -warp_id $stage_id -skycell_id $skycell_id"; 309 307 if ($mode eq "goto_purged") { 310 308 $command .= " -topurgedskyfile"; … … 312 310 $command .= " -tocleanedskyfile"; 313 311 } 314 $command .= " -dbname $dbname" if defined $dbname;315 316 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =312 $command .= " -dbname $dbname" if defined $dbname; 313 314 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 317 315 run(command => $command, verbose => $verbose); 318 unless ($success) {319 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);320 &my_die("Unable to perform warptool: $error_code", "warp", $stage_id, $error_code);321 }316 unless ($success) { 317 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 318 &my_die("Unable to perform warptool: $error_code", "warp", $stage_id, $error_code); 319 } 322 320 } else { 323 321 # XXX: -updateskyfile mode does not exist, need to add it 324 my $command = "$warptool -updateskyfile -warp_id $stage_id -skycell_id $skycell_id -code 1";325 $command .= " -dbname $dbname" if defined $dbname;322 my $command = "$warptool -updateskyfile -warp_id $stage_id -skycell_id $skycell_id -code 1"; 323 $command .= " -dbname $dbname" if defined $dbname; 326 324 327 325 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 328 326 run(command => $command, verbose => $verbose); 329 unless ($success) {330 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);331 &my_die("Unable to perform warptool: $error_code", "warp", $stage_id, $error_code);332 }327 unless ($success) { 328 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 329 &my_die("Unable to perform warptool: $error_code", "warp", $stage_id, $error_code); 330 } 333 331 exit $PS_EXIT_UNKNOWN_ERROR; 334 }332 } 335 333 } 336 334 exit 0; … … 344 342 die "ipp_cleanup.pl -stage $stage not yet implemented\n"; 345 343 346 sub delete_files 344 sub delete_files 347 345 { 348 346 my $files = shift; # reference to a list of files to unlink 349 350 # this script is, of course, very dangerous. 347 348 # this script is, of course, very dangerous. 351 349 foreach my $file (@$files) { 352 print STDERR "unlinking $file\n";350 print STDERR "unlinking $file\n"; 353 351 $ipprc->file_delete($file); 354 352 } … … 356 354 } 357 355 358 sub addFilename 356 sub addFilename 359 357 { 360 358 my $files = shift; # reference to a list of files to unlink -
trunk/ippScripts/scripts/ipp_maskscript.pl
r17671 r23186 12 12 use PS::IPP::Config 1.01 qw( :standard ); 13 13 14 my $ipprc = PS::IPP::Config->new(); # IPP configuration15 16 14 my ($dbname, $det_id, $camera); 17 18 15 GetOptions('dbname=s' => \$dbname, 19 'det_id=s' => \$det_id,20 'camera|c=s' => \$camera,21 ) or pod2usage( 2 );16 'det_id=s' => \$det_id, 17 'camera|c=s' => \$camera, 18 ) or pod2usage( 2 ); 22 19 23 20 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 24 21 25 22 pod2usage( 26 -msg => "USAGE: ipp_maskscript.pl --dbname (name) --det_id (id) --iter (iteration) --camera (name)",27 -exitval => 3,28 ) unless defined $dbname and defined $det_id and defined $camera;23 -msg => "USAGE: ipp_maskscript.pl --dbname (name) --det_id (id) --iter (iteration) --camera (name)", 24 -exitval => 3, 25 ) unless defined $dbname and defined $det_id and defined $camera; 29 26 30 27 # I could determine the camera from a query for the detrun 31 $ipprc->define_camera($camera); 28 my $ipprc = PS::IPP::Config->new( $camera ) or my_die("Unable to setup", $PS_EXIT_CONFIG_ERROR); # IPP configuration 32 29 33 30 ### Get list of dark imfile results … … 47 44 48 45 # parse the output into a list 49 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files46 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 50 47 my $metadata = $mdcParser->parse(join "", @$stdout_buf) or 51 48 &my_die("Unable to parse metadata config doc", $PS_EXIT_PROG_ERROR); … … 81 78 # print STDERR "contents: @contents\n"; 82 79 83 my $parser = PS::IPP::Metadata::Config->new; # Parser for metadata config files80 my $parser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 84 81 my $statsList = $parser->parse(join "", @contents) or &my_die("Unable to parse metadata for imfile stats", $PS_EXIT_SYS_ERROR); 85 82 … … 110 107 open (DATA, ">$component.dat"); 111 108 for (my $i = 0; $i < @{$nameX}; $i++) { 112 print DATA "${$nameX}[$i] ${$nameY}[$i]\n";109 print DATA "${$nameX}[$i] ${$nameY}[$i]\n"; 113 110 } 114 111 close (DATA); … … 147 144 my ($exp_time, $tag, $md) = @_; 148 145 149 # descend through the fpa 146 # descend through the fpa 150 147 foreach my $entry (@$md) { 151 # print STDERR "name: $entry->{name}, class: $entry->{class}\n";148 # print STDERR "name: $entry->{name}, class: $entry->{class}\n"; 152 149 # recurse on nested metadata 153 150 if ($entry->{class} eq 'metadata') { 154 my $newtag = $tag . "_" . $entry->{name};151 my $newtag = $tag . "_" . $entry->{name}; 155 152 &parse_stats_table ($exp_time, $newtag, $entry->{value}); 156 153 } … … 161 158 push @bg_stdev_data, $entry->{value}; 162 159 } else { 163 push @bg_name, $tag;160 push @bg_name, $tag; 164 161 push @bg_data, $entry->{value}; 165 push @bg_exptime, $exp_time;166 # print STDERR "$tag $exp_time $entry->{value}\n";162 push @bg_exptime, $exp_time; 163 # print STDERR "$tag $exp_time $entry->{value}\n"; 167 164 } 168 if (!$componentsHash{$tag}) {169 push @components, $tag;170 $componentsHash{$tag} = 1;171 }172 next;173 } 165 if (!$componentsHash{$tag}) { 166 push @components, $tag; 167 $componentsHash{$tag} = 1; 168 } 169 next; 170 } 174 171 } 175 172 return 1; -
trunk/ippScripts/scripts/magic_definerun.pl
r21006 r23186 25 25 use PS::IPP::Config 1.01 qw( :standard ); 26 26 27 my $ipprc = PS::IPP::Config->new(); # IPP configuration28 29 27 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); 30 28 use Pod::Usage qw( pod2usage ); 31 29 30 # Look for programs we need 31 my $missing_tools; 32 my $magictool = can_run('magictool') or (warn "Can't find magictool" and $missing_tools = 1); 33 my $difftool = can_run('difftool') or (warn "Can't find difftool" and $missing_tools = 1); 34 my $warptool = can_run('warptool') or (warn "Can't find warptool" and $missing_tools = 1); 35 if ($missing_tools) { 36 warn("Can't find required tools."); 37 exit($PS_EXIT_CONFIG_ERROR); 38 } 39 32 40 # Parse the command-line arguments 33 41 my ($exp_id, $warp_id, $min_diff_id, $label, $workdir, $dbname, $save_temps, $verbose); 34 35 42 GetOptions( 36 43 'exp_id=s' => \$exp_id, # exposure identifier … … 50 57 defined $warp_id; 51 58 52 # $ipprc->define_camera($camera); 53 54 # Look for programs we need 55 my $missing_tools; 56 my $magictool = can_run('magictool') or (warn "Can't find magictool" and $missing_tools = 1); 57 my $difftool = can_run('difftool') or (warn "Can't find difftool" and $missing_tools = 1); 58 my $warptool = can_run('warptool') or (warn "Can't find warptool" and $missing_tools = 1); 59 if ($missing_tools) { 60 warn("Can't find required tools."); 61 exit($PS_EXIT_CONFIG_ERROR); 62 } 59 my $ipprc = PS::IPP::Config->new() or my_die("Unable to set up", $PS_EXIT_CONFIG_ERROR); # IPP configuration 63 60 64 61 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files -
trunk/ippScripts/scripts/magic_destreak.pl
r22430 r23186 21 21 22 22 use PS::IPP::Config 1.01 qw( :standard ); 23 24 my $ipprc = PS::IPP::Config->new(); # IPP configuration25 23 26 24 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 76 74 defined $outroot; 77 75 78 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 79 $SIG{__DIE__} = sub { die @_ if $^S; 80 my_die( $_[0], $magic_ds_id, $component, $PS_EXIT_UNKNOWN_ERROR ); }; 81 76 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 77 $ipprc->redirect_output($logfile) or my_die( "Unable to redirect output", $magic_ds_id, $component, $PS_EXIT_SYS_ERROR ) if $logfile; 82 78 83 79 my ($skycell_args, $class_id, $skycell_id); … … 94 90 &my_die("Invalid value for stage: $stage", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR); 95 91 } 96 97 $ipprc->redirect_output($logfile) if $logfile;98 99 $ipprc->define_camera($camera);100 101 92 102 93 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files -
trunk/ippScripts/scripts/magic_mask.pl
r22430 r23186 22 22 23 23 use PS::IPP::Config 1.01 qw( :standard ); 24 25 my $ipprc = PS::IPP::Config->new(); # IPP configuration26 24 27 25 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 58 56 defined $outroot; 59 57 60 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 61 $SIG{__DIE__} = sub { die @_ if $^S; 62 my_die( $_[0], $magic_id, $PS_EXIT_UNKNOWN_ERROR ); }; 63 64 $ipprc->define_camera($camera); 65 66 $ipprc->redirect_output($logfile) if $logfile; 58 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $magic_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 59 $ipprc->redirect_output($logfile) or my_die( "Unable to redirect output", $magic_id, $PS_EXIT_SYS_ERROR ) if $logfile; 67 60 68 61 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files -
trunk/ippScripts/scripts/magic_process.pl
r22430 r23186 23 23 24 24 use PS::IPP::Config 1.01 qw( :standard ); 25 26 my $ipprc = PS::IPP::Config->new(); # IPP configuration27 25 28 26 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 62 60 defined $outroot; 63 61 64 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 65 $SIG{__DIE__} = sub { die @_ if $^S; 66 my_die( $_[0], $magic_id, $node, $PS_EXIT_UNKNOWN_ERROR ); }; 67 68 $ipprc->define_camera($camera); 62 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $magic_id, $node, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 63 $ipprc->redirect_output($logfile) or my_die( "Unable to redirect output", $magic_id, $node, $PS_EXIT_SYS_ERROR ) if $logfile; 69 64 70 65 # RemoveStreaks doesn't know about nebulous. It expects to be able to append strings to outroot … … 73 68 # of the file names as arguments 74 69 if ($outroot =~ 'neb:/') { 75 &my_die("RemoveStreaks does not support nebulous paths in outroot", $magic_id, $node, 76 $PS_EXIT_CONFIG_ERROR); 70 &my_die("RemoveStreaks does not support nebulous paths in outroot", $magic_id, $node, $PS_EXIT_CONFIG_ERROR); 77 71 } 78 72 79 73 # resolve any path:// or file:// in outroot 80 74 $outroot = $ipprc->file_resolve($outroot); 81 82 $ipprc->redirect_output($logfile) if $logfile;83 75 84 76 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files -
trunk/ippScripts/scripts/magic_tree.pl
r22430 r23186 24 24 use File::Temp qw( tempfile ); 25 25 use PS::IPP::Config 1.01 qw( :standard ); 26 27 my $ipprc = PS::IPP::Config->new(); # IPP configuration28 26 29 27 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 70 68 defined $outroot; 71 69 72 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 73 $SIG{__DIE__} = sub { die @_ if $^S; 74 my_die( $_[0], $magic_id, $PS_EXIT_UNKNOWN_ERROR ); }; 75 76 $ipprc->define_camera($camera); 77 78 $ipprc->redirect_output($logfile) if $logfile; 70 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $magic_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 71 $ipprc->redirect_output($logfile) or my_die( "Unable to redirect output", $magic_id, $PS_EXIT_SYS_ERROR ) if $logfile; 79 72 80 73 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files -
trunk/ippScripts/scripts/register_exp.pl
r22430 r23186 24 24 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); 25 25 use Pod::Usage qw( pod2usage ); 26 27 my $ipprc = PS::IPP::Config->new();28 26 29 27 # Look for commands we need … … 53 51 ) or pod2usage( 2 ); 54 52 55 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 56 $SIG{__DIE__} = sub { die @_ if $^S; 57 my_die( $_[0], $exp_id, $PS_EXIT_UNKNOWN_ERROR ); }; 58 59 $ipprc->redirect_output($logfile) if $logfile; 53 my $ipprc = PS::IPP::Config->new() or my_die( "Unable to set up", $exp_id, $PS_EXIT_CONFIG_ERROR ); 54 $ipprc->redirect_output($logfile) or my_die( "Unable to redirect output", $exp_id, $PS_EXIT_SYS_ERROR ) if $logfile; 60 55 61 56 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; -
trunk/ippScripts/scripts/register_imfile.pl
r22428 r23186 23 23 use Math::Trig; 24 24 25 my $ipprc = PS::IPP::Config->new(); # IPP configuration26 25 use File::Spec; 27 26 … … 49 48 ) or pod2usage( 2 ); 50 49 51 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 52 $SIG{__DIE__} = sub { die @_ if $^S; 53 my_die( $_[0], $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_UNKNOWN_ERROR ); }; 54 55 $ipprc->redirect_output($logfile) if $logfile; 50 my $ipprc = PS::IPP::Config->new() or my_die( "Unable to set up", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 51 $ipprc->redirect_output($logfile) or my_die( "Unable to redirect output", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_SYS_ERROR ) if $logfile; 56 52 57 53 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; -
trunk/ippScripts/scripts/stack_skycell.pl
r22430 r23186 24 24 use File::Basename; 25 25 use PS::IPP::Config 1.01 qw( :standard ); 26 27 my $ipprc = PS::IPP::Config->new(); # IPP configuration28 26 29 27 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 66 64 and defined $run_state; 67 65 68 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 69 $SIG{__DIE__} = sub { die @_ if $^S; 70 my_die( $_[0], $stack_id, $PS_EXIT_UNKNOWN_ERROR ); }; 66 my $ipprc = PS::IPP::Config->new() or my_die( "Unable to set up", $stack_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 71 67 72 68 # XXX camera is not known here; cannot use filerules... … … 81 77 } 82 78 83 $ipprc->redirect_output($logDest) if $redirect;79 $ipprc->redirect_output($logDest) or my_die( "Unable to redirect output", $stack_id, $PS_EXIT_SYS_ERROR ) if $redirect; 84 80 85 81 my $temp_images_exist = 0; -
trunk/ippScripts/scripts/warp_overlap.pl
r22430 r23186 23 23 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); 24 24 use Pod::Usage qw( pod2usage ); 25 26 my $ipprc = PS::IPP::Config->new(); # IPP configuration27 25 28 26 # Look for programs we need … … 49 47 ) or pod2usage( 2 ); 50 48 51 $ipprc->redirect_output($logfile) if $logfile;52 53 49 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 54 50 pod2usage( … … 59 55 and defined $tess_dir; 60 56 61 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 62 $SIG{__DIE__} = sub { die @_ if $^S; 63 my_die( $_[0], $warp_id, $PS_EXIT_UNKNOWN_ERROR ); }; 64 65 $ipprc->define_camera($camera); 57 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $warp_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 58 $ipprc->redirect_output($logfile) or my_die( "Unable to redirect output", $warp_id, $PS_EXIT_SYS_ERROR ) if $logfile; 66 59 67 60 &my_die("Tessellation identifier not provided: $tess_dir", $warp_id, $PS_EXIT_SYS_ERROR) unless $tess_dir ne "NULL"; -
trunk/ippScripts/scripts/warp_skycell.pl
r22430 r23186 24 24 use PS::IPP::Metadata::List qw( parse_md_list ); 25 25 use PS::IPP::Config 1.01 qw( :standard ); 26 27 my $ipprc = PS::IPP::Config->new(); # IPP configuration28 26 29 27 # Look for programs we need … … 68 66 and defined $run_state; 69 67 70 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 71 $SIG{__DIE__} = sub { die @_ if $^S; 72 my_die( $_[0], $warp_id, $skycell_id, $tess_dir, $PS_EXIT_UNKNOWN_ERROR ); }; 73 74 $ipprc->define_camera($camera); 75 76 my $logDest = $ipprc->filename("LOG.EXP", $outroot, $skycell_id); 68 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 69 70 my $logDest = $ipprc->filename("LOG.EXP", $outroot, $skycell_id) or my_die( "Unable to get log filename", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR ); 77 71 $logDest .= ".update" if ($run_state eq 'update'); 78 72 79 $ipprc->redirect_output($logDest) if $redirect;73 $ipprc->redirect_output($logDest) or my_die( "Unable to redirect output", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR ) if $redirect; 80 74 81 75 my $source_id = $ipprc->source_id($dbname, $PS_TABLE_ID_WARP);
Note:
See TracChangeset
for help on using the changeset viewer.
