<%args> $fpa_id <%init> use Astro::Time; # Convert FPA id to args for Nick's browser. Ned # http://po.ifa.hawaii.edu/iqanalysis/scripts/psfbrowser.php?yyyymmdd=20101003/&filesetid=o5472g0323o # href="http://po.ifa.hawaii.edu/iqanalysis/scripts/psfbrowser.php?filesetid= if ($fpa_id =~ /^o(\d\d\d\d)/) { my $mjd = 50000 + $1; # PS1 TJD => MJD my ($day, $mon, $year, $ut) = Astro::Time::mjd2cal($mjd); my $cal = sprintf "%4d%02d%02d", $year, $mon, $day; my $url = "http://po.ifa.hawaii.edu/iqanalysis/scripts/psfbrowser.php?yyyymmdd=$cal/&filesetid=$fpa_id"; $r->method('GET'); $r->headers_in->unset('Content-length'); $r->content_type('text/html'); $r->headers_out->add(Location=>$url); $m->abort(302); } else { $m->abort(404); }