Skip to content
Snippets Groups Projects
Commit ae340a58 authored by Maximilian Schanner's avatar Maximilian Schanner
Browse files

Tests

parent 18ed3291
No related branches found
No related tags found
No related merge requests found
import subprocess
import numpy as np
import pymagglobal
lat = 52.24
lon = 13.4
# test the command line tool
subprocess.run(f"pymagglobal master {lat} {lon} --every 5 -o test/potsdam.test"
f" --no-show CALS10k.2", shell=True)
# import the results
new = np.genfromtxt('test/potsdam.test', delimiter=',').T
# generate the same results using the package
splines = pymagglobal.file2splines(pymagglobal.models['CALS10k.2'])
times = new[0]
d, i, f = pymagglobal.master_curve(times, (lat, lon), splines)
assert(np.allclose(d, new[1], atol=1e-6))
assert(np.allclose(i, new[2], atol=1e-6))
assert(np.allclose(f, new[3], atol=1e-6))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment