Skip to content

Commit

Permalink
Fix response unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
israelmcmc committed May 6, 2024
1 parent 984dc5a commit 8a631cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions cosipy/response/FullDetectorResponse.py
Original file line number Diff line number Diff line change
Expand Up @@ -1096,9 +1096,8 @@ def get_expectation():
# Spectrum
model = ModelParser(model_dict=config['sources']).get_model()

for src_name, src in model.point_sources.items():
for comp_name, component in src.components.items():
logger.info(f"Using spectrum:\n {component.shape}")
spectrum = model.point_sources['source'].components['main'].shape
logger.info(f"Using spectrum:\n {spectrum}")

# Expectation
expectation = psr.get_expectation(spectrum).project('Em')
Expand Down
2 changes: 1 addition & 1 deletion tests/response/test_detector_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def test_cosi_response(tmp_path):

cosi_response(['dump', 'expectation', str(response_path),
'-c', str(test_data.path/'cosi-response-config-example.yaml'),
'--config-override', 'source:spectrum:kwargs:index=3'])
'--config-override', 'sources:source (point source):spectrum:main:Powerlaw:index:value=-3'])

cosi_response(['plot', 'expectation', str(response_path),
'-c', str(test_data.path/'cosi-response-config-example.yaml'),
Expand Down

0 comments on commit 8a631cf

Please sign in to comment.