converting to use of perl records

This commit is contained in:
caes 2016-06-20 17:04:44 -04:00
parent a66b3bb1d1
commit ee2a2f5186

View File

@ -64,16 +64,16 @@ if ($debug) {
# These arrays store the various quantities of interest.
@freq_coords_avg = [];
@freq_coords_err = [];
@power_curve_source_avg = [];
@power_curve_source_err = [];
@power_curve_reprocessed_avg = [];
@power_curve_reprocessed_err = [];
@cross_correlation_power_curve_avg = [];
@cross_correlation_power_curve_err = [];
@phase_difference_avg = [];
@phase_difference_err = [];
@time_lag_avg = [];
@time_lag_err = [];
@arr_power_curve_source_avg = [];
@arr_power_curve_source_err = [];
@arr_power_curve_reprocessed_avg = [];
@arr_power_curve_reprocessed_err = [];
@arr_cross_correlation_power_curve_avg = [];
@arr_cross_correlation_power_curve_err = [];
@arr_phase_difference_avg = [];
@arr_phase_difference_err = [];
@arr_time_lag_avg = [];
@arr_time_lag_err = [];
# This captures the frequency bins.
my $upper_bound = 0;
@ -110,8 +110,8 @@ while (<$outputfile>) {
print encode($charset,"Driving light curve power from $_");
say encode($charset,"Average: $avg, Err: $err");
}
push(@power_curve_source_avg,$avg);
push(@power_curve_source_err,$err);
push(@arr_power_curve_source_avg,$avg);
push(@arr_power_curve_source_err,$err);
$mode++;
}
case 1 {
@ -122,8 +122,8 @@ while (<$outputfile>) {
print encode($charset,"Reprocessed light curve power from $_");
say encode($charset,"Average: $avg, Err: $err");
}
push(@power_curve_reprocessed_avg,$avg);
push(@power_curve_reprocessed_err,$err);
push(@arr_power_curve_reprocessed_avg,$avg);
push(@arr_power_curve_reprocessed_err,$err);
$mode++;
}
case 2 {
@ -134,8 +134,8 @@ while (<$outputfile>) {
print encode($charset,"Cross-Correlation from $_");
say encode($charset,"Average: $avg, Err: $err");
}
push(@cross_correlation_power_curve_avg,$avg);
push(@cross_correlation_power_curve_err,$err);
push(@arr_cross_correlation_power_curve_avg,$avg);
push(@arr_cross_correlation_power_curve_err,$err);
$mode++;
}
case 3 {
@ -146,15 +146,31 @@ while (<$outputfile>) {
print encode($charset,"Phase different from $_");
say encode($charset,"Average: $avg, Err: $err");
}
push(@phase_difference_avg,$avg);
push(@phase_difference_err,$err);
push(@arr_phase_difference_avg,$avg);
push(@arr_phase_difference_err,$err);
my %freqrecord = ( "arr_power_curve_source_avg" => arr_power_curve_source_avg)
$mode = 0;
}
} # End switch
}
$numvals = scalar @power_curve_source_avg;
say encode($charset,"Saved $numvals sets of quantities.");
$numvals = scalar @arr_power_curve_source_avg;
say encode($charset,"Retrieved $numvals sets of quantities.");
# This section builds the records
foreach(@freq_coords_avg) {
}
open($datafile,'>',"tmp.sourcePSD") or die $!;
open($datafile,'>',"tmp.reprocPSD") or die $!;
foreach(@freq_coords_avg)