Skip to content

Commit

Permalink
test negative precision
Browse files Browse the repository at this point in the history
  • Loading branch information
arahlin committed Apr 1, 2024
1 parent 8f9701a commit c1a5105
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions calibration/tests/band_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from spt3g.calibration import BolometerProperties, set_band_format, band_to_value, get_band_units

bp = BolometerProperties()
bp.band = 95.47 * core.G3Units.GHz
bp.band = 94.67 * core.G3Units.GHz

assert bp.band_string == "95GHz"
assert bp.band_vstring == "95"
Expand All @@ -11,14 +11,20 @@

set_band_format(0, "MHz")

assert bp.band_string == "95470MHz"
assert bp.band_vstring == "95470"
assert bp.band_string == "94670MHz"
assert bp.band_vstring == "94670"
assert band_to_value(bp.band_string) == bp.band
assert bp.band_vstring + get_band_units() == bp.band_string

set_band_format(2, "GHz")

assert bp.band_string == "95.47GHz"
assert bp.band_vstring == "95.47"
assert bp.band_string == "94.67GHz"
assert bp.band_vstring == "94.67"
assert band_to_value(bp.band_string) == bp.band
assert bp.band_vstring + get_band_units() == bp.band_string

set_band_format(-1, "GHz")
assert bp.band_string == "90GHz"
assert bp.band_vstring == "90"
assert band_to_value(bp.band_string) == 90 * core.G3Units.GHz
assert bp.band_vstring + get_band_units() == bp.band_string

0 comments on commit c1a5105

Please sign in to comment.