psrcat2json.pl   psrcat2json.pl 
skipping to change at line 12 skipping to change at line 12
# #
# read psrcat.db from ATNF Pulsar Catalogue and convert to JSON # read psrcat.db from ATNF Pulsar Catalogue and convert to JSON
# URL: http://www.atnf.csiro.au/research/pulsar/psrcat/download.html # URL: http://www.atnf.csiro.au/research/pulsar/psrcat/download.html
# #
use Math::Trig; use Math::Trig;
$PSRCAT = "./psrcat.db"; $PSRCAT = "./psrcat.db";
$JSON = "./pulsars.json"; $JSON = "./pulsars.json";
$FORMAT = 2; $FORMAT = 2;
$CATVER = 1.44; $CATVER = 1.46;
open (PSRCAT, "<$PSRCAT"); open (PSRCAT, "<$PSRCAT");
@catalog = <PSRCAT>; @catalog = <PSRCAT>;
close PSRCAT; close PSRCAT;
$psrcat = ""; $psrcat = "";
foreach $s (@catalog) { foreach $s (@catalog) {
$psrcat .= $s; $psrcat .= $s;
} }
skipping to change at line 69 skipping to change at line 69
if ($lines[$j] =~ /^ELONG(\s+)([\d\.]+)/) { if ($lines[$j] =~ /^ELONG(\s+)([\d\.]+)/) {
$elong = $2; $elong = $2;
} }
if ($lines[$j] =~ /^ELAT(\s+)([\d\-\+\.]+)/) { if ($lines[$j] =~ /^ELAT(\s+)([\d\-\+\.]+)/) {
$elat = $2; $elat = $2;
} }
if ($lines[$j] =~ /^RAJ(\s+)([\d\-\+\:\.]+)/) { if ($lines[$j] =~ /^RAJ(\s+)([\d\-\+\:\.]+)/) {
($hour,$min,$sec) = split(":",$2); ($hour,$min,$sec) = split(":",$2);
$min += 0;
if ($min<10) { $min = "0".$min; }
$sec += 0; $sec += 0;
if ($sec<10) { $sec = "0".$sec; }
$outRA = $hour."h".$min."m".$sec."s"; $outRA = $hour."h".$min."m".$sec."s";
} }
if ($lines[$j] =~ /^DECJ(\s+)([\d\-\+\:\.]+)/) { if ($lines[$j] =~ /^DECJ(\s+)([\d\-\+\:\.]+)/) {
($deg,$min,$sec) = split(":",$2); ($deg,$min,$sec) = split(":",$2);
$min += 0;
if ($min<10) { $min = "0".$min; }
$sec += 0; $sec += 0;
if ($sec<10) { $sec = "0".$sec; }
$outDE = $deg."d".$min."m".$sec."s"; $outDE = $deg."d".$min."m".$sec."s";
} }
if ($lines[$j] =~ /^P0(\s+)([\d\.]+)/) { if ($lines[$j] =~ /^P0(\s+)([\d\.]+)/) {
$period = $2; $period = $2;
} }
if ($lines[$j] =~ /^P1(\s+)([\d\.\-E]+)/) { if ($lines[$j] =~ /^P1(\s+)([\d\.\-E]+)/) {
$pderivative = $2; $pderivative = $2;
} }
 End of changes. 5 change blocks. 
1 lines changed or deleted 7 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/