<& /htmlheader &> <& modelheader &>

Field Summary

<% sprintf "Night %d (MJD %.5f-%.5f)", $nn, $mjd, $mjd + 1 %>
<% _mjd2dateonly($nn) %>

% foreach my $item (@goo) { % }
Field ID RA (deg) DEC (deg) Filter Exposure
Time
Num
Detections
Detections Motion
<% "Field ID " . $item->{field_id} . " ($item->{epoch})" %>
<% _mjd2datestr($item->{epoch} + $gmt_offset_hours / 24.0) %>
Observatory <% $item->{obscode} %>
<% $item->{ra} %> <% $item->{dec} %> <% $item->{filter} %> <% $item->{exposure_time} . 's' %> <% $item->{num_dets} %> Summary
% if ($item->{parent_id} eq 'NULL') { Tracklets vs. Known
% } MPC | MITI | PNG | EPS
PNG | EPS | TXT
<& /htmlfooter &> <%args> $mjd => undef $nn => undef <%init> use Astro::Time; use PS::MOPS::Lib qw(:all); # Get basic obsTool summary output. my $model = $m->notes('MODEL'); my $inst = $m->notes('INST'); my $cfg = $inst->getConfig; my $gmt_offset_hours = $cfg->{site}->{gmt_offset_hours}; die "can't get local time" unless defined($gmt_offset_hours); if ($nn) { $mjd = mopslib_nn2mjd($nn, $gmt_offset_hours); } my @stuff = `obsTool --instance $model --show_filter --show_parent_id --show_exposure_time --mjd $mjd`; my @cal = mjd2cal($mjd); my $date = sprintf "%4d-%02d-%02d", @cal[2, 1, 0]; my @things; my @goo; @stuff = grep !/^#/, @stuff; foreach (@stuff) { @things = split /\s+/, $_; push @goo, { field_id => $things[0], num_dets => $things[1], epoch => $things[2], ra => $things[3], dec => $things[4], obscode => $things[6], filter => $things[7], exposure_time => $things[8], parent_id => $things[9], }; } sub _mjd2datestr { my ($mjd) = @_; my ($day, $month, $year, $ut) = mjd2cal($mjd); my ($sign, $hour, $min, $sec) = time2hms($ut, 'H', 2); return sprintf "%4d-%02d-%02d
%02d:%02d:%04.1f", $year, $month, $day, $hour, $min, $sec; } sub _mjd2dateonly { my ($mjd) = @_; my ($day, $month, $year, $ut) = mjd2cal($mjd); return sprintf "%4d-%02d-%02d", $year, $month, $day; } sub _stackify { # Given a list of field-like objects, organize them into "stacks", a hash of lists. # The last item of each sub-list is the parent field. my (@fields) = @_; my %stack; foreach my $field (@fields) { if } }