IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 27, 2010, 4:08:17 PM (16 years ago)
Author:
watersc1
Message:

Merged changes from my branch to support STAGE in the query header, and updated the response script to use the new API. It is not at all efficient at finding the images, but it is satisfactory for now. I can refactro it a bit once the glue sticking it to the rest of the Pstamp server is fininshed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/scripts/detectability_respond.pl

    r27643 r27788  
    7373#my $tmp_dir = "/data/${host}.0/tmp/";
    7474
     75my $project = resolve_project($ipprc,"project_name",$dbname);
    7576#
    7677# Parse input request file using detect_query_read (as it's already written).
     
    120121for (my $i = 1; $i < $Nrows; $i++) {
    121122#    print "$i $Nrows $query{CONTENT}{RA1_DEG}[$i] $query{CONTENT}{DEC1_DEG}[$i]\n";
    122 
    123123    my $image_set_tmp  = find_image_set($query{HEADER}{FPA_ID}[0],$query{HEADER}{STAGE}[0],
    124124                                        $query{HEADER}{MJD_OBS}[0],$query{HEADER}{FILTER}[0],
     
    143143my $i = 0;
    144144
     145
    145146foreach my $k (keys %image_list_hash) {
    146147    # Write coordinates of the requested targets to a file.
     
    153154        print $coordfile "$image_list_hash{$k}{SKY_COORDINATES}[$j]\n";
    154155    }
    155 
     156    print "$k\n";
    156157    # Convert the sky coordinates to image coordinates with ppCoord.
    157158    my $command = "ppCoord -astrom $image_list_hash{$k}{CATALOG} -radec $coordname";
     
    171172    }
    172173
    173    
     174    print "psphot $image_list_hash{$k}{PSF}\n";
    174175    # Run psphotForced on the target list.
    175176    my $tmpdir  = tempdir("detect.$i.XXXX", DIR => "/tmp/", CLEANUP => !$save_temps);
     
    215216                    $query{HEADER}{obscode}[0],
    216217                    \@rownums, \@psphot_Npix, \@psphot_Qfact, \@psphot_flux);
    217 
     218print "Wrote response file $output\n";
    218219#
    219220# Add to datastore
     
    252253    my $mjd_max = $mjd + 1;
    253254
     255    # Construct a row list:
     256
     257    my @rowList;
     258    $rowList[0]->{CENTER_X} = $ra;
     259    $rowList[0]->{CENTER_Y} = $dec;
     260    $rowList[0]->{ID} = 1;
     261    $rowList[0]->{STAGE} = $stage;
     262    $rowList[0]->{COORD_MASK} = 0;
     263    print "$stage\n";
    254264    # Call the PStamp code to find the images that contain the target on the given MJD in the specified filter.
    255     my @images = locate_images($ipprc,$dbname,"bycoord",$stage,
    256                                undef,undef,undef,$option_mask,$need_magic,
    257                                $ra,$dec,$mjd_min,$mjd_max,$filter . ".00000",undef,$verbose); 
     265    my @images = locate_images($ipprc,$dbname,
     266                                \@rowList,
     267                               "bycoord",$stage,
     268                               undef,undef,undef,
     269                               $option_mask,$need_magic,
     270                               # $ra,$dec,
     271                               $mjd_min,$mjd_max,$filter . ".00000",undef,$verbose); 
    258272
    259273    my %image_info  = ();
Note: See TracChangeset for help on using the changeset viewer.