Skip to content

Commit

Permalink
Tweak units in workup procedures (#80)
Browse files Browse the repository at this point in the history
* Tweak units in workup procedures

* Move unit handling to the test
  • Loading branch information
ksunden authored and untzag committed Dec 27, 2019
1 parent c37b46c commit 2aac816
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions attune/workup/_holistic.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def holistic(
spectral_axis = data.axis_names[spectral_axis]
elif isinstance(spectral_axis, wt.data.Axis):
spectral_axis = spectral_axis.expression
getattr(data, spectral_axis).convert(curve.setpoints.units)
# take channel moments
data.moment(
axis=spectral_axis,
Expand Down
2 changes: 1 addition & 1 deletion attune/workup/_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def plot_holistic(
ax_amp.contour(
data,
channel=center_channel,
levels=center_ticks,
levels=sorted(center_ticks),
cmap=center_cmap,
linewidths=2,
alpha=1,
Expand Down
4 changes: 2 additions & 2 deletions attune/workup/_setpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ def setpoint(
New curve object.
"""
data = data.copy()
data.convert("wn")
# data.convert("wn")
if curve is not None:
old_curve = curve.copy()
old_curve.convert("wn")
# old_curve.convert("wn")
setpoints = old_curve.setpoints
else:
old_curve = None
Expand Down
3 changes: 3 additions & 0 deletions tests/workup/setpoint/2018-11-30/aixcb.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ def test():

old = attune.TopasCurve.read([__here__ / "old.crv"], interaction_string="NON-NON-NON-Sig")

data.convert("wn")
old.convert("wn")

new = attune.workup.setpoint(data, -1, "2", autosave=False, curve=old)

print(new)
Expand Down

0 comments on commit 2aac816

Please sign in to comment.