IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27788


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.

Location:
trunk/pstamp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/scripts/detect_query_read

    r18587 r27788  
    7878                        comment => 'site identifier (MPC observatory code)',
    7979                        value => undef
    80               }
     80                      },
     81        'STAGE'    => {
     82                        name => 'STAGE',
     83                        writetype => TSTRING,
     84                        comment => 'processing stage to examine',
     85                        value => undef
     86                      }
    8187};
    8288
    8389# key_array insures that the order that the keywords is printed out is
    8490# the same as the ICD
    85 my @key_array = qw( QUERY_ID FPA_ID MJD_OBS FILTER OBSCODE );
     91my @key_array = qw( QUERY_ID FPA_ID MJD_OBS FILTER OBSCODE STAGE);
    8692
    8793# Specification of columns
     
    144150        my $name = $header->{$key}->{name};
    145151        my $value = $inHeader->{$name};
     152        if (($key eq 'STAGE')&& !(defined($value))) {
     153            $value = 'DIFF';
     154        }
    146155        # get rid of quotes and whitespace
    147156        $value =~ s/\'//g;
  • 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  = ();
  • trunk/pstamp/test/detect_query_create

    r18738 r27788  
    1616     $output,                   # Name of output table
    1717     $query_id,
     18     $nostage,
    1819     );
    1920
     
    2223           'output|o=s'   => \$output,
    2324           'query_id|q=s'  => \$query_id,
     25           'nostage'      => \$nostage,
    2426) or pod2usage( 2 );
    2527
     
    6163        }
    6264];
     65unless(defined($nostage)) {
     66    push @{ $header },        { name =>  'STAGE',
     67                                writetype => TSTRING,
     68                                comment => 'processing stage to examine',
     69                                value => undef
     70    };
     71}
    6372
    6473# Specification of columns to write
Note: See TracChangeset for help on using the changeset viewer.