<& /htmlheader &>

Alert generated by <% $rule %> rule.


% foreach my $orbit (@orbits) {

Orbital Elements at Epoch <% $orbit->{epoch} %>

Element Value Units
Semi-major Axis (q) <% $orbit->{q} %> AU
Eccentricity (e) <% $orbit->{e} %>  
Inclination (i) <% $orbit->{i} %> deg
Ascending Node <% $orbit->{node} %> deg
Argument of Perihelion <% $orbit->{aop} %> deg
Time of Perihelion <% $orbit->{mjd} %> MJD
Absolute Magnitude <% $orbit->{absMag} %>  
RMS Residuals <% $orbit->{residuals} %> arcsec
chiSq <% $orbit->{chiSq} %>  
JPL convergence code <% $orbit->{convCode} %>  
moid1 <% $orbit->{moid1} %>  
moid2  <% $orbit->{moid2} %>  
% }

Detections

% foreach my $observation (@observations) { % }
Date Magnitude RA (deg) DEC (deg)
<% $observation->{time} %> <% $observation->{mag} %> <% $observation->{ra} %> <% $observation->{dec} %>

Geocentric Ephemerides

% foreach my $ephemeris (@ephemerides) { % }
Date Magnitude RA Err RA DEC Err DEC
<% $ephemeris->{time} %> <% $ephemeris->{mag} %> <% $ephemeris->{ra} %> <% $ephemeris->{errRa} %> <% $ephemeris->{dec} %> <% $ephemeris->{errDec} %>
% foreach my $orbit (@orbits) {

Orbit covariance matrix

  EC QR TP OM W IN
EC <% $orbit->{c01} %> <% $orbit->{c02} %> <% $orbit->{c04} %> <% $orbit->{c07} %> <% $orbit->{c11} %> <% $orbit->{c16} %>
QR   <% $orbit->{c03} %> <% $orbit->{c05} %> <% $orbit->{c08} %> <% $orbit->{c12} %> <% $orbit->{c17} %>
TP     <% $orbit->{c06} %> <% $orbit->{c09} %> <% $orbit->{c13} %> <% $orbit->{c18} %>
OM       <% $orbit->{c10} %> <% $orbit->{c14} %> <% $orbit->{c19} %>
W         <% $orbit->{c15} %> <% $orbit->{c20} %>
IN           <% $orbit->{c21} %>
% } EC = eccentricity; QR = perihelion distance; TP = time perihelion; OM = node; W = arg perihelion; IN = inclination <& /htmlfooter &> <%args> $alertId $rule <%once> use DBI; # intialize database variables. my $dbserver = "mops00.ifa.hawaii.edu"; my $user = "mops"; my $passwd = "mops"; my $inst = "export"; my $connectionStr = "dbi:mysql:host=" . $dbserver . ";database=" . $inst . ";port=3306"; # connect to database my $dbh = DBI->connect($connectionStr, $user, $passwd) || die dbh->errstr; <%init> use strict; use warnings; use XML::Simple; # get the voEvent associated with the alert. my $sql = "select vo_event from export.alerts where alert_id = ?"; my $cursor = $dbh->prepare($sql) || die dbh->errstr; $cursor->execute($alertId); my $result = $cursor->fetchrow_arrayref; my $voEvent = $result->[0]; # ParsevoEvent. my $voEvent_xml = XMLin($voEvent, forcearray=>0); my $whereWhen = $voEvent_xml->{WhereWhen}; my $obsDataLocation = $whereWhen->{ObsDataLocation}; my @observations; my @orbits; my @ephemerides; my $coord; foreach my $obs (@$obsDataLocation){ $coord = $obs->{ObservationLocation}->{AstroCoords}; if (uc($obs->{description}) eq "OBSERVATIONS") { my %observation; $observation{mag} = $coord->{ScalarCoordinate}->{Value}; $observation{time} = $coord->{Time}->{TimeInstant}->{MJDTime}; $observation{ra} = $coord->{Position2D}->{Value2}->{C1}; $observation{dec} = $coord->{Position2D}->{Value2}->{C2}; push(@observations, \%observation); } elsif (uc($obs->{description}) eq "ORBIT") { my %orbit; $orbit{epoch} = $coord->{Time}->{TimeInstant}->{MJDTime}; $orbit{q} = $coord->{Orbit}->{q}->{content}; # semi-major axis, AU $orbit{e} = $coord->{Orbit}->{e}; # eccentricity $orbit{i} = $coord->{Orbit}->{i}->{content}; # inclination, degrees $orbit{node} = $coord->{Orbit}->{Node}->{content}; # longitude of ascending node, degrees $orbit{aop} = $coord->{Orbit}->{Aop}->{content}; # argument of perihelion, degrees $orbit{mjd} = $coord->{Orbit}->{T}->{MJDTime}; # time of perihelion, MJD $orbit{absMag} = $coord->{Orbit}->{h_v}; # abosolute magnitude $orbit{residuals} = $coord->{Orbit}->{residuals}; # RMS residual, arcsec $orbit{chiSq} = $coord->{Orbit}->{chiSq}; # chi-squared statistic $orbit{convCode} = $coord->{Orbit}->{convCode}; # JPL convergence code $orbit{moid1} = $coord->{Orbit}->{moid1}; # minimum orbital intersection distance soln 1 $orbit{moid2} = $coord->{Orbit}->{moid2}; # minimum orbital intersection distance soln 2 # Orbit covariance matrices are upper-triangular matrices obtained from the JPL # differential corrector. The values are passed as a linear array whose elements # are numbered as follows: # # EC QR TP OM W IN # EC 1 2 4 7 11 16 # QR 3 5 8 12 17 # TP 6 9 13 18 # OM 10 14 19 # W 15 20 # IN 21 # # EC = eccentricity # QR = perihelion distance # TP = time perihelion # OM = node # W = arg perihelion # IN = inclination $orbit{c01} = $coord->{Orbit}->{SRC}->{Value21}->{C01}; $orbit{c02} = $coord->{Orbit}->{SRC}->{Value21}->{C02}; $orbit{c03} = $coord->{Orbit}->{SRC}->{Value21}->{C03}; $orbit{c04} = $coord->{Orbit}->{SRC}->{Value21}->{C04}; $orbit{c05} = $coord->{Orbit}->{SRC}->{Value21}->{C05}; $orbit{c06} = $coord->{Orbit}->{SRC}->{Value21}->{C06}; $orbit{c07} = $coord->{Orbit}->{SRC}->{Value21}->{C07}; $orbit{c08} = $coord->{Orbit}->{SRC}->{Value21}->{C08}; $orbit{c09} = $coord->{Orbit}->{SRC}->{Value21}->{C09}; $orbit{c10} = $coord->{Orbit}->{SRC}->{Value21}->{C10}; $orbit{c11} = $coord->{Orbit}->{SRC}->{Value21}->{C11}; $orbit{c12} = $coord->{Orbit}->{SRC}->{Value21}->{C12}; $orbit{c13} = $coord->{Orbit}->{SRC}->{Value21}->{C13}; $orbit{c14} = $coord->{Orbit}->{SRC}->{Value21}->{C14}; $orbit{c15} = $coord->{Orbit}->{SRC}->{Value21}->{C15}; $orbit{c16} = $coord->{Orbit}->{SRC}->{Value21}->{C16}; $orbit{c17} = $coord->{Orbit}->{SRC}->{Value21}->{C17}; $orbit{c18} = $coord->{Orbit}->{SRC}->{Value21}->{C18}; $orbit{c19} = $coord->{Orbit}->{SRC}->{Value21}->{C19}; $orbit{c20} = $coord->{Orbit}->{SRC}->{Value21}->{C20}; $orbit{c21} = $coord->{Orbit}->{SRC}->{Value21}->{C21}; push(@orbits, \%orbit); } elsif (uc($obs->{description}) eq "GEOCENTRIC EPHEMERIDES") { my %ephemeris; $ephemeris{mag} = $coord->{ScalarCoordinate}->{Value}; $ephemeris{time} = $coord->{Time}->{TimeInstant}->{MJDTime}; $ephemeris{ra} = $coord->{Position2D}->{Value2}->{C1}; $ephemeris{dec} = $coord->{Position2D}->{Value2}->{C2}; $ephemeris{errRa} = $coord->{Position2D}->{Error2}->{C1}; $ephemeris{errDec} = $coord->{Position2D}->{Error2}->{C2}; push(@ephemerides, \%ephemeris); } }