Closed dpdutcher closed 1 month ago
I finally got around to addressing this issue. The plot below illustrates the problem, where the p_sat calculation is thrown-off by an instability in the low-R_tes portion of the IV curve. Note that target bias voltages are not affected by this.
Also, the full P_sat distribution looks like the below. Note all the values between 0 pW and 16 pW
I then made the committed changes to the code, switching the logic from the first time R is above the target r_frac to the last time R is below the target r_frac. This fixed the psat determination in the selected detector, and it also fixed the total psat histogram to get rid of those spurious low values.
Tested on a full UHF UFM in a Princeton test cryosat.
As I understand it, IV data is flipped during analysis, so that the first element in an array will be the last datapoint that was taken, and vice-versa (see this comment) https://github.com/simonsobs/sodetlib/blob/c7bc19793ccfd168435885930d819fb58a506e8e/sodetlib/operations/iv.py#L326 In one sense that makes looking at the data confusing, because it does not match the actual time order, but in another sense more intuitive, because the left-to-right direction on most IV plots matches the start-to-finish order of the data arrays, so, fine. Where it does run into a problem is computing Psat values. Currently, the code looks for the first time R/R_n is above psat_level: https://github.com/simonsobs/sodetlib/blob/c7bc19793ccfd168435885930d819fb58a506e8e/sodetlib/operations/iv.py#L218-L228
But because IV curves can be ill-behaved in the low voltage, superconducting portion of the IV curve, which in this analysis scheme comes first, the code should instead look for _the last time R/R_n is below psatlevel. So something like
I have yet to make and run with this change to make sure this fixes the problem, but thought I'd raise this issue.