Index: unk/ippScripts/scripts/detrend_apply_norm.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_apply_norm.pl	(revision 9093)
+++ 	(revision )
@@ -1,73 +1,0 @@
-#!/usr/bin/env perl
-
-use warnings;
-use strict;
-
-use IPC::Cmd qw( can_run run );
-use Data::Dumper;
-
-use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
-use Pod::Usage qw( pod2usage );
-
-# Parse the command-line
-my ($detId,                     # Detrend ID
-    $iter,  			# Iteration
-    $classId,			# Class ID
-    $value,			# Value to multiple (for normalisation)
-    $input,			# Input file
-    $camera,			# Camera
-    $detType,			# Detrend type
-    $no_update			# Don't update the database
-    );
-GetOptions(
-    'det_id|d=s'        => \$detId,
-    'iteration|n=s'	=> \$iter,
-    'class_id|i=s'      => \$classId,
-    'value|v=s'		=> \$value,
-    'input_uri|u=s'     => \$input,
-    'camera|c=s'        => \$camera,
-    'det_type|t=s'      => \$detType,
-    'no-update'         => \$no_update
-    ) or pod2usage( 2 );
-    
-pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
-pod2usage(     -msg => "Required options: --det_id --iteration --class_id --value --input_uri --camera --det_type",
-    -exitval => 3,
-    ) unless defined $detId
-    and defined $iter
-    and defined $classId
-    and defined $value
-    and defined $input
-    and defined $camera
-    and defined $detType;
-
-
-# Look for programs we need
-my $missing_tools;
-my $dettool = can_run('dettool') or (warn "Can't find dettool" and $missing_tools = 1);
-my $ppArith = can_run('ppArith') or (warn "Can't find ppArith" and $missing_tools = 1);
-die "Can't find required tools.\n" if $missing_tools;
-
-# Output name
-my $output = $camera . '.' . $detType . '.norm.' . $detId . '.' . $iter . '.' . $classId . '.fits';
-
-# Run ppArith
-my $norms;
-{
-    my $command = "$ppArith -file1 $input -op * -constant $value -out $output"; # Command to run
-    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
-	run(command => $command, verbose => 1);
-    die "Unable to perform ppArith: $error_code\n" if not $success;
-    die "Can't find expected output file: $output\n" if not -e $output;
-}
-
-
-# Update the database
-unless ($no_update) {
-    my $command = "$dettool -addnormalizedimfile -det_id $detId -iteration $iter -class_id $classId ".
-	"-uri $output"; # Command to run
-    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
-	run(command => $command, verbose => 1);
-    die "Unable to perform dettool -addnormalizedimfile: $error_code\n"
-	if not $success;
-}
Index: /trunk/ippScripts/scripts/detrend_norm_apply.pl
===================================================================
--- /trunk/ippScripts/scripts/detrend_norm_apply.pl	(revision 9094)
+++ /trunk/ippScripts/scripts/detrend_norm_apply.pl	(revision 9094)
@@ -0,0 +1,73 @@
+#!/usr/bin/env perl
+
+use warnings;
+use strict;
+
+use IPC::Cmd qw( can_run run );
+use Data::Dumper;
+
+use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
+use Pod::Usage qw( pod2usage );
+
+# Parse the command-line
+my ($detId,                     # Detrend ID
+    $iter,  			# Iteration
+    $classId,			# Class ID
+    $value,			# Value to multiple (for normalisation)
+    $input,			# Input file
+    $camera,			# Camera
+    $detType,			# Detrend type
+    $no_update			# Don't update the database
+    );
+GetOptions(
+    'det_id|d=s'        => \$detId,
+    'iteration|n=s'	=> \$iter,
+    'class_id|i=s'      => \$classId,
+    'value|v=s'		=> \$value,
+    'input_uri|u=s'     => \$input,
+    'camera|c=s'        => \$camera,
+    'det_type|t=s'      => \$detType,
+    'no-update'         => \$no_update
+    ) or pod2usage( 2 );
+    
+pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
+pod2usage(     -msg => "Required options: --det_id --iteration --class_id --value --input_uri --camera --det_type",
+    -exitval => 3,
+    ) unless defined $detId
+    and defined $iter
+    and defined $classId
+    and defined $value
+    and defined $input
+    and defined $camera
+    and defined $detType;
+
+
+# Look for programs we need
+my $missing_tools;
+my $dettool = can_run('dettool') or (warn "Can't find dettool" and $missing_tools = 1);
+my $ppArith = can_run('ppArith') or (warn "Can't find ppArith" and $missing_tools = 1);
+die "Can't find required tools.\n" if $missing_tools;
+
+# Output name
+my $output = $camera . '.' . $detType . '.norm.' . $detId . '.' . $iter . '.' . $classId . '.fits';
+
+# Run ppArith
+my $norms;
+{
+    my $command = "$ppArith -file1 $input -op * -constant $value -out $output"; # Command to run
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+	run(command => $command, verbose => 1);
+    die "Unable to perform ppArith: $error_code\n" if not $success;
+    die "Can't find expected output file: $output\n" if not -e $output;
+}
+
+
+# Update the database
+unless ($no_update) {
+    my $command = "$dettool -addnormalizedimfile -det_id $detId -iteration $iter -class_id $classId ".
+	"-uri $output"; # Command to run
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+	run(command => $command, verbose => 1);
+    die "Unable to perform dettool -addnormalizedimfile: $error_code\n"
+	if not $success;
+}
