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

Sim context without database #636

Merged
Changes from all commits
Commits
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
9 changes: 7 additions & 2 deletions straxen/contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import strax
import straxen
from copy import deepcopy
from warnings import warn

common_opts = dict(
register_all=[
Expand Down Expand Up @@ -219,6 +220,7 @@ def xenonnt_led(**kwargs):
st.register([straxen.DAQReader, straxen.LEDCalibration])
return st


def xenonnt_simulation(
output_folder='./strax_data',
cmt_run_id_sim=None,
Expand All @@ -234,7 +236,7 @@ def xenonnt_simulation(
drift_time_gate='electron_drift_time_gate',
drift_velocity_liquid='electron_drift_velocity',
electron_lifetime_liquid='elife_conf'),
**kwargs):
**kwargs):
"""
The most generic context that allows for setting full divergent
settings for simulation purposes
Expand Down Expand Up @@ -286,7 +288,10 @@ def xenonnt_simulation(
**straxen.contexts.xnt_common_config,),
**straxen.contexts.xnt_common_opts, **kwargs)
st.register(wfsim.RawRecordsFromFaxNT)
st.apply_cmt_version(f'global_{cmt_version}')
if straxen.utilix_is_configured():
st.apply_cmt_version(f'global_{cmt_version}')
else:
warn(f'Bad context as we cannot set CMT since we have no database access')

if _forbid_creation_of is not None:
st.context_config['forbid_creation_of'] += strax.to_str_tuple(_forbid_creation_of)
Expand Down