Skip to content

Commit ab87ebc

Browse files
committed
added raytracing/scattering test to CI
1 parent 8efda40 commit ab87ebc

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

ci/test.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ fi
2020
${POLARIS_BINARY} ${PROJECTS_PATH}/test/stellar_sed/POLARIS.cmd
2121
${POLARIS_BINARY} ${PROJECTS_PATH}/test/reemission_sphere/POLARIS.cmd
2222
${POLARIS_BINARY} ${PROJECTS_PATH}/test/stellar_scattering_sphere/POLARIS.cmd
23-
# ${POLARIS_BINARY} ${PROJECTS_PATH}/test/raytracing_scattering/POLARIS.cmd
23+
${POLARIS_BINARY} ${PROJECTS_PATH}/test/raytracing_scattering/POLARIS.cmd
2424

2525
# validate output
2626
python3 ${PROJECTS_PATH}/test/stellar_sed/compare.py
2727
python3 ${PROJECTS_PATH}/test/reemission_sphere/compare.py
2828
python3 ${PROJECTS_PATH}/test/stellar_scattering_sphere/compare.py
29-
# python3 ${PROJECTS_PATH}/test/raytracing_scattering/compare.py
29+
python3 ${PROJECTS_PATH}/test/raytracing_scattering/compare.py

projects/test/raytracing_scattering/POLARIS.cmd

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<cmd> CMD_DUST_EMISSION
1515

16-
<detector_dust_polar nr_pixel = "255*255"> 1e-6 1e-3 7 1 0.0 0.0 4.32e+18
16+
<detector_dust_polar nr_pixel = "255*255"> 1e-5 1e-3 5 1 0.0 0.0 4.32e+18
1717

1818
<max_subpixel_lvl> 1
1919

@@ -26,9 +26,10 @@
2626

2727
<cmd> CMD_DUST_EMISSION
2828

29-
<detector_dust_polar nr_pixel = "255*255"> 1e-6 1e-3 7 1 0.0 0.0 4.32e+18
29+
<detector_dust_polar nr_pixel = "255*255"> 1e-5 1e-3 5 1 0.0 0.0 4.32e+18
3030

3131
<source_star nr_photons = "1e6"> 0 0 0 2 4500
32+
<source_dust nr_photons = "2.1e6">
3233

3334
<max_subpixel_lvl> 1
3435

@@ -43,7 +44,7 @@
4344

4445
<cmd> CMD_DUST_SCATTERING
4546

46-
<detector_dust_mc nr_pixel = "255*255"> 1e-6 1e-3 7 0.00 0.00 4.32e+18
47+
<detector_dust_mc nr_pixel = "255*255"> 1e-5 1e-3 5 0.00 0.00 4.32e+18
4748

4849
<source_star nr_photons = "1e6"> 0 0 0 2 4500
4950
<source_dust nr_photons = "2.1e6">

projects/test/raytracing_scattering/compare.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@ def compare():
4343
dust_mc_sed_data = read_data('projects/test/raytracing_scattering/dust_mc/data/polaris_detector_nr0001_sed.fits.gz')
4444

4545
max_rel_diff = np.max(np.abs( (dust_sed_data['I'] + dust_mc_sed_data['I']) / dust_rt_sed_data['I'] - 1.0 ))
46-
if max_rel_diff > 1e-2:
46+
if max_rel_diff > 1e-3:
4747
raise Exception(f'Test failed: Stokes I does not match (max. relative difference = {max_rel_diff})')
4848

4949
mc_polarization = np.sqrt(dust_mc_sed_data['Q']**2 + dust_mc_sed_data['U']**2 + dust_mc_sed_data['V']**2) / (dust_mc_sed_data['I'] + dust_sed_data['I'])
5050
rt_polarization = np.sqrt(dust_rt_sed_data['Q']**2 + dust_rt_sed_data['U']**2 + dust_rt_sed_data['V']**2) / dust_rt_sed_data['I']
5151
max_abs_diff = np.max(np.abs( mc_polarization - rt_polarization ))
52-
if max_abs_diff > 1e-2:
52+
if max_abs_diff > 1e-3:
5353
raise Exception(f'Test failed: Polarization does not match (max. absolute difference = {max_abs_diff})')
5454

5555
max_polarization = np.max(mc_polarization)
56-
if max_polarization > 1e-2:
56+
if max_polarization > 1e-3:
5757
raise Exception(f'Test failed: Polarization is too large (max. value = {max_polarization})')
5858

5959
return True

0 commit comments

Comments
 (0)