<& /htmlheader &> <& modelheader &>

## MPC Observation Search

% if ($observations) { % if (@unfound) {

### Unfound detections:

    <% @unfound %>

% } % if (@found) {

### Matching detections:

<& detracklet_table, dets => \@found &> % }

% } # if obs

Paste your MPC observations below:

<% $observations %>

<& /htmlfooter &> <%args> $observations => '' <%init> use FileHandle; use File::Temp; use PS::MOPS::Lib qw(:all); use PS::MOPS::DC::Field; use PS::MOPS::DC::Detection; my $model = $m->notes('MODEL'); my $inst = $m->notes('INST'); my $mc = $inst->getConfig(); my $v2filt = $mc->{site}->{v2filt}; my @res; my @found; my @unfound; my $obstmp; my $cmd = 'no'; # Write obs to temp file. if ($observations) { $obstmp = new File::Temp(dir => '/tmp', TEMPLATE => 'lmpcXXXXXX', UNLINK => 1); print $obstmp $observations; $obstmp->close; # Crank obs through searcher. my $f = $obstmp->filename; $cmd = "lookup_mpc --instance=$model < $f"; (@res) = `$cmd`; @found = grep { !/not found/i } @res; @unfound = grep { /not found/i } @res; if (@found) { s|^.*/|| foreach @res; @found = map { modcd_retrieve($inst, detId => $_) } @res; } }