Stimulator analysis pipeline#1659
Conversation
ykyohei
left a comment
There was a problem hiding this comment.
It's great to see the simulator pipeline in sotodlib!
Preliminary review comments. sotodlib follows PEP8, but whitespace is missing after commas in many places. I suggest running a linter and correcting them.
ykyohei
left a comment
There was a problem hiding this comment.
Thanks! it's getting much better!
I guess I found few bugs, please check.
| STM_NORMALIZE_TEMP = 750 # Kelvin. Normalization temperature for stimulator signal temperature. | ||
|
|
||
|
|
||
| def get_hk(hkdb_cfg, aman=None, t_start=None, t_end=None): |
There was a problem hiding this comment.
This doesn't necessarily need to be implemented in this PR, but for the site-pipeline of stimulator, we need to implement hk loading from level2 not hkdb.
For example,
| det_mask[idxs] = True | ||
|
|
||
| valid_data = True | ||
| if preprocessing: |
There was a problem hiding this comment.
preprocessing look common between gain and timeconstant.
I think it would be cleaner and simpler to make independent preprocessing function.
For example:
def preprocessing(aman, hkdata, idxs=None, n_bins=40, cal_type='all'):
valid_data = get_encoder_timing(aman, hkdata) # Get timing against encoder t0
aman.stm_cal.wrap('sampling_rate', 1 / np.median(np.diff(aman.timestamps)), overwrite=True)
get_chopping_status(aman)
get_timing_cut(aman)
get_signal_temp(aman,hkdata)
chopping_freqs = <both gain and timeconstant>
get_coadd_data(aman, "all", n_bins, det_mask)
# fit_coadd with sine function is also common
do sine fitting.
I wrote stimulator analysis code. Main functions are
calc_gain()andcalc_timeconstant().calc_gain()calculates stimulator's signal amplitude.calc_timeconstant()calculates optical time constant and readout delay.