-
Notifications
You must be signed in to change notification settings - Fork 21
Add loader and det cal functionality to load in bandpass info using bg #1206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c88ae73
Add loader and det cal functionality to load in bandpass info using bg
510998e
Make update_det_cal changes more concise
9169b31
small update_det_cal syntax fixes
789535f
Add tests for ModifyFieldsResultSetHdfLoader
334c468
Merge branch 'master' into preprocess-lite-det-cal
tdalford a051ed8
Put load_fields functionality into base ResultSetHdf class, update co…
cfe528c
bandpass_key syntax update
12ab8de
Small fix to specify dtype of bandpass field since str doesn't fit well
3d8dc83
Merge branch 'master' into preprocess-lite-det-cal
tdalford 6f1492b
make update_det_cal work for LAT filepaths, small fix to multiprocess…
6e4b62b
clarifying comment
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -33,6 +33,12 @@ | |
| DEFAULT_pA_per_phi0 = 9e6 | ||
| TES_BIAS_COUNT = 12 # per detset / primary file group | ||
|
|
||
| # For converting bias group to bandpass. | ||
| BGS = {'lb': [0, 1, 4, 5, 8, 9], 'hb': [2, 3, 6, 7, 10, 11]} | ||
| BAND_STR = {'mf': {'lb': 'f090', 'hb': 'f150'}, | ||
| 'uhf': {'lb': 'f220', 'hb': 'f280'}, | ||
| 'lf': {'lb': 'f030', 'hb': 'f040'}} | ||
|
|
||
| logger = logging.getLogger("det_cal") | ||
| if not logger.hasHandlers(): | ||
| sp_util.init_logger("det_cal") | ||
|
|
@@ -248,6 +254,8 @@ class CalInfo: | |
| Current responsivity of the TES [1/V] computed using bias steps at the | ||
| bias point. This is based on the naive bias step estimation without | ||
| using any additional corrections. | ||
| bandpass: str | ||
| Detector bandpass, computed from bias group information. | ||
| """ | ||
|
|
||
| readout_id: str = "" | ||
|
|
@@ -269,6 +277,7 @@ class CalInfo: | |
| naive_r_frac: float = np.nan | ||
| naive_p_bias: float = np.nan | ||
| naive_s_i: float = np.nan | ||
| bandpass: str = "NC" | ||
|
|
||
| @classmethod | ||
| def dtype(cls) -> List[Tuple[str, Any]]: | ||
|
|
@@ -617,6 +626,12 @@ def find_correction_results(band, chan, dset): | |
| else: | ||
| cal.phase_to_pW = pA_per_phi0 / (2 * np.pi) / cal.s_i * cal.polarity | ||
|
|
||
| # Add bandpass informaton from bias group | ||
| if cal.bg in bgs['lb']: | ||
| cal.bandpass = band_str[tube_flavor]['lb'] | ||
| elif cal.bg in bgs['hb']: | ||
| cal.bandpass = band_str[tube_flavor]['hb'] | ||
|
||
|
|
||
| res.result_set = np.array([astuple(c) for c in cals], dtype=CalInfo.dtype()) | ||
| res.success = True | ||
| except Exception as e: | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to call this "bandpass_key"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you saying to use 'self.bandpass_key' as the class variable name or to use 'bandpass_key' as the config parameter name? Or both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to guess you mean the config parameter name, that is much more visible