Skip to content

Commit

Permalink
added truncation of 2d k plane for noise realizations
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-switzer committed Feb 4, 2013
1 parent 7b77665 commit 30f7e9d
Show file tree
Hide file tree
Showing 15 changed files with 680 additions and 30 deletions.
69 changes: 64 additions & 5 deletions input/ers/autopower/autopower_main.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ from foreground_clean import pair_set_extended
from quadratic_products import pwrspec_combinations
from quadratic_products import auto_pwrspec_compile
from quadratic_products import auto_pwrspec_analyze
from quadratic_products import aggregate_bulksim
import struct
import os

Expand All @@ -15,13 +16,19 @@ import os
#-----------------------------------------------------------------------------
do_ext_cleaning = False
do_power = False
do_power_compile = True
do_power_compile = False
do_noisemodel_compile = True
do_analysis = True

basemap = 'GBT_1hr_map_oldcalpolstack'
# order1, conv, refine1, omega0p5, weighted, onesided, IQU
output_tag = "onesided_ixi_conv1p4_clipnoise"

# these point to the thermal noise simulations
# TODO CHECK THIS FOR 1Hr field
basemap_noisemodel = 'GBT_1hr_map_oldcal'
fix_weight_treatment = "10modes"

# cleaning options
nfreq = 256
cutlist = [6, 7, 8, 15, 16, 18, 19, 20, 21, 22, 37, 80, 103, 104, 105, 106, \
Expand All @@ -36,7 +43,7 @@ clean_common_res_convolution = True
clean_sub_weighted_mean = True
clean_factorizable = True
clean_weighted_svd = False
clean_clip_weight = 50
clean_clip_weight = 50.

# power spectrum settings
pwr_bins = [0.003, 2.5, 45]
Expand All @@ -63,6 +70,9 @@ kpar_range = [0.04, 1.]
baseauto = basemap + "_x_" + basemap
baseauto_with_tag = baseauto + "_" + output_tag

# settings for the Gaussian errors
base_noisemodel_with_tag = basemap_noisemodel + "_noise_simulations"

# if the transfer function has a different tag
trans_output_tag = output_tag
trans_output_name = baseauto + "_" + trans_output_tag + "_transfer_function"
Expand Down Expand Up @@ -235,6 +245,55 @@ autopower3_outdir = pwrout_plots_notrans
autopower3_kperp_range = kperp_range
autopower3_kpar_range = kpar_range

#-----------------------------------------------------------------------------
# Run the noise simulations through the same set of cuts
#-----------------------------------------------------------------------------
if do_noisemodel_compile:
pipe_modules.append((aggregate_bulksim.AggregateSummary, ('as1_', 'as_')))
as1_apply_2d_beamtransfer = trans_beam
as1_apply_2d_modetransfer = trans_mode
#as1_apply_2d_beamtransfer = None
#as1_apply_2d_modetransfer = None
if pwr_2d_to_1d_noiseweight:
as1_noiseweights_2dto1d = pwrout_base + "noiseweight.hd5"
else:
as1_noiseweights_2dto1d = None
as1_fix_weight_treatment = fix_weight_treatment
as1_directory = "%s/%s_xspec/" % (pwrout_root, base_noisemodel_with_tag)
as1_basefile = "%s_sim_" % base_noisemodel_with_tag
as1_outfile = "%s/%s_noise_xspec.hd5" % (pwrout_root, baseauto_with_tag)
as1_kperp_range = kperp_range
as1_kpar_range = kpar_range

if do_noisemodel_compile:
pipe_modules.append((aggregate_bulksim.AggregateSummary, ('as2_', 'as_')))
as2_apply_2d_beamtransfer = trans_beam
as2_apply_2d_modetransfer = trans_mode
#as2_apply_2d_beamtransfer = None
#as2_apply_2d_modetransfer = None
if pwr_2d_to_1d_noiseweight:
as2_noiseweights_2dto1d = pwrout_base + "noiseweight.hd5"
else:
as2_noiseweights_2dto1d = None
as2_fix_weight_treatment = fix_weight_treatment
as2_directory = "%s/%s_auto/" % (pwrout_root, base_noisemodel_with_tag)
as2_basefile = "%s_sim_" % base_noisemodel_with_tag
as2_outfile = "%s/%s_noise_auto.hd5" % (pwrout_root, baseauto_with_tag)
as2_kperp_range = kperp_range
as2_kpar_range = kpar_range

if do_noisemodel_compile:
pipe_modules.append((aggregate_bulksim.AggregateStatistics, ('ast1_', 'ast_')))
ast1_aggfile_in = as1_outfile
ast1_statfile_out = "%s/%s_stat_noise_xspec.hd5" % (pwrout_root, baseauto_with_tag)
ast1_outplotdir = "%s/%s_noise_xspec/" % (outplotdir, baseauto_with_tag)

if do_noisemodel_compile:
pipe_modules.append((aggregate_bulksim.AggregateStatistics, ('ast2_', 'ast_')))
ast2_aggfile_in = as2_outfile
ast2_statfile_out = "%s/%s_stat_noise_auto.hd5" % (pwrout_root, baseauto_with_tag)
ast2_outplotdir = "%s/%s_noise_auto/" % (outplotdir, baseauto_with_tag)

#-----------------------------------------------------------------------------
# Perform an analysis of the final spectra
#-----------------------------------------------------------------------------
Expand All @@ -244,9 +303,9 @@ if not os.path.isdir(pwrout_plots):

if do_analysis:
pipe_modules.append(auto_pwrspec_analyze.AnalyzeAutopower)
analyzeautopower_sim_auto_summary = pwrout_root + basemap + "_noise_simulations_stat_auto.hd5"
analyzeautopower_sim_xspec_summary = pwrout_root + basemap + "_noise_simulations_stat_xspec.hd5"
analyzeautopower_data_auto_summary = pwrout_base + "measured_AxA.hd5"
analyzeautopower_sim_xspec_summary = ast1_statfile_out
analyzeautopower_sim_auto_summary = ast2_statfile_out
analyzeautopower_data_xspec_summary = pwrout_base + "measured_xspec.hd5"
analyzeautopower_data_auto_summary = pwrout_base + "measured_AxA.hd5"
analyzeautopower_outdir = pwrout_analysis_plots

71 changes: 65 additions & 6 deletions input/ers/autopower/autopower_main_15hrpaper.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ from foreground_clean import pair_set_extended
from quadratic_products import pwrspec_combinations
from quadratic_products import auto_pwrspec_compile
from quadratic_products import auto_pwrspec_analyze
from quadratic_products import aggregate_bulksim
import struct
import os

Expand All @@ -15,13 +16,19 @@ import os
#-----------------------------------------------------------------------------
do_ext_cleaning = False
do_power = False
do_power_compile = True
do_power_compile = False
do_noisemodel_compile = True
do_analysis = True

basemap = 'GBT_15hr_map_oldcalpolstack'
# order1, conv, refine1, omega0p5, weighted, onesided, IQU
#output_tag = "onesided_ixi_conv1p4_clipnoise_bfwindow_svdweighted"
output_tag = "onesided_ixi_conv1p4_clipnoise_bfwindow"

# these point to the thermal noise simulations
basemap_noisemodel = 'GBT_15hr_map_oldcal'
fix_weight_treatment = "10modes"

# cleaning options
nfreq = 256
cutlist = [6, 7, 8, 15, 16, 18, 19, 20, 21, 22, 37, 80, 103, 104, 105, 106, \
Expand All @@ -35,8 +42,8 @@ clean_conv_factor = 1.4
clean_common_res_convolution = True
clean_sub_weighted_mean = True
clean_factorizable = True
clean_weighted_svd = False
clean_clip_weight = 50
clean_weighted_svd = True
clean_clip_weight = 50.

# power spectrum settings
pwr_bins = [0.003, 2.5, 45]
Expand All @@ -63,6 +70,9 @@ kpar_range = [0.04, 1.]
baseauto = basemap + "_x_" + basemap
baseauto_with_tag = baseauto + "_" + output_tag

# settings for the Gaussian errors
base_noisemodel_with_tag = basemap_noisemodel + "_noise_simulations"

# if the transfer function has a different tag
trans_output_tag = output_tag
trans_output_name = baseauto + "_" + trans_output_tag + "_transfer_function"
Expand Down Expand Up @@ -235,6 +245,55 @@ autopower3_outdir = pwrout_plots_notrans
autopower3_kperp_range = kperp_range
autopower3_kpar_range = kpar_range

#-----------------------------------------------------------------------------
# Run the noise simulations through the same set of cuts
#-----------------------------------------------------------------------------
if do_noisemodel_compile:
pipe_modules.append((aggregate_bulksim.AggregateSummary, ('as1_', 'as_')))
as1_apply_2d_beamtransfer = trans_beam
as1_apply_2d_modetransfer = trans_mode
#as1_apply_2d_beamtransfer = None
#as1_apply_2d_modetransfer = None
if pwr_2d_to_1d_noiseweight:
as1_noiseweights_2dto1d = pwrout_base + "noiseweight.hd5"
else:
as1_noiseweights_2dto1d = None
as1_fix_weight_treatment = fix_weight_treatment
as1_directory = "%s/%s_xspec/" % (pwrout_root, base_noisemodel_with_tag)
as1_basefile = "%s_sim_" % base_noisemodel_with_tag
as1_outfile = "%s/%s_noise_xspec.hd5" % (pwrout_root, baseauto_with_tag)
as1_kperp_range = kperp_range
as1_kpar_range = kpar_range

if do_noisemodel_compile:
pipe_modules.append((aggregate_bulksim.AggregateSummary, ('as2_', 'as_')))
as2_apply_2d_beamtransfer = trans_beam
as2_apply_2d_modetransfer = trans_mode
#as2_apply_2d_beamtransfer = None
#as2_apply_2d_modetransfer = None
if pwr_2d_to_1d_noiseweight:
as2_noiseweights_2dto1d = pwrout_base + "noiseweight.hd5"
else:
as2_noiseweights_2dto1d = None
as2_fix_weight_treatment = fix_weight_treatment
as2_directory = "%s/%s_auto/" % (pwrout_root, base_noisemodel_with_tag)
as2_basefile = "%s_sim_" % base_noisemodel_with_tag
as2_outfile = "%s/%s_noise_auto.hd5" % (pwrout_root, baseauto_with_tag)
as2_kperp_range = kperp_range
as2_kpar_range = kpar_range

if do_noisemodel_compile:
pipe_modules.append((aggregate_bulksim.AggregateStatistics, ('ast1_', 'ast_')))
ast1_aggfile_in = as1_outfile
ast1_statfile_out = "%s/%s_stat_noise_xspec.hd5" % (pwrout_root, baseauto_with_tag)
ast1_outplotdir = "%s/%s_noise_xspec/" % (outplotdir, baseauto_with_tag)

if do_noisemodel_compile:
pipe_modules.append((aggregate_bulksim.AggregateStatistics, ('ast2_', 'ast_')))
ast2_aggfile_in = as2_outfile
ast2_statfile_out = "%s/%s_stat_noise_auto.hd5" % (pwrout_root, baseauto_with_tag)
ast2_outplotdir = "%s/%s_noise_auto/" % (outplotdir, baseauto_with_tag)

#-----------------------------------------------------------------------------
# Perform an analysis of the final spectra
#-----------------------------------------------------------------------------
Expand All @@ -244,9 +303,9 @@ if not os.path.isdir(pwrout_plots):

if do_analysis:
pipe_modules.append(auto_pwrspec_analyze.AnalyzeAutopower)
analyzeautopower_sim_auto_summary = pwrout_root + basemap + "_noise_simulations_stat_auto.hd5"
analyzeautopower_sim_xspec_summary = pwrout_root + basemap + "_noise_simulations_stat_xspec.hd5"
analyzeautopower_data_auto_summary = pwrout_base + "measured_AxA.hd5"
analyzeautopower_sim_xspec_summary = ast1_statfile_out
analyzeautopower_sim_auto_summary = ast2_statfile_out
analyzeautopower_data_xspec_summary = pwrout_base + "measured_xspec.hd5"
analyzeautopower_data_auto_summary = pwrout_base + "measured_AxA.hd5"
analyzeautopower_outdir = pwrout_analysis_plots

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pipe_processes = 1
from quadratic_products import aggregate_bulksim
#basemap = "GBT_15hr_map_oldcal"
basemap = "GBT_1hr_map_oldcalpolstack"

pwrout_root = '/mnt/raid-project/gmrt/eswitzer/GBT/pwrspec/'
output_tag = basemap + "_" + "noise_simulations"
pwrout_base = pwrout_root + output_tag
Expand Down
3 changes: 2 additions & 1 deletion input/ers/autopower/compile_transfer.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ basemap = "GBT_15hr_map_oldcalpolstack"
# order1, conv, refine1, omega0p5, weighted, onesided, IQUV
#output_tag = "onesided_iqu_conv1p4_clipnoise"
#output_tag = "onesided_ixi_conv1p4_clipnoise"
output_tag = "onesided_ixi_conv1p4_clipnoise_bfwindow"
#output_tag = "onesided_ixi_conv1p4_clipnoise_bfwindow"
output_tag = "onesided_ixi_conv1p4_clipnoise_bfwindow_svdweighted"
input_multiplier = 1.
square_transfer = True

Expand Down
4 changes: 2 additions & 2 deletions input/ers/autopower/onesided_bulksim_15hrpaper.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ do_cleanup = True

basemap = "GBT_15hr_map_oldcalpolstack"
# order1, conv, refine1, omega0p5, weighted, onesided, IQU
output_tag = "onesided_ixi_conv1p4_clipnoise_bfwindow"
output_tag = "onesided_ixi_conv1p4_clipnoise_bfwindow_svdweighted"

# simulation options
sim_refinement = 2.
Expand All @@ -44,7 +44,7 @@ clean_common_res_convolution = True
clean_sub_weighted_mean = True
clean_factorizable = True
clean_sim_multiplier = 1.
clean_weighted_svd = False
clean_weighted_svd = True
clean_clip_weight = 50

# power spectrum settings
Expand Down
Loading

0 comments on commit 30f7e9d

Please sign in to comment.