<& /htmlheader &> <& modelheader &> `

q (AU) (sort) | a (AU) | e | i (deg) | node (deg) | arg_peri (deg) | time_peri (MJD, UT) | H_v | epoch (MJD, UT) | MOPSobject name (sort) | Residual (arcsec) (sort) | MPCheck | History
--- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---
<%perl> if ($all) { print foreach (@stuff); # print all rows } else { print foreach (@stuff); # print first 100 rows }

` <& /htmlfooter &> <%args> $all => 1 $sortby => 'residual' $desc => undef <%init> my $model = $m->notes('MODEL'); my $cmd = "catOrbits --instance $model --format=MITI --nonsynthetic --derived --resid"; my @stuff = `$cmd`; # Sort stuff by residual. if ($desc) { @stuff = reverse @stuff; } if ($sortby =~ /^q/) { @stuff = map { $_->[0] } sort { $a->[1] <=> $b->[1] } map { [ $_, (split /\s+/, $_)[0] ] } # [0] => q @stuff; } elsif ($sortby =~ /^name/) { @stuff = map { $_->[0] } sort { $a->[1] <=> $b->[1] } map { [ $_, (split /\s+/, $_)[8] ] } # [8] => objectName @stuff; } else { # residual @stuff = map { $_->[0] } sort { $a->[1] <=> $b->[1] } map { [ $_, (split /\s+/, $_)[9] ] } # [9] => residual @stuff; } # Put in table tags. my @elems; my $zug; # tmp str foreach my $line (@stuff) { @elems = split /\s+/, $line; # Format for precision. $elems[0] = sprintf "%.5f", $elems[0]; # q $elems[1] = sprintf "%.4f", $elems[1]; # e $elems[2] = sprintf "%.3f", $elems[2]; # i $elems[3] = sprintf "%.6f", $elems[3]; # node $elems[4] = sprintf "%.3f", $elems[4]; # argPeri $elems[5] = sprintf "%.6f", $elems[5]; # timePeri $elems[6] = sprintf "%.3f", $elems[6]; # hV $elems[7] = sprintf "%.6f", $elems[7]; # epoch $elems[9] = sprintf "%.3f", $elems[9]; # residual $elems[10] = qq{Check}; # MPCheck link push @elems, qq{History}; my $a_AU = $elems[1] < 1 ? sprintf "%.4f", $elems[0] / (1 - $elems[1]) : 'N/A'; $line = '
' . join('', $elems[0], $a_AU, @elems[1..$#elems]) . "
\n"; }