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

Found the original CI model again. Moved it to owncloud. #278

Merged
Show file tree
Hide file tree
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: 6 additions & 3 deletions tests/benchmarks/numeric/import_phantom_3D_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ])
Expand All @@ -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)

Expand Down
11 changes: 10 additions & 1 deletion tests/benchmarks/numeric/run_phantom_3D_model_reduced.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__))
Expand Down Expand Up @@ -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
Expand Down
Binary file not shown.
Loading