Skip to content

Commit 9d70146

Browse files
committed
raise when toltec_array_loading and toast_atm are both set
1 parent c444715 commit 9d70146

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

tolteca/simu/__init__.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ def get_source_model(self):
619619
f"{e}")
620620
sources.append(s)
621621

622-
if not sources:
622+
if not sources and not cfg['toast_atm']:
623623
raise SimulatorRuntimeError("no valid simulation sources found.")
624624
return sources
625625

@@ -690,6 +690,22 @@ def run(self):
690690
### toast atmosphere calculation
691691
###
692692
if cfg['toast_atm']:
693+
# check if the toltec array loading model is specified
694+
# and remove it from the source list
695+
# check the sources for array loading model
696+
from .toltec import ArrayLoadingModel
697+
if sources is not None:
698+
for source in sources:
699+
if isinstance(source, dict) and isinstance(
700+
next(iter(source.values())), ArrayLoadingModel):
701+
array_loading_model = source
702+
break
703+
else:
704+
array_loading_model = None
705+
else:
706+
array_loading_model = None
707+
if array_loading_model is not None:
708+
raise ValueError("toltec_array_loading has to be disabled with toast_atm enabled")
693709
from .toltec.atm import ToastAtmosphereSimulation
694710
self.logger.info("generating the atmosphere/simulation")
695711
# make t grid for atm (1 second intervals; high resolution not required)

0 commit comments

Comments
 (0)