-
Notifications
You must be signed in to change notification settings - Fork 24
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
Fibers with possible TPCORR issues #2305
Comments
Some investigation of these fibers... 1098 looks to have fine TPCORR fits, though the B band has especially noisy measurements. I don't think there's an easy fix to TPCORR here. 3994 does look to just have a problematic mean in the r band, as well as to just be wrong. 4720 is off by ~3% in the mean in the r band; I don't really know why. It also shows a significant change in behavior around EXPID ~ 100000. 4891 is a mess and I don't think changes to TPCORR will help. For anyone interested in digging in further, take a look at: I think it would be technically straightforward to refit these. I would hazard, but have not checked, that the change in behavior around EXPID ~ 100000 is from the time when we started homing the fibers at the end of the night, so that they have a consistent (x, y) position when used to measure the flat---that's at least a special time that I remember, though I'm surprised that the noise doesn't change around then. I think it's not technically too demanding to do a new set of fits if we wanted that. |
I put a new set of tpcorr files using all data in jura at: https://github.com/desihub/desispec/blob/main/py/desispec/tpcorrparam.py#L225-L227 I have not stared at these meaningfully. The one test I have done is to compare the means for r7: |
I need to leave this thread, but some interesting plots. Here's the TPCORR residuals in the z band. Note that these are model and residuals after the model has been subtracted, so we are happy that the scale of the model is larger than the residuals---the model is removing a lot of real signal. The residuals have some interesting structure... There is continued structure more recently, which likely justifies doing a new set of PCAs like I provided above, though I have no idea what's actually varying here! |
I spent a little longer here. If one wants to give the model enough flexibility to handle the problematic dome placement nights, that means going out to 6 PCA components (we currently use 2). It's not obvious we care, but it looks like this leads to ~1% sky errors. That's probably more than we want to change for kibo. |
I am comparing the TPCORR values in different bands, looking at the jura files in The first plot is the correlation between Z and R. The second between B and R.
|
FWIW, param[1] and param[2] are just the coefficients on the terms proportional to x & y in the modeling within the patrol disk. I think naively I would have guessed that they are either all scaled versions of one another, but different dependences of the different parameters seems extra complicated to me. |
I looks like a charge trap in the active region of the CCD affecting the parallel transfer. We had found a bunch of those for Y1 with Rongpu. We were able to find the first pixel affected by looking at the preprocessed dome flat images. I will see if we can do the same here. |
I put 2 and 6 component versions of the tpcorr files with the associated DESI_SPECTRO_CALIB files here: |
@schlafly @julienguy I will have time tomorrow (Wed 14.08.24) to work on this. Please let me know which scripts and procedures I should run to diagnose the new results for the 2cmp vs 6comp products. Thanks! |
I spent a little bit today looking at this; there is some cleanup we can still do. Here is the kind of plot I made: https://data.desi.lbl.gov/desi/users/schlafly/tpcorr-new-vs-old.pdf The correlations in the means (first set of plots) are quite tight and every discrepancy means something. A few of them are in the ticket above, and others are also important. Initial versions of these plots showed discrepancies in the problematic region of z5 (near old hot column) and r4 (in old bad CTE) that I've tried to repair in newer versions of these files. I've also reset fiber 1098 to have no TPCORR fits in the B band because the sky line lands near some band parallel CTE.
|
And FYI, the code to generate the tpcorr files is here:
|
These all look good to me. I did create a new directory as part of doing this that tries to handle things like r4 and z5 (which once had lots of bad fibers) in a better way. That is I did not spot check all of the outliers in the spatial plots. There is an outstanding ~failure mode there where a fiber becomes stuck during year 2 and so there is a good number of measurements throughout the fiber patrol disk and then thousands of measurements at one specific point. Some fibers also have slow drifts in TPCORR that are intended to be soaked up by the PCA fit (and which I do not physically understand). The spatial modeling proceeds the PCA modeling, and so the spatial modeling can end up seeing that the particular region where the fiber got stuck has a significantly different TPCORR than the rest of the patrol disk. This can lead to some weird torquing of the fit to accommodate the weird, heavily weighted position. Likely we should exclude places where the fiber was stuck from the fits, or figure out a scheme to deweight them (no particular region of the patrol disk gets more weight than X). The code doesn't do that at present. The cases I have looked at have led to slightly weird spatial models but not crazy ones---i.e., these fibers won't have great TPCORR but also won't have horrible ones. |
I've been comparing TPCORR values between tpcorr6 and tpcorr2, looking at 10 out of 220 exposures so far. I made a graph to show the differences for cameras B, R, and Z, focusing on big differences that were more than 5 sigma around the mean. Here's a summary of what I found: Outlier Summary
In total, I found 127 unique fibers with big differences across all cameras. What really stands out to me are these things:
Should we expect such big differences in Camera Z, especially for those fibers between 2670 and 2685? And what's so special about Fiber 2278 that it shows up in all cameras? My next steps are to look at the other 190 exposures and see if I find the same patterns. I also want to check if these differences change the redshift results. |
@forero please provide a snippet of code defining "TPCORR Difference". e.g. are you evaluating the TPCORR when the fiber is at the center of its patrol region? @forero please also do a similar study comparing the current 2-parameter model in /global/cfs/cdirs/desi/spectro/desi_spectro_calib/trunk/ to the updated model in /global/cfs/cdirs/desi/users/schlafly/tpcorr-desi-spectro-calib/2comp/ . In that case, we expect very tight agreement for nearly all fibers, except for ones that have a known TPCORR-related problem, e.g. 1098, 3994, 4720, 4891. |
I suspect these are fibers in the old region on the old z5 that had variable contamination from the hot column. I did try to zero out the contribution of this area to TPCORR in /global/homes/s/schlafly/desiproject/users/schlafly/tpcorr-jura-desi-spectro-calib-2comp-new/ . I don't actually know if these fibers are masked in practice. |
@sbailey Here's how I gather the data for each specprod: # Set environment variable
os.environ['SPECPROD'] = specprod
# Define the exposures table
exp_file = os.path.join(os.environ.get('DESI_SPECTRO_REDUX'), specprod, f'exposures-{specprod}.csv')
# Read exposures
exps = Table.read(exp_file)
# Gather the data
tpcorrdata = desispec.tpcorrparam.gather_tpcorr(exps) And then for every exposure in the two tpcorrdata : for i_rec in range(n_records):
data_A = tpcorrdata_specprod_A[i_rec]
data_B = tpcorrdata_specprod_B[i_rec]
diff = data_B['TPCORR'] - data_A['TPCORR'] I don't know whether that TPCORR read by desispec is computed at the center of its patrol region (but i guess it's computed at the actual fiberassignment location?) |
I compared 'MEAN' values in the tpcorrparam--.fits files between two models:
I found extreme differences (>5 sigma) in the 'MEAN' values for 49 fibers. Here's the list of fiber IDs showing these extreme differences: [817, 1063, 1098, 1935, 2171, 2236, 2250, 2251, 2252, 2253, 2254, 2257, 2259, 2260, 2261, 2262, 2263, 2265, 2267, 2271, 2478, 2628, 2668, 2671, 2672, 2674, 2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 2683, 2684, 3065, 3518, 3546, 3754, 3799, 3974, 3987, 3994, 4334, 4428, 4494, 4720, 4891] This list includes the fibers you mentioned: 1098, 3994, 4720, and 4891. But there are also two clusters of consecutive fibers showing extreme differences: one from 2250-2271 and another from 2671-2684 (the one I saw in the reduced data). |
Those clumps are the region on r4 (used to have bad CTE) and z5 (used to have a bad hot column). I think these are fine, but we should use the newer version of these files where I treat those regions a little differently. |
I have created a directory /global/cfs/cdirs/desi/spectro/desi_spectro_calib/kibotest which is desi_spectro_calib/trunk updated with @schlafly's latest 2-parameter files from /global/cfs/cdirs/desi/users/schlafly/tpcorr-jura-desi-spectro-calib-2comp-new/spec. @forero thanks for the plots, but unfortunately I had missed in the history that Eddie had a newer 2-parameter model to propose and I pointed you at the older one. From talking with Eddie about his checks and yours, I think everything is ok, but if it is easy for you to remake the plots with /global/cfs/cdirs/desi/spectro/desi_spectro_calib/kibotest that would be a nice final check. Feature creep: it would also be nice to fix the y-range of all figures to be the same to make it easier to see what are big outliers vs. just a zoomed in/out plot. Maybe +/- 0.02 with outliers clipped to the same range so that they appear on the plot at the edges even if they are large. Thanks. The plan is to use desi_spectro_calib/kibotest for the k1 test run, and if that looks good commit it to trunk to use with daily and make a tag for kibo. |
@schlafly could you re-summarize which fibers have TPCORR problems in Jura which are expected to be fixed by this PCA update in Kibo, vs. ones that are known to still have problems and should be flagged as FIBERSTATUS VARIABLETHRU? Fibers on my radar from the tracking spreadsheet (don't post link here!): 466, 1098, 3994, 4720, 4891. |
I expect this update to primarily improve the following cases:
Will not help:
Fibers with high variance in tpcorr:
The only other fiber that has std(TPCORR) > 0.02 in all bands and >0.03 in at least one band is 817. If you demand >= 0.02 in two bands, you get additionally 2171, 2277, and 2682. I would not be surprised if this turns out to be a broken fiber list but I haven't checked. Bonus: what fiber 466 TPCORR look like raw and after removing the TPCORR spatial model. |
Masked column with charge trap in pixmask-sm5-b-20201014.fits.gz and pixmask-sm5-b2-20210901.fits.gz. |
Summary:
Closing for Kibo. |
Issue #2283 identified fibers 1098, 3994, 4720, 4891 with problematic redshifts, possibly due to bad/unstable TPCORR issues (thanks to @rongpu and @julienguy for debugging those).
1098, 3994, 4720 ha ve a mismatched TPCORR between the cameras; that might be real or might be evidence of outliers pulling a bad fit. Investigate.
1098:
3994:
4720:
4891 was a known case with unstable TPCORR vs. time; from @schlafly :
Related: Issue #2304 is about how to mask these; this issue is about how to fix/improve the underlying problem if possible.
I'm assigning this to Kibo, but the schedule-driven fallback option would be to mask them even if we can't improve them.
The text was updated successfully, but these errors were encountered: