Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multilayer preproc #1026

Merged
merged 23 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f0d7ef3
add preliminary multilayer preprocessing pipeline
Nov 4, 2024
1cdd471
refactor multilayer_preprocess_tod, move common processing funcs into…
Nov 6, 2024
995c2cc
Merge branch 'master' into parallel_preproc
msilvafe Nov 20, 2024
a0d04f2
Add cfg checker to pp util
msilvafe Nov 20, 2024
59101b7
Align multilayer with pp util instead of sp util
msilvafe Nov 20, 2024
caf8780
Populates reference information in dependent database in multilayer.
msilvafe Nov 20, 2024
563ab88
add multilayer_load_and_preprocess
Nov 21, 2024
acfbdd7
delete preprocess_common.py from site_pipeline
Nov 21, 2024
ccb014d
update multilayer_load_and_preprocess
Nov 22, 2024
e618bb5
Merge branch 'master' into 20241104_multilayer_preproc
msilvafe Nov 25, 2024
d53ed68
add multilayer_preproc_or_load_group
Dec 4, 2024
d72e86c
refactor preprocess_tod, multilayer_preprocess_tod, preproc_and_load_…
Dec 5, 2024
6151012
many bug fixes, some refactoring
Dec 6, 2024
aa82fbb
fix typo
Dec 9, 2024
fa645f4
address comments, add cleanup stage before running through obs
Dec 12, 2024
c81a536
Minor syntax edits.
msilvafe Dec 13, 2024
4c042fb
Merge remote-tracking branch 'origin/master' into 20241104_multilayer…
Dec 13, 2024
464d944
This adds the modifications required to run the mapmaker with multila…
chervias Dec 13, 2024
55907f8
Adding a warning against single precision for maps
chervias Dec 13, 2024
101cd4f
Implementing save_group_and_cleanup into the mapmaker
chervias Dec 13, 2024
9d3708b
address missing entry problem, some other fixes
Dec 13, 2024
e783631
fixing the save_group_and_cleanup block
chervias Dec 14, 2024
765fc8a
Fix to config check failures.
msilvafe Dec 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions sotodlib/mapmaking/demod_mapmaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,9 @@ def make_demod_map(context, obslist, noise_model, info,
Noise model to pass to DemodMapmaker.
info : list
Information for the database, will be written as a .hdf file.
preprocess_config : dict
Dictionary with the config yaml file for the preprocess database.
preprocess_config : list of dict
List of dictionaries with the config yaml file for the preprocess database.
If two, then a multilayer preprocessing is to be used.
prefix : str
Prefix for the output files
shape : tuple, optional
Expand Down Expand Up @@ -492,7 +493,7 @@ def make_demod_map(context, obslist, noise_model, info,
List of outputs from preprocess database. To be used in cleanup_mandb.
"""
from ..preprocess import preprocess_util
context = core.Context(context)
#context = core.Context(context)
if L is None:
L = preprocess_util.init_logger("Demod filterbin mapmaking")
pre = "" if tag is None else tag + " "
Expand All @@ -508,14 +509,23 @@ def make_demod_map(context, obslist, noise_model, info,
errors = [] ; outputs = []; # PENDING: do an allreduce of these.
# not needed for atomic maps, but needed for
# depth-1 maps
if len(preprocess_config)==1:
preproc_init = preprocess_config[0]
preproc_proc = None
else:
preproc_init = preprocess_config[0]
preproc_proc = preprocess_config[1]

for oi in range(len(obslist)):
obs_id, detset, band = obslist[oi][:3]
name = "%s:%s:%s" % (obs_id, detset, band)
error, output, obs = preprocess_util.preproc_or_load_group(obs_id,
configs=preprocess_config,
dets={'wafer_slot':detset, 'wafer.bandpass':band},
logger=L, context=context, overwrite=False)
errors.append(error) ; outputs.append(output) ;
error, output_init, output_proc, obs = preprocess_util.preproc_or_load_group(obs_id,
configs_init=preproc_init,
configs_proc=preproc_proc,
dets={'wafer_slot':detset, 'wafer.bandpass':band},
logger=L,
overwrite=False)
errors.append(error) ; outputs.append((output_init, output_proc)) ;
if error not in [None,'load_success']:
L.info('tod %s:%s:%s failed in the prepoc database'%(obs_id,detset,band))
continue
Expand Down
8 changes: 6 additions & 2 deletions sotodlib/preprocess/pcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,12 @@ def run(self, aman, proc_aman=None, select=True, sim=False, update_plot=False):

"""
if proc_aman is None:
proc_aman = core.AxisManager( aman.dets, aman.samps)
full = core.AxisManager( aman.dets, aman.samps)
if 'preprocess' in aman:
proc_aman = aman.preprocess
full = aman.preprocess
else:
proc_aman = core.AxisManager(aman.dets, aman.samps)
full = core.AxisManager( aman.dets, aman.samps)
run_calc = True
update_plot = False
else:
Expand Down
Loading
Loading