IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 4, 2008, 12:33:09 PM (18 years ago)
Author:
eugene
Message:

hacking...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/flatcorr_proc.pl

    r16563 r16809  
    9393my ($DECs, $DECe) = split (",", $coords[1]);
    9494
    95 # Run relphot (filter) for each filter
     95# Run relphot (filter) for the specified region (need to clarify the options like imfreeze)
    9696{
    9797    my $command = "$relphot $filter";
     
    106106    unless ($success) {
    107107        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    108         &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "RELPHOT", $status, $dbname);
     108        &my_die ("Unable to perform relphot -grid on region $region: $error_code", $dvo_id, $region, "RELPHOT", $status, $dbname);
    109109    }
    110110}
    111111
    112112# use one of the input raw images as a reference image
     113# XXX I'm not sure how this works: do I run this once per imfile for a given exp?
    113114my ($reffile)
    114115{
     
    120121    unless ($success) {
    121122        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    122         &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "RELPHOT", $status, $dbname);
    123     }
    124 
    125     # parse the output metadata to get the refernece image filename
    126     $reffile = "foobar";
     123        &my_die ("Unable to perform flatcorr -flatcorrimfile: $error_code", $dvo_id, $region, "RELPHOT", $status, $dbname);
     124    }
     125
     126    my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
     127        &my_die("Unable to parse metadata config doc", $dvo_id, $region, "RELPHOT", $status, $dbname, $PS_EXIT_PROG_ERROR););
     128
     129    my $imfiles = parse_md_list($metadata) or
     130        &my_die("Unable to parse metadata list", $dvo_id, $region, "RELPHOT", $status, $dbname, $PS_EXIT_PROG_ERROR););
     131
     132    my $imfile = $imfiles->[0];
     133    $reffile = $imfile->{uri};
    127134}
    128135
    129136{
    130137    my $command = "$dvoMakeCorr -file $outgrid -ref $reffile $outcorr";
    131     $command .= "-D CATDIR $dvodb";
    132     $command .= "-region $RAs $RAe $DECs $DECe";
    133 
    134     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    135         cache_run(command => $command, verbose => 1);
    136 
    137     unless ($success) {
    138         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    139         &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "RELASTRO.OBJECTS", $status, $dbname);
     138
     139    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     140        cache_run(command => $command, verbose => 1);
     141
     142    unless ($success) {
     143        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     144        &my_die ("Unable to perform dvoMakeCorr: $error_code", $dvo_id, $region, "RELASTRO.OBJECTS", $status, $dbname);
    140145    }
    141146}
Note: See TracChangeset for help on using the changeset viewer.