Skip to content

Commit

Permalink
add test for sweep scan conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
rettigl committed Feb 28, 2024
1 parent e1a5323 commit 691b9f3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/data
Submodule data updated from d48b11 to 28cf9b
29 changes: 29 additions & 0 deletions tests/test_specsscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,32 @@ def test_default_config():
assert isinstance(sps.config, dict)
assert "spa_params" in sps.config.keys()
assert sps.config["spa_params"]["apply_fft_filter"] is False


def test_process_sweep_scan():
"""Test the conversion of a sweep scan"""
config = {
"spa_params": {
"ek_range_min": 0.07597844332538357,
"ek_range_max": 0.8965456312395133,
"ang_range_min": 0.16732026143790849,
"ang_range_max": 0.8449673202614381,
"Ang_Offset_px": 13,
"rotation_angle": 2,
"crop": True,
},
}
sps = SpecsScan(
config=config,
user_config=package_dir + "/config/example_config_FHI.yaml",
system_config={},
)
res_xarray = sps.load_scan(
scan=6455,
path=package_dir + "/../tests/data/",
)
assert res_xarray.energy[0].values.item() == 20.953256232558136
assert res_xarray.energy[-1].values.item() == 21.02424460465116
assert (
(res_xarray.sum(axis=0) - res_xarray.sum(axis=0).mean()) < 0.1 * res_xarray.sum(axis=0)
).all()

0 comments on commit 691b9f3

Please sign in to comment.