<& /htmlheader &>
<& modelheader &>

<pre>
To: mpc@cfa.harvard.edu
Cc: <% $CC | h %>
Subject: <% "$SUBJ $id_str" %>

<% $SUBJ %> <% $id_str %>

COD F51
CON <% $CON %>
OBS N. Primak, A. Schultz, S. Watters, J. Thiel, T. Goggia
MEA Pan-STARRS 1 Science Consortium
TEL 1.8-m Ritchey-Chretien + CCD
NET 2MASS
COM <% $COM %>, internal <% $int_str %>
ACK <% $id_str %>
AC2 psmops@gmail.com

% foreach my $det (@{$dets_ref}) {
% print PS::MOPS::MPC::det2mpc($det, $id_str), "\n";
% }
</pre>

<hr>
<table border=1 cellspacing=0 cellpadding=2 width="100%">
<tr>
<th class="darkheader"> Tracklet ID </th>
<th class="darkheader"> Status </th>
<th class="darkheader"> Classification </th>
<th class="darkheader"> Known As </th>
<th class="darkheader"> V<sub>tot</sub> (deg/day) </th>
<th class="darkheader"> Pos Ang (deg) </th>

</tr>
<tr>
<td align="center"> <% $trk->trackletId %><br>
<a target="_blank" href="mpcheckt.html?trkId=<% $id%>">MPCheck</a><br>
<a target="_blank" href="neodigest.html?trkId=T<% $id%>">NEO Digest (MOPS)</a><br>
<a target="_blank" href="mpcneodigest.html?trkId=T<% $id%>">NEO Digest (MPC)</a><br>
<a target="_blank" href="neoburn.html?trkId=<% $id%>">OORB NEO</a><br>
<a target="_blank" href="mtmpc.txt?id=T<% $id%>">MPC Dets</a>
</td>
<td align="center"> <% $TRACKLET_STATUS_DESCS{$trk->status} %> </td>
<td align="center"> <% $MOPS_EFF_DESCS{$trk->classification} %> </td>
<td align="center"> <& /mpc_link, desig => $known_str &> </td>
<td align="center"> <% sprintf "%.3f", $trk->vTot %> </td>
<td align="center"> <% sprintf "%.1f", $trk->posAng %> </td>

<tr>
<td colspan=6> <& detracklet_table, dets => $dets_ref, resids => 0 &> </td><p>
</tr>
</table>


<& /htmlfooter &>

<%args>
$id
$CON
$COM
$DESIG
$new => 0
$followup => 0
</%args>

<%init>
use PS::MOPS::DC::Orbit;
use PS::MOPS::Constants qw(:all);
use PS::MOPS::DC::Tracklet;
use PS::MOPS::MPC;
my $NEW_CC = 'Robert McMillan <bob@lpl.arizona.edu>, "Ryan, Eileen" <eryan@admin.nmt.edu>, 
    ari@astro-research.org, "J. D. Armstrong" <jd@maile.ifa.hawaii.edu>, tlister@lcogt.net, 
    tholen@ifa.hawaii.edu, micheli@ifa.hawaii.edu, chambers@ifa.hawaii.edu, mopsczar@ifa.hawaii.edu';
my $FOLLOWUP_CC = 'mopsczar@ifa.hawaii.edu';

my $CC;
my $SUBJ;
if ($new) {
    $CC = $NEW_CC;
    $SUBJ = 'PS1 NEO Candidate';
}
else {
    $CC = $FOLLOWUP_CC;
    $SUBJ = 'PS1 NEO Followup';
    $DESIG =~ s/^P1/F0/;       # convert accidental P1 prefix for followups to F0
}


my $inst = $m->notes('INST');

my $trk = modct_retrieve($inst, trackletId => $id);
my $dets_ref = $trk->detections;

my $known_str = 'N/A';
if ($trk->knownId) {
    my $k = modck_lookup($inst, knownId => $trk->knownId);
    $known_str = $k->{known_name};
}

my $id_str = sprintf "%6s", $DESIG;
my $int_str = $inst->dbname;
$int_str =~ s/^.*_//;
$int_str .= "/T$id";
</%init>
