diff --git a/tests/benchmarks/numeric/import_phantom_3D_model.py b/tests/benchmarks/numeric/import_phantom_3D_model.py index 544560dc..6ffa7caf 100644 --- a/tests/benchmarks/numeric/import_phantom_3D_model.py +++ b/tests/benchmarks/numeric/import_phantom_3D_model.py @@ -28,10 +28,11 @@ def import_phantom(): model_file = os.path.join(modeldir, 'model_Phantom_3D.hdf5') # Resulting Magritte model lamda_file = os.path.join(datadir, 'co.txt' ) # Line data file - dump_link = "https://github.com/Ensor-code/phantom-models/raw/main/Malfait+2021/v05e50/wind_v05e50?download=" - setup_link = "https://raw.githubusercontent.com/Ensor-code/phantom-models/main/Malfait%2B2021/v05e50/wind.setup" - input_link = "https://raw.githubusercontent.com/Ensor-code/phantom-models/main/Malfait%2B2021/v05e50/wind.in" lamda_link = "https://home.strw.leidenuniv.nl/~moldata/datafiles/co.dat" + # dump_link = "https://owncloud.ster.kuleuven.be/index.php/s/qgxytfnqW7dSiLo/download/wind_00574" + dump_link = "https://owncloud.ster.kuleuven.be/index.php/s/Et6CXYpZwjBXsJe/download/wind_00350" + input_link = "https://owncloud.ster.kuleuven.be/index.php/s/w9tgWmC2CfkPm7p/download/wind.in" + setup_link = "https://owncloud.ster.kuleuven.be/index.php/s/ZP6KwiASYgAayaK/download/wind.setup" # %%capture subprocess.run(['wget', dump_link, '--output-document', dump_file ]) @@ -44,6 +45,8 @@ def import_phantom(): # !wget $lamda_link --output-document $lamda_file # Loading the data with plons + print("datadir: ", datadir) + print("dump_file: ", dump_file) setupData = plons.LoadSetup(datadir, "wind") dumpData = plons.LoadFullDump(dump_file, setupData) diff --git a/tests/benchmarks/numeric/run_phantom_3D_model_reduced.py b/tests/benchmarks/numeric/run_phantom_3D_model_reduced.py index b883a288..7a6ac01f 100644 --- a/tests/benchmarks/numeric/run_phantom_3D_model_reduced.py +++ b/tests/benchmarks/numeric/run_phantom_3D_model_reduced.py @@ -14,7 +14,7 @@ import magritte.core as magritte import magritte.plot as plot -VERSION = "0.9.0"#reference version of Magritte to compare against; should correspond to a commited intensity file +VERSION = "0.9.5"#reference version of Magritte to compare against; should correspond to a commited intensity file #starting from 0.9.0, we compute the intensity for 4 lines at the same time, instead of just a single line. This is still not a realistic usecase, but suffices for regression testing. path = os.path.dirname(os.path.realpath(__file__)) @@ -71,6 +71,15 @@ def run_model (nosave=True): reference_intensity = np.load(f'{datadir}{modelName}_NLTE_intensity_magritte_{VERSION}.npy') reldiff = tools.relative_error(reference_intensity, np.array(model.images[0].I)) + # For debugging, plot the intensity and reference intensity + # plt.figure() + # plt.imshow(np.log10(np.array(model.images[0].I).reshape(256, 256, -1))[:, :, 10], origin='lower') + # plt.colorbar() + # plt.title('log10(intensity)') + # plt.figure() + # plt.imshow(np.log10(reference_intensity).reshape(256, 256, -1)[:, :, 10], origin='lower') + # plt.colorbar() + # plt.show() print(result) print("maximum relative difference: ", np.max(reldiff))#only for a few points a significant difference can be seen diff --git a/tests/data/wind_00350_red_NLTE_intensity_magritte_0.9.5.npy b/tests/data/wind_00350_red_NLTE_intensity_magritte_0.9.5.npy new file mode 100644 index 00000000..33a1417a Binary files /dev/null and b/tests/data/wind_00350_red_NLTE_intensity_magritte_0.9.5.npy differ