-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Interface for consistent bolometer band string formatting (#151)
This enables, e.g., handling spectrometer channels with closely spaced frequencies for mapmaking.
- Loading branch information
Showing
4 changed files
with
200 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from spt3g import core | ||
from spt3g.calibration import BolometerProperties, set_band_format, band_to_value, get_band_units | ||
|
||
bp = BolometerProperties() | ||
bp.band = 94.67 * core.G3Units.GHz | ||
|
||
assert bp.band_string == "95GHz" | ||
assert bp.band_vstring == "95" | ||
assert band_to_value(bp.band_string) == 95 * core.G3Units.GHz | ||
assert bp.band_vstring + get_band_units() == bp.band_string | ||
|
||
set_band_format(0, "MHz") | ||
|
||
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 == "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 |