%doc>
=head1 NAME
exposures.html
=head1 SYNOPSIS
Use:
exposures.html?instance="database_name"&nn="night_number"
=head1 Description
This mason component displays a table showing the chunks downloaded from the
telescope to IPP. For each chunk the table shows the number of exposures in the
chunk as well as the number of exposures that have been ingested into MOPS.
=head1 ARGUMENTS
=over 4
=item instance
Name of the database containing the MOPS data.
=item nn
The night number from which the chunks will be retrieved.
=back
=head1 AUTHOR
Denver Green, Edgreen@ifa.hawaii.eduE.
=head1 COPYRIGHT
Copyright 2012 by Institute for Astronomy, University of Hawaii.
=head1 DATE
17-Feb-2012
=cut
%doc>
<%args>
$instance
$nn
%args>
<%init>
use PS::MOPS::Admin qw(:all);
use PS::MOPS::Constants qw($FIELD_STATUS_INGESTED);
# Get list of exposures downloaded to IPP from the summit.
my $ipp_exp_ref = PS::MOPS::Admin::list_ipp_fields($nn);
# Get list of exposures ingested into MOPS.
my $mops_exp_ref = PS::MOPS::Admin::list_mops_fields($instance, $nn);
# Get list of missing exposures.
my $missing_exp_ref = PS::MOPS::Admin::list_missing_exposures($instance, $nn);
# Combine IPP and MOPS exposures into one hash so as to make
# it easy to generate a table reporting the data.
my %chunks;
my $chunk;
my $total_exposures;
my $ingested_exposures;
foreach $chunk (keys(%$ipp_exp_ref)) {
$total_exposures = $ipp_exp_ref->{$chunk};
if (exists $mops_exp_ref->{$chunk}) {
$ingested_exposures = $mops_exp_ref->{$chunk};
} else {
$ingested_exposures = 0;
}
$chunks{$chunk} = [$total_exposures, $ingested_exposures];
}
%init>