Repository navigation
Expand file tree
/
Copy pathprocess_galaxy_step2.py
More file actions
61 lines (44 loc) · 2.06 KB
/
Copy pathprocess_galaxy_step2.py
File metadata and controls
61 lines (44 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
"""run iterative processing of galactic background"""
import GalacticStochastic.global_file_index as gfi
import GalacticStochastic.plot_creation_helpers as pch
from GalacticStochastic.background_decomposition import BGDecomposition
from GalacticStochastic.config_helper import get_config_objects
from GalacticStochastic.inclusion_state_manager import BinaryInclusionState
from GalacticStochastic.iterative_fit_manager import IterativeFitManager
from GalacticStochastic.iterative_fit_state_machine import IterativeFitState
from GalacticStochastic.noise_manager import NoiseModelManager
from WaveletWaveforms.sparse_waveform_functions import PixelGenericRange
if __name__ == '__main__':
config_file = 'default_parameters.toml'
config, wc, lc, ic, instrument_random_seed = get_config_objects(config_file)
galaxy_file = config['files']['galaxy_file']
cyclo_mode = 1
preprocess_mode = 2
nt_min = 0
nt_max = wc.Nt
nt_lim_snr = PixelGenericRange(nt_min, nt_max, wc.DT, 0.)
nt_lim_waveform = PixelGenericRange(nt_min, nt_max, wc.DT, 0.)
params_gb, _ = gfi.get_full_galactic_params(config)
fit_state = IterativeFitState(ic, preprocess_mode=preprocess_mode)
bgd = BGDecomposition(wc, ic.nc_galaxy, storage_mode=ic.background_storage_mode)
noise_manager = NoiseModelManager(ic, wc, lc, fit_state, bgd, cyclo_mode, nt_lim_snr, instrument_random_seed)
bis = BinaryInclusionState(wc, ic, lc, params_gb, noise_manager, fit_state, nt_lim_waveform)
ifm = IterativeFitManager(ic, fit_state, noise_manager, bis)
ifm.do_loop()
do_hf_out = True
if do_hf_out:
gfi.store_processed_gb_file(
config,
wc,
ifm,
params_gb_in=params_gb,
write_mode=0,
preprocess_mode=preprocess_mode,
)
del params_gb
do_plot_noise_spectrum_ambiguity = True
if do_plot_noise_spectrum_ambiguity:
pch.plot_noise_spectrum_ambiguity(ifm)
do_plot_noise_spectrum_evolve = True
if do_plot_noise_spectrum_evolve:
pch.plot_noise_spectrum_evolve(ifm)