<%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


% foreach $chunk (sort(keys(%chunks))) { <%perl> # Dim row if chunk has any status other than ingested. my $res = PS::MOPS::Admin::chunk_has_status($instance, $nn, $chunk, $FIELD_STATUS_INGESTED); % }
Chunk Name Registered
in IPP
Ingested
into MOPS
Missing
exposures
Ready for
processing
> <% $chunk %> > <% $chunks{$chunk}[0] %> > <% $chunks{$chunk}[1] %> <%perl> # Create url that will be used to show missing exposures. This URL # will call the mason compnent missing_exposures.html with a list of # missing exposures. my $url = "missing_exposures.html?"; my $exp; # Generate the list of exposures to be passed. foreach $exp (@{$missing_exp_ref->{$chunk}}) { $url .= "exp=$exp&"; } # Remove trailing ampersand from $url $url = substr($url, 0, -1); % if ($chunks{$chunk}[0] == $chunks{$chunk}[1]) { None % } else { <% $chunks{$chunk}[0] - $chunks{$chunk}[1] %> % } <%perl> # Show check box only if a field that makes up the chunks has a # status of I. $res = PS::MOPS::Admin::chunk_has_status($instance, $nn, $chunk, $FIELD_STATUS_INGESTED); % if ($res) { /> % }

<%args> $instance $nn <%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]; }