MCPcopy Create free account
hub / github.com/NSLS2/PyXRF / _scale_selection

Function _scale_selection

pyxrf/gui_module/tests/test_useful_widgets.py:470–478  ·  view source on GitHub ↗

Scale the selection boundary. Reproduces computations performed by RangeManager when changing the range

(val, old_rng, new_rng)

Source from the content-addressed store, hash-verified

468 _verify_range(full_range)
469
470 def _scale_selection(val, old_rng, new_rng):
471 """
472 Scale the selection boundary. Reproduces computations performed by
473 RangeManager when changing the range
474 """
475 val -= old_rng[0]
476 val *= (new_rng[1] - new_rng[0]) / (old_rng[1] - old_rng[0])
477 val += new_rng[0]
478 return val
479
480 def _clip_selection(sel, rng, selection_to_range_min):
481 """

Callers 1

test_RangeManager_5Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected