Index: /tags/ipp-ps1-20211104/ippScripts/scripts/ipp_apply_burntool_fix.pl
===================================================================
--- /tags/ipp-ps1-20211104/ippScripts/scripts/ipp_apply_burntool_fix.pl	(revision 42395)
+++ /tags/ipp-ps1-20211104/ippScripts/scripts/ipp_apply_burntool_fix.pl	(revision 42396)
@@ -15,4 +15,5 @@
 my $missing_tools;
 my $regtool = can_run('regtool') or (warn "Can't find regtool" and $missing_tools = 1);
+my $ppConfigDump = can_run('ppConfigDump') or (warn "Can't find ppConfigDump" and $missing_tools = 1);
 my $burntool = can_run('ipp_apply_burntool_single.pl') or (warn "Can't find ipp_burntool_apply_single.pl" and $missing_tools = 1);
 if ($missing_tools) {
@@ -65,7 +66,35 @@
 die "failed to find uri in regtool output" unless $uri;
 
+# Determine the value of a "good" burntool run.
+my $config_cmd = "$ppConfigDump -camera $camera -get-key BURNTOOL.STATE.GOOD";
+my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+    run ( command => $config_cmd, verbose => $verbose);
+unless ($success) {
+    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+    carp("Unable to perform ppConfigDUmp $config_cmd: $error_code");
+    exit $error_code;
+}
+
+my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or die("Unable to parse Config metadata");
+
+my $burntoolStateGood = 999;
+foreach my $cfg (@$recipeData) {
+    if ($cfg->{name} eq 'BURNTOOL.STATE.GOOD') {
+        $burntoolStateGood = $cfg->{value};
+    }
+}
+if ($burntoolStateGood == 999) {
+    die("Failed to determine BURNTOOL.STATE.GOOD");
+}
+
+
 # Construct burntool table name
 my $table;
-($table = $uri) =~ s/\.fits/\.burn\.tbl/;
+if($burntoolStateGood == 15) {
+    ($table = $uri) =~ s/\.fits/\.burn\.v15\.tbl/;	
+} else {
+    ($table = $uri) =~ s/\.fits/\.burn\.tbl/;		
+}
+
 print "$table\n";
 
