Skip to content

Commit b0d01fe

Browse files
committed
TES: Added coverage for simple interface run
1 parent 0c1d282 commit b0d01fe

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

pysatMagVect/tests/test_core.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,6 +1580,38 @@ def test_unit_vector_component_plots_edge_steps(self):
15801580
except:
15811581
pass
15821582

1583+
def test_simple_geomagnetic_basis_interface(self):
1584+
"""Ensure simple geomagnetic basis interface runs"""
1585+
1586+
p_lats, p_longs, p_alts = gen_plot_grid_fixed_alt(550.)
1587+
# data returned are the locations along each direction
1588+
# the full range of points obtained by iterating over all
1589+
# recasting alts into a more convenient form for later calculation
1590+
p_alts = [p_alts[0]] * len(p_longs)
1591+
date = datetime.datetime(2000, 1, 1)
1592+
1593+
if self.dc is not None:
1594+
targets = itertools.cycle(dc.ids)
1595+
pending = []
1596+
for i, p_lat in enumerate(p_lats):
1597+
# iterate through target cyclicly and run commands
1598+
print(i, p_lat)
1599+
dview.targets = next(targets)
1600+
pending.append(
1601+
dview.apply_async(pymv.calculate_geomagnetic_basis,
1602+
[p_lat]*len(p_longs), p_longs,
1603+
p_alts, [date]*len(p_longs)))
1604+
1605+
for i, p_lat in enumerate(p_lats):
1606+
print ('collecting ', i, p_lat)
1607+
# collect output from first run
1608+
out_d = pending.pop(0).get()
1609+
else:
1610+
for i, p_lat in enumerate(p_lats):
1611+
print (i, p_lat)
1612+
out_d = pymv.calculate_geomagnetic_basis([p_lat]*len(p_longs), p_longs,
1613+
p_alts, [date]*len(p_longs))
1614+
15831615
def test_unit_vector_component_stepsize_sensitivity_plots(self):
15841616
"""Produce spatial plots of unit vector output sensitivity at the default step_size"""
15851617
import matplotlib.pyplot as plt
@@ -2080,6 +2112,7 @@ def test_step_sensitivity(self):
20802112
f = functools.partial(self.step_along_mag_unit_vector_sensitivity_plots, direction='meridional')
20812113
yield (f,)
20822114

2115+
20832116
def test_geomag_efield_scalars_plots(self):
20842117
"""Produce summary plots of the electric field and drift mapping values """
20852118
import matplotlib.pyplot as plt

0 commit comments

Comments
 (0)