IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 20, 2009, 11:23:43 AM (17 years ago)
Author:
watersc1
Message:

preliminary addstar/addtool code.

Location:
branches/czw_branch/cleanup
Files:
9 added
12 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/cleanup/dbconfig/ipp.m4

    r24512 r25147  
    1414include(chip.md)
    1515include(cam.md)
     16include(add.md)
    1617include(fake.md)
    1718include(warp.md)
  • branches/czw_branch/cleanup/ippScripts/Build.PL

    r24951 r25147  
    4949        scripts/chip_imfile.pl
    5050        scripts/camera_exp.pl
     51        scripts/addstar_run.pl
    5152        scripts/fake_imfile.pl
    5253        scripts/warp_overlap.pl
  • branches/czw_branch/cleanup/ippScripts/scripts/addstar_run.pl

    r25088 r25147  
    4040}
    4141
    42 my ( $exp_tag, $add_id, $camera, $outroot, $recipe, $dbname, $reduction, $dvodb, $verbose, $no_update,
     42my ( $exp_tag, $add_id, $camera, $outroot, $camroot, $recipe, $dbname, $reduction, $dvodb, $verbose, $no_update,
    4343     $no_op, $redirect, $save_temps, $run_state);
    4444GetOptions(
    … …  
    4949    'dbname|d=s'        => \$dbname, # Database name
    5050    'outroot|w=s'       => \$outroot, # output file base name
     51    'camroot|w=s'       => \$camroot, # camera stage root name.
    5152    'reduction=s'       => \$reduction, # Reduction class
    5253    'dvodb|w=s'         => \$dvodb,  # output DVO database
    … …  
    111112    my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
    112113        &my_die("Unable to parse metadata config doc", $add_id, $PS_EXIT_PROG_ERROR);
    113 
     114   
    114115    # extract the metadata for the files into a hash list
    115116    $files = parse_md_list($metadata) or
    116         &my_die("Unable to parse metadata list", $add_id, $PS_EXIT_PROG_ERROR);
    117 
    118 #     # since I can't figure out how to do input and output within PERL, I'm writing to a temp file
    119 #     my ($statFile, $statName) = tempfile( "/tmp/$exp_tag.add.$add_id.stats.XXXX", UNLINK => !$save_temps );
    120 #     print "saving stats to $statName\n";
    121 #     foreach my $line (@$stdout_buf) {
    122 #         print $statFile $line;
    123 #     }
    124 #     close $statFile;
    125 
    126 #     # parse the stats in the metadata file
    127 #     $command = "$ppStatsFromMetadata $statName - CAMERA_EXP_IMFILE";
    128 #     ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    129 #         run(command => $command, verbose => $verbose);
    130 #     unless ($success) {
    131 #         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    132 #         warn("Unable to perform ppStatsFromMetadata: $error_code\n");
    133 #         exit($error_code);
    134 #     }
    135 
    136 #     foreach my $line (@$stdout_buf) {
    137 #         $cmdflags .= " $line";
    138 #     }
    139 #     chomp $cmdflags;
    140 }
    141 
    142 # ### not needed to have such an extensive temp file name.
    143 # my ($list1File, $list1Name) = tempfile( "/tmp/$exp_tag.cm.$cam_id.b1.list.XXXX", UNLINK => !$save_temps ); # For binning 1
    144 # my ($list2File, $list2Name) = tempfile( "/tmp/$exp_tag.cm.$cam_id.b2.list.XXXX", UNLINK => !$save_temps ); # For binning 2
    145 # my ($list3File, $list3Name) = tempfile( "/tmp/$exp_tag.cm.$cam_id.b3.list.XXXX", UNLINK => !$save_temps ); # For astrometry
    146 
    147 # ### XXX for the moment, always generate the bright-star mask
    148 # my ($list4File, $list4Name) = tempfile( "/tmp/$exp_tag.cm.$cam_id.b4.list.XXXX", UNLINK => !$save_temps ); # For astrometry
    149 
    150 # # XXX we perform astrometry iff photometry output exists
     117        &my_die("Unable to parse metadata list", $add_id, $PS_EXIT_PROG_ERROR);   
     118}
     119
    151120my $chipObjectsExist = 0;
    152 # foreach my $file (@$files) {
    153 #     # use the path_base as OUTPUT root and convert the filenames with ipprc->filename:
    154 #     my $class_id = $file->{class_id};
    155 
    156 #     # If there is only one chip, we use this name for the input to addstar
    157 #     # we expect the chip analysis stage to produce psphot output (cmf file) and two binned images
    158 #     my $chipObjects = $ipprc->filename("PSPHOT.OUTPUT", $file->{path_base}, $class_id);
    159 #     my $chipMask   = $ipprc->filename("PPIMAGE.CHIP.MASK", $file->{path_base}, $class_id);
    160 
    161 #     # if any of the output chip photometry files exist, we can run psastro / addstar below
    162 #     if ($ipprc->file_exists($chipObjects)) {
    163 #         $chipObjectsExist = 1;
    164 #     } else {
    165 #         if ($verbose) { print "skipping $chipObjects (not found)\n"; }
    166 #         next;
    167 #     }
    168 
    169 #     print $list1File ($ipprc->filename("PPIMAGE.BIN1", $file->{path_base}, $class_id) . "\n");
    170 #     print $list2File ($ipprc->filename("PPIMAGE.BIN2", $file->{path_base}, $class_id) . "\n");
    171 #     print $list3File ($chipObjects . "\n");
    172 #     print $list4File ($chipMask . "\n");
    173 # }
    174 # close $list1File;
    175 # close $list2File;
    176 # close $list3File;
    177 # close $list4File;
    178121
    179122# Output products
    … …  
    181124
    182125# the camera configurations should define the psastro output to be a single file (MEF), regardless of the inputs
    183 # my $jpeg1      = $ipprc->filename("PPIMAGE.JPEG1",      $outroot) or &my_die("Missing entry from camera config", $cam_id, $PS_EXIT_CONFIG_ERROR);
    184 # my $jpeg2      = $ipprc->filename("PPIMAGE.JPEG2",      $outroot) or &my_die("Missing entry from camera config", $cam_id, $PS_EXIT_CONFIG_ERROR);
    185 my $fpaObjects = $ipprc->filename("PSASTRO.OUTPUT",     $outroot) or &my_die("Missing entry from camera config", $add_id, $PS_EXIT_CONFIG_ERROR);
    186 # my $fpaStats   = $ipprc->filename("PSASTRO.STATS",      $outroot) or &my_die("Missing entry from camera config", $cam_id, $PS_EXIT_CONFIG_ERROR);
     126my $fpaObjects = $ipprc->filename("PSASTRO.OUTPUT",     $camroot) or &my_die("Missing entry from camera config", $add_id, $PS_EXIT_CONFIG_ERROR);
    187127my $traceDest  = $ipprc->filename("TRACE.EXP",          $outroot) or &my_die("Missing entry from camera config", $add_id, $PS_EXIT_CONFIG_ERROR);
    188 #my $configuration = $ipprc->filename("PSASTRO.CONFIG",  $outroot) or &my_die("Missing entry from camera config", $cam_id, $PS_EXIT_CONFIG_ERROR);
    189128
    190129if ($run_state eq 'update') {
    191130    $traceDest .= '.update';
    192 #    $fpaStats .= '.update';
    193131}
    194132
    … …  
    203141
    204142unless ($no_op) {
    205 
    206     ## build the output JPEG images first so we get them even if the astrometry fails
    207 
    208     # Make the jpeg for binning 1
    209 #     if ($run_state eq 'new') {
    210 #         my $command = "$ppImage -list $list1Name $outroot"; # Command to run
    211 #         $command .= " -recipe PPIMAGE $recipe1";
    212 #         $command .= " -dbname $dbname" if defined $dbname;
    213 
    214 #         my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    215 #             run(command => $command, verbose => $verbose);
    216 #         unless ($success) {
    217 #             $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    218 #             &my_die("Unable to perform ppImage: $error_code", $cam_id, $error_code);
    219 #         }
    220 #         &my_die("Unable to find expected output file: $jpeg1", $cam_id, $PS_EXIT_PROG_ERROR) unless -f $ipprc->file_resolve($jpeg1);
    221 #     }
    222 
    223 #     # Make the jpeg for binning 2
    224 #     if ($run_state eq 'new') {
    225 #         my $command = "$ppImage -list $list2Name $outroot"; # Command to run
    226 #         $command .= " -recipe PPIMAGE $recipe2";
    227 #         $command .= " -dbname $dbname" if defined $dbname;
    228 
    229 #         my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    230 #             run(command => $command, verbose => $verbose);
    231 #         unless ($success) {
    232 #             $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    233 #             &my_die("Unable to perform ppImage: $error_code", $cam_id, $error_code);
    234 #         }
    235 #         &my_die("Unable to find expected output file: $jpeg2", $cam_id, $PS_EXIT_PROG_ERROR) unless -f $ipprc->file_resolve($jpeg2);
    236 #     }
    237 
    238     # only run psastro / addstar if any of the output chip astrometry files exist (should we test for successful astrometry?)
    239 #    if ($chipObjectsExist) {
    240         # run psastro on the chipObjects, producing fpaObjects
    241 #         my $command;
    242 #         $command  = "$psastro";
    243 #       $command .= " -list $list3Name";
    244 #       $command .= " -masklist $list4Name";
    245 #       $command .= " $outroot";
    246 #         $command .= " -recipe PSASTRO $recipe_psastro";
    247 #         $command .= " -tracedest $traceDest -log $logDest";
    248 #         $command .= " -dbname $dbname" if defined $dbname;
    249 
    250 #         my $do_stats;
    251 #         if ($run_state eq 'new') {
    252 #             $command .= " -stats $fpaStats -recipe PPSTATS CAMSTATS";
    253 #             $command .= " -dumpconfig $configuration";
    254 #             $do_stats = 1;
    255 #         } elsif ($run_state eq 'update') {
    256 #             $command .= " -ipprc $configuration";
    257 #         } else {
    258 #             &my_die("invalid value for run-state: $run_state", $cam_id, $PS_EXIT_CONFIG_ERROR);
    259 #         }
    260 
    261 #         my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    262 #             run(command => $command, verbose => $verbose);
    263 #         unless ($success) {
    264 #             $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    265 #             &my_die("Unable to perform psastro: $error_code", $cam_id, $error_code);
    266 #         }
    267 
    268 #         my $quality;            # Quality flag
    269 #         if ($do_stats) {
    270 #             my $fpaStatsReal = $ipprc->file_resolve($fpaStats);
    271 #             &my_die("Couldn't find expected output file: $fpaStats", $cam_id, $PS_EXIT_SYS_ERROR) unless -f $fpaStatsReal;
    272 
    273 #             # parse stats from metadata
    274 #             $command = "$ppStatsFromMetadata $fpaStatsReal - CAMERA_EXP_FPA";
    275 #             ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    276 #                 run(command => $command, verbose => $verbose);
    277 #             unless ($success) {
    278 #                 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    279 #                 &my_die("Unable to perform ppStatsFromMetadata: $error_code", $cam_id, $error_code);
    280 #             }
    281 #             foreach my $line (@$stdout_buf) {
    282 #                 $cmdflags .= " $line";
    283 #             }
    284 #             chomp $cmdflags;
    285 
    286 #             ($quality) = $cmdflags =~ /-quality (\d+)/;
    287 #         }
    288 
    289 #         if (!$quality) {
    290 #             &my_die("Unable to find expected output file: $fpaObjects", $cam_id, $PS_EXIT_PROG_ERROR) unless -f $ipprc->file_resolve($fpaObjects);
    291 #         }
    292 
    293 #         # run addstar on the output fpaObjects (if a DVO database is defined)
    294         if (defined $dvodbReal and ($run_state eq 'new')) {
    295 
    296             ## XXX the camera analysis can either save the full set of
    297             ## detections, or just the image metadata, in the dvodb
    298 
    299             ## get the addstar recipe for this camera and CAMERA reduction
    300             my $command = "$ppConfigDump -camera $camera -recipe ADDSTAR $recipe_addstar -dump-recipe ADDSTAR -";
    301             my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    302                 run(command => $command, verbose => $verbose);
    303             unless ($success) {
    304                 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    305                 &my_die("Unable to perform ppConfigDump: $error_code", $add_id, $PS_EXIT_SYS_ERROR);
    306             }
    307             my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or
    308                 &my_die("Unable to parse metadata config doc", $add_id, $PS_EXIT_SYS_ERROR);
    309 
    310             ## allow the dvodb to save only images, or the full detection set
    311             my $imagesOnly = metadataLookupBool($recipeData, 'IMAGES.ONLY');
    312 
    313             # XXX this construct requires the user to have a valid .ptolemyrc
    314             # XXX which in turn points at ippconfig/dvo.site
    315             # require a defined output dvo database to run addstar (ie, refuse to use the .ptolemyrc default)
    316             # XXX this needs to be converted to addstar_client...
    317 
    318             my $camdir = $ipprc->dvo_cameradir(); # Camera directory for addstar
    319             $command  = "$addstar -D CAMERA $camdir -update";
    320             $command .= " -image" if $imagesOnly;
    321             $command .= " -D CATDIR $dvodbReal";
    322 
    323             my $realFile = $ipprc->file_resolve($fpaObjects);
    324             $command .= " $realFile";
    325 
    326             my $mjd_addstar_start = DateTime->now->mjd;   # MJD of starting script
    327 
    328             ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    329                 run(command => $command, verbose => $verbose);
    330             unless ($success) {
    331                 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    332                 &my_die("Unable to perform addstar: $error_code", $add_id, $error_code);
    333             }
    334             $dtime_addstar = 86400.0*(DateTime->now->mjd - $mjd_addstar_start);   # MJD of starting script
    335         }
    336 }
    337 
    338 
    339 my $dtime_script = (DateTime->now->mjd - $mjd_start) * 86400;
     143    if (defined $dvodbReal and ($run_state eq 'new')) {
     144        ## XXX the camera analysis can either save the full set of
     145        ## detections, or just the image metadata, in the dvodb
     146       
     147        ## get the addstar recipe for this camera and CAMERA reduction
     148        my $command = "$ppConfigDump -camera $camera -recipe ADDSTAR $recipe_addstar -dump-recipe ADDSTAR -";
     149        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     150            run(command => $command, verbose => $verbose);
     151        unless ($success) {
     152            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     153            &my_die("Unable to perform ppConfigDump: $error_code", $add_id, $PS_EXIT_SYS_ERROR);
     154        }
     155        my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or
     156            &my_die("Unable to parse metadata config doc", $add_id, $PS_EXIT_SYS_ERROR);
     157       
     158        ## allow the dvodb to save only images, or the full detection set
     159        my $imagesOnly = metadataLookupBool($recipeData, 'IMAGES.ONLY');
     160       
     161        # XXX this construct requires the user to have a valid .ptolemyrc
     162        # XXX which in turn points at ippconfig/dvo.site
     163        # require a defined output dvo database to run addstar (ie, refuse to use the .ptolemyrc default)
     164        # XXX this needs to be converted to addstar_client...
     165
     166        my $camdir = $ipprc->dvo_cameradir(); # Camera directory for addstar
     167        $command  = "$addstar -D CAMERA $camdir -update";
     168        $command .= " -image" if $imagesOnly;
     169        $command .= " -D CATDIR $dvodbReal";
     170       
     171        my $realFile = $ipprc->file_resolve($fpaObjects);
     172        $command .= " $realFile";
     173       
     174        my $mjd_addstar_start = DateTime->now->mjd;   # MJD of starting script
     175       
     176        ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     177            run(command => $command, verbose => $verbose);
     178        unless ($success) {
     179            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     180            &my_die("Unable to perform addstar: $error_code", $add_id, $error_code);
     181        }
     182        $dtime_addstar = 86400.0*(DateTime->now->mjd - $mjd_addstar_start);   # MJD of starting script
     183    }
     184}
     185
    340186
    341187# This needs to be updated when addtool is written. BROKEN
    … …  
    345191    $fpaCommand .= " -path_base $outroot";
    346192    $fpaCommand .= " $cmdflags";
    347     $fpaCommand .= " -hostname $host" if defined $host;
    348     $fpaCommand .= " -dtime_script $dtime_script";
    349193    $fpaCommand .= " -dtime_addstar $dtime_addstar";
    350194} else {
    … …  
    390234            $command .= " -fault $exit_code";
    391235        }
    392         $command .= " -hostname $host" if defined $host;
    393236        $command .= " -dbname $dbname" if defined $dbname;
    394237        system ($command);
  • branches/czw_branch/cleanup/ippScripts/scripts/camera_exp.pl

    r24465 r25147  
    9393&my_die("Unrecognised JPEG recipe", $cam_id, $PS_EXIT_CONFIG_ERROR) unless defined $recipe2;
    9494
    95 my $recipe_addstar = $ipprc->reduction($reduction, 'ADDSTAR'); # Recipe to use
    96 &my_die("Unrecognised ADDSTAR recipe", $cam_id, $PS_EXIT_CONFIG_ERROR) unless defined $recipe_addstar;
     95#my $recipe_addstar = $ipprc->reduction($reduction, 'ADDSTAR'); # Recipe to use
     96#&my_die("Unrecognised ADDSTAR recipe", $cam_id, $PS_EXIT_CONFIG_ERROR) unless defined $recipe_addstar;
    9797
    9898my $recipe_psastro = $ipprc->reduction($reduction, 'PSASTRO'); # Recipe to use
    … …  
    205205}
    206206
    207 my $dtime_addstar = 0;
     207#my $dtime_addstar = 0;
    208208
    209209unless ($no_op) {
    … …  
    297297
    298298        # run addstar on the output fpaObjects (if a DVO database is defined)
    299         if (defined $dvodbReal and ($run_state eq 'new')) {
    300 
    301             ## XXX the camera analysis can either save the full set of
    302             ## detections, or just the image metadata, in the dvodb
    303 
    304             ## get the addstar recipe for this camera and CAMERA reduction
    305             $command = "$ppConfigDump -camera $camera -recipe ADDSTAR $recipe_addstar -dump-recipe ADDSTAR -";
    306             ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    307                 run(command => $command, verbose => $verbose);
    308             unless ($success) {
    309                 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    310                 &my_die("Unable to perform ppConfigDump: $error_code", $cam_id, $PS_EXIT_SYS_ERROR);
    311             }
    312             my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or
    313                 &my_die("Unable to parse metadata config doc", $cam_id, $PS_EXIT_SYS_ERROR);
    314 
    315             ## allow the dvodb to save only images, or the full detection set
    316             my $imagesOnly = metadataLookupBool($recipeData, 'IMAGES.ONLY');
    317 
    318             # XXX this construct requires the user to have a valid .ptolemyrc
    319             # XXX which in turn points at ippconfig/dvo.site
    320             # require a defined output dvo database to run addstar (ie, refuse to use the .ptolemyrc default)
    321             # XXX this needs to be converted to addstar_client...
    322 
    323             my $camdir = $ipprc->dvo_cameradir(); # Camera directory for addstar
    324             my $command;
    325             $command  = "$addstar -D CAMERA $camdir -update";
    326             $command .= " -image" if $imagesOnly;
    327             $command .= " -D CATDIR $dvodbReal";
    328 
    329             my $realFile = $ipprc->file_resolve($fpaObjects);
    330             $command .= " $realFile";
    331 
    332             my $mjd_addstar_start = DateTime->now->mjd;   # MJD of starting script
    333 
    334             my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    335                 run(command => $command, verbose => $verbose);
    336             unless ($success) {
    337                 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    338                 &my_die("Unable to perform addstar: $error_code", $cam_id, $error_code);
    339             }
    340             $dtime_addstar = 86400.0*(DateTime->now->mjd - $mjd_addstar_start);   # MJD of starting script
    341         }
     299#         if (defined $dvodbReal and ($run_state eq 'new')) {
     300
     301#             ## XXX the camera analysis can either save the full set of
     302#             ## detections, or just the image metadata, in the dvodb
     303
     304#             ## get the addstar recipe for this camera and CAMERA reduction
     305#             $command = "$ppConfigDump -camera $camera -recipe ADDSTAR $recipe_addstar -dump-recipe ADDSTAR -";
     306#             ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     307#                 run(command => $command, verbose => $verbose);
     308#             unless ($success) {
     309#                 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     310#                 &my_die("Unable to perform ppConfigDump: $error_code", $cam_id, $PS_EXIT_SYS_ERROR);
     311#             }
     312#             my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or
     313#                 &my_die("Unable to parse metadata config doc", $cam_id, $PS_EXIT_SYS_ERROR);
     314
     315#             ## allow the dvodb to save only images, or the full detection set
     316#             my $imagesOnly = metadataLookupBool($recipeData, 'IMAGES.ONLY');
     317
     318#             # XXX this construct requires the user to have a valid .ptolemyrc
     319#             # XXX which in turn points at ippconfig/dvo.site
     320#             # require a defined output dvo database to run addstar (ie, refuse to use the .ptolemyrc default)
     321#             # XXX this needs to be converted to addstar_client...
     322
     323#             my $camdir = $ipprc->dvo_cameradir(); # Camera directory for addstar
     324#             my $command;
     325#             $command  = "$addstar -D CAMERA $camdir -update";
     326#             $command .= " -image" if $imagesOnly;
     327#             $command .= " -D CATDIR $dvodbReal";
     328
     329#             my $realFile = $ipprc->file_resolve($fpaObjects);
     330#             $command .= " $realFile";
     331
     332#             my $mjd_addstar_start = DateTime->now->mjd;   # MJD of starting script
     333
     334#             my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     335#                 run(command => $command, verbose => $verbose);
     336#             unless ($success) {
     337#                 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     338#                 &my_die("Unable to perform addstar: $error_code", $cam_id, $error_code);
     339#             }
     340#             $dtime_addstar = 86400.0*(DateTime->now->mjd - $mjd_addstar_start);   # MJD of starting script
     341#         }
    342342    }
    343343}
    … …  
    353353    $fpaCommand .= " -hostname $host" if defined $host;
    354354    $fpaCommand .= " -dtime_script $dtime_script";
    355     $fpaCommand .= " -dtime_addstar $dtime_addstar";
     355#    $fpaCommand .= " -dtime_addstar $dtime_addstar";
    356356} else {
    357357    $fpaCommand .= " -updaterun -state full";
  • branches/czw_branch/cleanup/ippTasks/Makefile.am

    r24951 r25147  
    1313        chip.pro \
    1414        camera.pro \
     15        addstar.pro \
    1516        fake.pro \
    1617        warp.pro \
  • branches/czw_branch/cleanup/ippTasks/pantasks.pro

    r24951 r25147  
    213213  chip.on
    214214  camera.on
     215  addstar.on
    215216  fake.on
    216217  warp.on
    … …  
    225226  chip.off
    226227  camera.off
     228  addstar.off
    227229  fake.off
    228230  warp.off
    … …  
    242244  module chip.pro
    243245  module camera.pro
     246  module addstar.pro
    244247  module fake.pro
    245248  module warp.pro
  • branches/czw_branch/cleanup/ippTools/share/Makefile.am

    r25051 r25147  
    44
    55dist_pkgdata_DATA = \
     6     addtool_find_pendingexp.sql \
     7     addtool_queue_cam_id.sql \
     8     addtool_reset_faulted_runs.sql \
     9     addtool_revertprocessedexp.sql \
    610     camtool_donecleanup.sql \
    711     camtool_find_chip_id.sql \
  • branches/czw_branch/cleanup/ippTools/share/pxadmin_create_tables.sql

    r25051 r25147  
    451451) ENGINE=innodb DEFAULT CHARSET=latin1;
    452452
     453CREATE TABLE addRun (
     454    add_id BIGINT AUTO_INCREMENT,
     455    cam_id BIGINT,
     456    state VARCHAR(64),
     457    workdir VARCHAR(255),
     458    workdir_state VARCHAR(64),
     459    label VARCHAR(64),
     460    dvodb VARCHAR(255),
     461    magicked BIGINT,
     462    PRIMARY KEY(add_id),
     463    KEY(add_id),
     464    KEY(cam_id),
     465    KEY(state),
     466    KEY(workdir_state),
     467    KEY(label),
     468    INDEX(add_id, cam_id),
     469    FOREIGN KEY(cam_id) REFERENCES camRun(cam_id)
     470) ENGINE=innodb DEFAULT CHARSET=latin1;
     471
     472CREATE TABLE addProcessedExp (
     473    add_id BIGINT AUTO_INCREMENT,
     474    dtime_addstar FLOAT,
     475    n_stars INT,
     476    path_base VARCHAR(255),
     477    fault SMALLINT NOT NULL,
     478    PRIMARY KEY(add_id),
     479    FOREIGN KEY(add_id) REFERENCES addRun(add_id)
     480) ENGINE=innodb DEFAULT CHARSET=latin1;
     481
     482CREATE TABLE addMask (
     483    label VARCHAR(64),
     484    PRIMARY KEY(label)
     485) ENGINE=innodb DEFAULT CHARSET=latin1;
     486
    453487CREATE TABLE fakeRun (
    454488    fake_id BIGINT AUTO_INCREMENT,
    … …  
    10861120        KEY(magic_id),
    10871121        KEY(label),
    1088         FOREIGN KEY(magic_id) REFERENCES magicRun(magic_id)
     1122        FOREIGN KEY(magic_id) REFERENCES magicRun(magic_id),
    10891123        FOREIGN KEY(inv_magic_id) REFERENCES magicRun(magic_id)
    10901124) ENGINE=innodb DEFAULT CHARSET=latin1;
  • branches/czw_branch/cleanup/ippTools/share/pxadmin_drop_tables.sql

    r24531 r25147  
    1919DROP TABLE IF EXISTS detRun;
    2020DROP TABLE IF EXISTS detInputExp;
     21DROP TABLE IF EXISTS addRun;
     22DROP TABLE IF EXISTS addProcessedExp;
     23DROP TABLE IF EXISTS addMask;
    2124DROP TABLE IF EXISTS fakeRun;
    2225DROP TABLE IF EXISTS fakeProcessedImfile;
  • branches/czw_branch/cleanup/ippTools/src/Makefile.am

    r24512 r25147  
    11bin_PROGRAMS = \
     2        addtool \
    23        caltool \
    34        camtool \
    … …  
    2829
    2930pkginclude_HEADERS = \
     31        pxadd.h \
    3032        pxadmin.h \
    3133        pxcam.h \
    … …  
    4244
    4345noinst_HEADERS = \
     46        addtool.h \
    4447        caltool.h \
    4548        camtool.h \
    … …  
    6871libpxtools_la_LDFLAGS   = -release $(PACKAGE_VERSION)
    6972libpxtools_la_SOURCES   = \
     73        pxadd.c \
    7074        pxcam.c \
    7175        pxchip.c \
    … …  
    96100    pstamptool.c \
    97101    pstamptoolConfig.c
     102
     103addtool_CFLAGS = $(PSLIB_CFLAGS) $(PSMODULES_CFLAGS) $(IPPDB_CFLAGS)
     104addtool_LDADD = $(PSLIB_LIBS) $(PSMODULES_LIBS) $(IPPDB_LIBS) libpxtools.la
     105addtool_SOURCES = \
     106    addtool.c \
     107    addtoolConfig.c
    98108
    99109caltool_CFLAGS = $(PSLIB_CFLAGS) $(PSMODULES_CFLAGS) $(IPPDB_CFLAGS)
  • branches/czw_branch/cleanup/ippTools/src/camtool.c

    r24681 r25147  
    656656        return false;
    657657    }
     658
     659    if (!pxaddQueueByCamID(config,
     660                           pendingRow->cam_id,
     661                           pendingRow->workdir,
     662                           pendingRow->label,
     663                           pendingRow->reduction,
     664                           pendingRow->dvodb
     665    )) {
     666        // rollback
     667        if (!psDBRollback(config->dbh)) {
     668            psError(PS_ERR_UNKNOWN, false, "database error");
     669        }
     670        psError(PS_ERR_UNKNOWN, false, "failed to queue new addRun");
     671        psFree(pendingRow);
     672        return false;
     673    }
     674
    658675    psFree(pendingRow);
    659676
  • branches/czw_branch/cleanup/ippTools/src/pxtools.h

    r24951 r25147  
    3737#include "pxtoolsErrorCodes.h"
    3838
     39#include "pxadd.h"
    3940#include "pxcam.h"
    4041#include "pxchip.h"
Note: See TracChangeset for help on using the changeset viewer.