cloudy-agn/scripts/convert/continuum_rydberg_to_eV.pl

31 lines
639 B
Perl
Raw Normal View History

2017-07-04 09:12:02 +00:00
#!/usr/bin/env perl
use utf8;
use Encode qw(encode decode);
use feature 'say';
use locale;
use constant PI => 4 * atan2(1, 1);
if (!${^UTF8LOCALE}) {
say encode($charset,"You are not using UTF-8 encoding. :(");
}
my $charset=$ENV{LANG};
my $table_input_filename=$ARGV[0];
#my $table_output_filename=$argv[1] or die $!;
open $ryd_file,'<',$table_input_filename or die $!;
while( my $line = <$ryd_file>) {
my ($rydbergs, $sed1, $sed2) = split ' ', $line;
say encode($charset,
sprintf("%e %e %e",
$rydbergs*13.60569253,
$sed1,
$sed2));
}
close $ryd_file;