Skip to content
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

tiles-daily.csv contains null values for PROGRAM #2251

Open
weaverba137 opened this issue May 14, 2024 · 18 comments
Open

tiles-daily.csv contains null values for PROGRAM #2251

weaverba137 opened this issue May 14, 2024 · 18 comments
Assignees
Labels

Comments

@weaverba137
Copy link
Member

The first ~25% of rows in tiles-daily.csv have a null value for the PROGRAM column. In contrast specprods such as iron have no such null values.

The difference is that tiles-daily.csv is updated incrementally, while tiles-iron.csv would have been generated from scratch.

The most likely explanation is that sometime in the past desi_tsnr_afterburner had an issue with identifying the correct value for PROGRAM and left it blank. After the problem was fixed, the file was not regenerated, but instead newer tiles with valid PROGRAM were simply appended to the file.

@weaverba137
Copy link
Member Author

See also #1724, #2250.

@weaverba137
Copy link
Member Author

@sbailey I seem to recall discussing regeneration of the tiles file after Jura was completed. Is it still possible to do that?

@weaverba137
Copy link
Member Author

@sbailey, @akremin, Please look in $DESI_ROOT/users/bweaver for patched versions of the tiles-daily.csv and exposures-daily.(fits|csv) files, with the name (tiles|exposures)-daily-patched-with-jura.(fits|csv).

The files were produced with this notebook.

One key point here: for any tile, frame or exposure exists in both daily and jura, every column in daily is replaced with the corresponding column in jura. This is not mandatory: a subset of columns or rows could be selected, but I would need guidance on which rows or columns to replace and which to leave alone.

@akremin
Copy link
Member

akremin commented Jul 30, 2024

Thank you, Ben. This looks very nice.

On that key point you made: I think we need to avoid overwriting entries that are specific to the version of the pipeline used to process the data. Examples are the TSNR2* values, among others. Other columns I am nervous about touching are survey-operations related columns such as OBSSTATUS and LASTNIGHT.

I think the final choice of columns will require Stephen-level sign off, but to make progress while he's away I would recommend the following as a complete list of columns that CAN be altered:

tiles file columns to sync:
TILEID, SURVEY, PROGRAM, FAPRGRM, FAFLAVOR, TILERA, TILEDEC, EFFTIME_ETC, EFFTIME_GFA, GOALTIME, GOALTYPE, MINTFRAC

exposures file columns to sync:
NIGHT, EXPID, TILEID, TILERA, TILEDEC, MJD, SURVEY, PROGRAM, FAPRGRM, FAFLAVOR, EXPTIME, GOALTIME, GOALTYPE, MINTFRAC, AIRMASS, EBV, SEEING_ETC, EFFTIME_ETC, TRANSPARENCY_GFA, SEEING_GFA, FIBER_FRACFLUX_GFA, FIBER_FRACFLUX_ELG_GFA, FIBER_FRACFLUX_BGS_GFA, FIBERFAC_GFA, FIBERFAC_ELG_GFA, FIBERFAC_BGS_GFA, AIRMASS_GFA, SKY_MAG_AB_GFA, EFFTIME_GFA, EFFTIME_DARK_GFA, EFFTIME_BRIGHT_GFA, EFFTIME_BACKUP_GFA

All of these columns are "facts" (ideally metadata) about the observations or derived from ETC or GFA measurements. Note for tiles I've even removed NEXPS and EXPTIME because those depend on the specific data included in the specprod (we may have flagged expoures in Jura that weren't flagged in daily, and we want to correctly reflect the number of exposures and exposure time in daily).

@weaverba137
Copy link
Member Author

@akremin, thank you, I'll run some tests on those columns. I also need to test whether there are missing data in the FRAMES table. If there isn't, I may avoid replacing the FRAMES table at all.

@weaverba137
Copy link
Member Author

In addition, @sbailey and I had some discussion on Slack last week. Here are the key points:

  • Do not load tiles "earlier" than the earliest tile in Jura. A likely equivalent (still to be tested) filter would be to keep only exposures with NIGHT>=20201214 and tiles with LASTNIGHT>=20201214 (the first NIGHT in Jura).
  • Do not load, and also do not patch, entries with EFFTIME_SPEC == 0.

@weaverba137
Copy link
Member Author

It turns out that even after patching and applying the night cuts above, there are a few tiles that still have missing values, and I'm trying to figure out what to do with these.

There are also cases where the tile was successfully patched but some values in the exposures table were not patched, presumably because some exposures are in daily but not jura, for the same tile.

The answer may come down to how much work would it be to further try to patch these cases, versus just recreating tiles-daily.csv and exposures-daily.csv completely from scratch.

@akremin do you have any insight? I only got a summary of your discussion with @sbailey, but I believe we're close to a point where further patching and recreating from scratch would require equivalent work, and recreating from scratch would get us into a good place for the long term.

@weaverba137 weaverba137 self-assigned this Aug 1, 2024
@weaverba137
Copy link
Member Author

@sbailey, as discussed today, here are the tiles that remain unpatched even after patching with Jura:
Screenshot 2024-08-12 at 15 35 28

A few of them have small but still non-zero values of EFFTIME_SPEC. Also several others have EFFTIME_ETC == 0.0. However, I don't see anything really obvious to cut on.

@weaverba137
Copy link
Member Author

While investigating the exposures that have MJD == 0, I've come across another issue: there are some daily tiles for which there are no exposures with EFFTIME_SPEC > 0. Here are a few examples, not comprehensive:

ERROR: No valid exposures found for tile 81088, even though EFFTIME_SPEC == 24.800000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
83416 20210404 0.0          0.0

ERROR: No valid exposures found for tile 50, even though EFFTIME_SPEC == 73.800000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
83525 20210405 0.0          0.0

ERROR: No valid exposures found for tile 23, even though EFFTIME_SPEC == 66.700000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
83524 20210405 0.0          0.0

ERROR: No valid exposures found for tile 158, even though EFFTIME_SPEC == 60.500000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
83543 20210405 0.0          0.0

And note that these also have MJD == 0.0 even though that's not actually what is being checked for in this particular case.

@weaverba137
Copy link
Member Author

Here is the comprehensive list of tiles that have problematic exposures, including both tiles that have some exposures with MJD == 0 and tiles that have no valid exposures according to (only) the EFFTIME_SPEC > 0 requirement.

WARNING: Invalid MJD values detected for tile 80620!
WARNING: tile 80620 exposure 69444 has MJD-OBS = 59206.409566 in /global/cfs/cdirs/desi/spectro/data/20201222/00069444/desi-00069444.fits.fz!
WARNING: tile 80620 exposure 69445 has MJD-OBS = 59206.422851 in /global/cfs/cdirs/desi/spectro/data/20201222/00069445/desi-00069445.fits.fz!
WARNING: tile 80620 exposure 69446 has MJD-OBS = 59206.436229 in /global/cfs/cdirs/desi/spectro/data/20201222/00069446/desi-00069446.fits.fz!
WARNING: tile 80620 exposure 69447 has MJD-OBS = 59206.449480 in /global/cfs/cdirs/desi/spectro/data/20201222/00069447/desi-00069447.fits.fz!
WARNING: Invalid MJD values detected for tile 80607!
WARNING: tile 80607 exposure 69440 has MJD-OBS = 59206.367353 in /global/cfs/cdirs/desi/spectro/data/20201222/00069440/desi-00069440.fits.fz!
WARNING: tile 80607 exposure 69441 has MJD-OBS = 59206.380662 in /global/cfs/cdirs/desi/spectro/data/20201222/00069441/desi-00069441.fits.fz!
WARNING: tile 80607 exposure 69442 has MJD-OBS = 59206.393943 in /global/cfs/cdirs/desi/spectro/data/20201222/00069442/desi-00069442.fits.fz!
WARNING: Invalid MJD values detected for tile 80622!
WARNING: tile 80622 exposure 69631 has MJD-OBS = 59207.407850 in /global/cfs/cdirs/desi/spectro/data/20201223/00069631/desi-00069631.fits.fz!
WARNING: tile 80622 exposure 69632 has MJD-OBS = 59207.421005 in /global/cfs/cdirs/desi/spectro/data/20201223/00069632/desi-00069632.fits.fz!
WARNING: Invalid MJD values detected for tile 80617!
WARNING: tile 80617 exposure 69400 has MJD-OBS = 59206.108281 in /global/cfs/cdirs/desi/spectro/data/20201222/00069400/desi-00069400.fits.fz!
WARNING: tile 80617 exposure 69401 has MJD-OBS = 59206.116788 in /global/cfs/cdirs/desi/spectro/data/20201222/00069401/desi-00069401.fits.fz!
WARNING: tile 80617 exposure 69402 has MJD-OBS = 59206.125315 in /global/cfs/cdirs/desi/spectro/data/20201222/00069402/desi-00069402.fits.fz!
WARNING: tile 80617 exposure 69403 has MJD-OBS = 59206.135059 in /global/cfs/cdirs/desi/spectro/data/20201222/00069403/desi-00069403.fits.fz!
WARNING: tile 80617 exposure 69404 has MJD-OBS = 59206.145698 in /global/cfs/cdirs/desi/spectro/data/20201222/00069404/desi-00069404.fits.fz!
WARNING: Invalid MJD values detected for tile 80608!
WARNING: tile 80608 exposure 69435 has MJD-OBS = 59206.313242 in /global/cfs/cdirs/desi/spectro/data/20201222/00069435/desi-00069435.fits.fz!
WARNING: tile 80608 exposure 69436 has MJD-OBS = 59206.326569 in /global/cfs/cdirs/desi/spectro/data/20201222/00069436/desi-00069436.fits.fz!
WARNING: tile 80608 exposure 69437 has MJD-OBS = 59206.339900 in /global/cfs/cdirs/desi/spectro/data/20201222/00069437/desi-00069437.fits.fz!
WARNING: tile 80608 exposure 69438 has MJD-OBS = 59206.353205 in /global/cfs/cdirs/desi/spectro/data/20201222/00069438/desi-00069438.fits.fz!
WARNING: Invalid MJD values detected for tile 80623!
WARNING: tile 80623 exposure 69628 has MJD-OBS = 59207.380045 in /global/cfs/cdirs/desi/spectro/data/20201223/00069628/desi-00069628.fits.fz!
WARNING: tile 80623 exposure 69629 has MJD-OBS = 59207.393223 in /global/cfs/cdirs/desi/spectro/data/20201223/00069629/desi-00069629.fits.fz!
WARNING: Invalid MJD values detected for tile 80635!
WARNING: tile 80635 exposure 70543 has MJD-OBS = 59217.249417 in /global/cfs/cdirs/desi/spectro/data/20210102/00070543/desi-00070543.fits.fz!
WARNING: tile 80635 exposure 70544 has MJD-OBS = 59217.255461 in /global/cfs/cdirs/desi/spectro/data/20210102/00070544/desi-00070544.fits.fz!
WARNING: tile 80635 exposure 70545 has MJD-OBS = 59217.261845 in /global/cfs/cdirs/desi/spectro/data/20210102/00070545/desi-00070545.fits.fz!
WARNING: Invalid MJD values detected for tile 80670!
WARNING: tile 80670 exposure 71724 has MJD-OBS = 59225.134263 in /global/cfs/cdirs/desi/spectro/data/20210110/00071724/desi-00071724.fits.fz!
WARNING: tile 80670 exposure 71870 has MJD-OBS = 59226.161130 in /global/cfs/cdirs/desi/spectro/data/20210111/00071870/desi-00071870.fits.fz!
WARNING: Invalid MJD values detected for tile 80610!
WARNING: tile 80610 exposure 69455 has MJD-OBS = 59206.501778 in /global/cfs/cdirs/desi/spectro/data/20201222/00069455/desi-00069455.fits.fz!
WARNING: tile 80610 exposure 69456 has MJD-OBS = 59206.515169 in /global/cfs/cdirs/desi/spectro/data/20201222/00069456/desi-00069456.fits.fz!
WARNING: Invalid MJD values detected for tile 80708!
WARNING: tile 80708 exposure 75868 has MJD-OBS = 59260.515382 in /global/cfs/cdirs/desi/spectro/data/20210214/00075868/desi-00075868.fits.fz!
WARNING: tile 80708 exposure 75869 has MJD-OBS = 59260.524510 in /global/cfs/cdirs/desi/spectro/data/20210214/00075869/desi-00075869.fits.fz!
WARNING: tile 80708 exposure 75870 has MJD-OBS = 59260.533663 in /global/cfs/cdirs/desi/spectro/data/20210214/00075870/desi-00075870.fits.fz!
WARNING: Invalid MJD values detected for tile 80639!
WARNING: tile 80639 exposure 79046 has MJD-OBS = 59274.186137 in /global/cfs/cdirs/desi/spectro/data/20210228/00079046/desi-00079046.fits.fz!
WARNING: Invalid MJD values detected for tile 80687!
WARNING: tile 80687 exposure 75823 has MJD-OBS = 59260.123180 in /global/cfs/cdirs/desi/spectro/data/20210214/00075823/desi-00075823.fits.fz!
WARNING: tile 80687 exposure 75824 has MJD-OBS = 59260.132294 in /global/cfs/cdirs/desi/spectro/data/20210214/00075824/desi-00075824.fits.fz!
WARNING: tile 80687 exposure 75825 has MJD-OBS = 59260.141440 in /global/cfs/cdirs/desi/spectro/data/20210214/00075825/desi-00075825.fits.fz!
WARNING: tile 80687 exposure 75826 has MJD-OBS = 59260.150494 in /global/cfs/cdirs/desi/spectro/data/20210214/00075826/desi-00075826.fits.fz!
WARNING: tile 80687 exposure 75827 has MJD-OBS = 59260.159721 in /global/cfs/cdirs/desi/spectro/data/20210214/00075827/desi-00075827.fits.fz!
WARNING: tile 80687 exposure 75828 has MJD-OBS = 59260.168634 in /global/cfs/cdirs/desi/spectro/data/20210214/00075828/desi-00075828.fits.fz!
WARNING: tile 80687 exposure 75829 has MJD-OBS = 59260.177738 in /global/cfs/cdirs/desi/spectro/data/20210214/00075829/desi-00075829.fits.fz!
WARNING: tile 80687 exposure 75830 has MJD-OBS = 59260.186794 in /global/cfs/cdirs/desi/spectro/data/20210214/00075830/desi-00075830.fits.fz!
WARNING: tile 80687 exposure 75831 has MJD-OBS = 59260.196030 in /global/cfs/cdirs/desi/spectro/data/20210214/00075831/desi-00075831.fits.fz!
WARNING: tile 80687 exposure 75832 has MJD-OBS = 59260.204947 in /global/cfs/cdirs/desi/spectro/data/20210214/00075832/desi-00075832.fits.fz!
WARNING: tile 80687 exposure 75835 has MJD-OBS = 59260.218992 in /global/cfs/cdirs/desi/spectro/data/20210214/00075835/desi-00075835.fits.fz!
WARNING: tile 80687 exposure 75836 has MJD-OBS = 59260.228327 in /global/cfs/cdirs/desi/spectro/data/20210214/00075836/desi-00075836.fits.fz!
WARNING: Invalid MJD values detected for tile 80741!
WARNING: tile 80741 exposure 79066 has MJD-OBS = 59274.328710 in /global/cfs/cdirs/desi/spectro/data/20210228/00079066/desi-00079066.fits.fz!
WARNING: tile 80741 exposure 79067 has MJD-OBS = 59274.343822 in /global/cfs/cdirs/desi/spectro/data/20210228/00079067/desi-00079067.fits.fz!
WARNING: tile 80741 exposure 79068 has MJD-OBS = 59274.358837 in /global/cfs/cdirs/desi/spectro/data/20210228/00079068/desi-00079068.fits.fz!
WARNING: Invalid MJD values detected for tile 80721!
WARNING: tile 80721 exposure 79741 has MJD-OBS = 59282.176876 in /global/cfs/cdirs/desi/spectro/data/20210308/00079741/desi-00079741.fits.fz!
WARNING: tile 80721 exposure 79749 has MJD-OBS = 59282.207467 in /global/cfs/cdirs/desi/spectro/data/20210308/00079749/desi-00079749.fits.fz!
WARNING: Invalid MJD values detected for tile 80702!
WARNING: tile 80702 exposure 81201 has MJD-OBS = 59294.236517 in /global/cfs/cdirs/desi/spectro/data/20210320/00081201/desi-00081201.fits.fz!
WARNING: Invalid MJD values detected for tile 80662!
WARNING: tile 80662 exposure 77926 has MJD-OBS = 59270.253469 in /global/cfs/cdirs/desi/spectro/data/20210224/00077926/desi-00077926.fits.fz!
WARNING: tile 80662 exposure 77929 has MJD-OBS = 59270.272156 in /global/cfs/cdirs/desi/spectro/data/20210224/00077929/desi-00077929.fits.fz!
WARNING: Invalid MJD values detected for tile 80726!
WARNING: tile 80726 exposure 79072 has MJD-OBS = 59274.408621 in /global/cfs/cdirs/desi/spectro/data/20210228/00079072/desi-00079072.fits.fz!
WARNING: tile 80726 exposure 79073 has MJD-OBS = 59274.423888 in /global/cfs/cdirs/desi/spectro/data/20210228/00079073/desi-00079073.fits.fz!
WARNING: tile 80726 exposure 79074 has MJD-OBS = 59274.439179 in /global/cfs/cdirs/desi/spectro/data/20210228/00079074/desi-00079074.fits.fz!
WARNING: Invalid MJD values detected for tile 80740!
WARNING: tile 80740 exposure 79069 has MJD-OBS = 59274.374192 in /global/cfs/cdirs/desi/spectro/data/20210228/00079069/desi-00079069.fits.fz!
WARNING: tile 80740 exposure 79070 has MJD-OBS = 59274.390114 in /global/cfs/cdirs/desi/spectro/data/20210228/00079070/desi-00079070.fits.fz!
WARNING: Invalid MJD values detected for tile 80722!
WARNING: tile 80722 exposure 79058 has MJD-OBS = 59274.230862 in /global/cfs/cdirs/desi/spectro/data/20210228/00079058/desi-00079058.fits.fz!
WARNING: tile 80722 exposure 79060 has MJD-OBS = 59274.264118 in /global/cfs/cdirs/desi/spectro/data/20210228/00079060/desi-00079060.fits.fz!
WARNING: tile 80722 exposure 79061 has MJD-OBS = 59274.272239 in /global/cfs/cdirs/desi/spectro/data/20210228/00079061/desi-00079061.fits.fz!
WARNING: tile 80722 exposure 79062 has MJD-OBS = 59274.277943 in /global/cfs/cdirs/desi/spectro/data/20210228/00079062/desi-00079062.fits.fz!
WARNING: tile 80722 exposure 80474 has MJD-OBS = 59288.188474 in /global/cfs/cdirs/desi/spectro/data/20210314/00080474/desi-00080474.fits.fz!
WARNING: Invalid MJD values detected for tile 80742!
WARNING: tile 80742 exposure 81356 has MJD-OBS = 59295.108323 in /global/cfs/cdirs/desi/spectro/data/20210321/00081356/desi-00081356.fits.fz!
WARNING: Invalid MJD values detected for tile 80618!
WARNING: tile 80618 exposure 69082 has MJD-OBS = 59204.557878 in /global/cfs/cdirs/desi/spectro/data/20201220/00069082/desi-00069082.fits.fz!
WARNING: tile 80618 exposure 69083 has MJD-OBS = 59204.563137 in /global/cfs/cdirs/desi/spectro/data/20201220/00069083/desi-00069083.fits.fz!
WARNING: tile 80618 exposure 69084 has MJD-OBS = 59204.568494 in /global/cfs/cdirs/desi/spectro/data/20201220/00069084/desi-00069084.fits.fz!
WARNING: tile 80618 exposure 69085 has MJD-OBS = 59204.573527 in /global/cfs/cdirs/desi/spectro/data/20201220/00069085/desi-00069085.fits.fz!
WARNING: Invalid MJD values detected for tile 80614!
WARNING: tile 80614 exposure 69449 has MJD-OBS = 59206.468311 in /global/cfs/cdirs/desi/spectro/data/20201222/00069449/desi-00069449.fits.fz!
WARNING: tile 80614 exposure 69450 has MJD-OBS = 59206.474771 in /global/cfs/cdirs/desi/spectro/data/20201222/00069450/desi-00069450.fits.fz!
WARNING: tile 80614 exposure 69451 has MJD-OBS = 59206.481235 in /global/cfs/cdirs/desi/spectro/data/20201222/00069451/desi-00069451.fits.fz!
WARNING: tile 80614 exposure 69452 has MJD-OBS = 59206.487680 in /global/cfs/cdirs/desi/spectro/data/20201222/00069452/desi-00069452.fits.fz!
WARNING: tile 80614 exposure 69453 has MJD-OBS = 59206.494103 in /global/cfs/cdirs/desi/spectro/data/20201222/00069453/desi-00069453.fits.fz!
WARNING: tile 80614 exposure 69458 has MJD-OBS = 59206.533942 in /global/cfs/cdirs/desi/spectro/data/20201222/00069458/desi-00069458.fits.fz!
WARNING: tile 80614 exposure 69459 has MJD-OBS = 59206.540400 in /global/cfs/cdirs/desi/spectro/data/20201222/00069459/desi-00069459.fits.fz!
WARNING: tile 80614 exposure 69460 has MJD-OBS = 59206.546853 in /global/cfs/cdirs/desi/spectro/data/20201222/00069460/desi-00069460.fits.fz!
WARNING: Invalid MJD values detected for tile 80733!
WARNING: tile 80733 exposure 75873 has MJD-OBS = 59260.550852 in /global/cfs/cdirs/desi/spectro/data/20210214/00075873/desi-00075873.fits.fz!
WARNING: tile 80733 exposure 75874 has MJD-OBS = 59260.556760 in /global/cfs/cdirs/desi/spectro/data/20210214/00075874/desi-00075874.fits.fz!
ERROR: No valid exposures found for tile 81088, even though EFFTIME_SPEC == 24.800000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
83416 20210404 0.0          0.0
WARNING: Invalid MJD values detected for tile 80621!
WARNING: tile 80621 exposure 83414 has MJD-OBS = 59309.140932 in /global/cfs/cdirs/desi/spectro/data/20210404/00083414/desi-00083414.fits.fz!
WARNING: tile 80621 exposure 83415 has MJD-OBS = 59309.154354 in /global/cfs/cdirs/desi/spectro/data/20210404/00083415/desi-00083415.fits.fz!
ERROR: No valid exposures found for tile 50, even though EFFTIME_SPEC == 73.800000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
83525 20210405 0.0          0.0
ERROR: No valid exposures found for tile 23, even though EFFTIME_SPEC == 66.700000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
83524 20210405 0.0          0.0
ERROR: No valid exposures found for tile 158, even though EFFTIME_SPEC == 60.500000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
83543 20210405 0.0          0.0
ERROR: No valid exposures found for tile 131, even though EFFTIME_SPEC == 79.300000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
83732 20210406 0.0          0.0
ERROR: No valid exposures found for tile 104, even though EFFTIME_SPEC == 70.400000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
84352 20210411 0.0          0.0
ERROR: No valid exposures found for tile 51, even though EFFTIME_SPEC == 45.900000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
84345 20210411 0.0          0.0
84346 20210411 0.0          0.0
84347 20210411 0.0          0.0
ERROR: No valid exposures found for tile 320, even though EFFTIME_SPEC == 59.500000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
84421 20210411 0.0          0.0
ERROR: No valid exposures found for tile 428, even though EFFTIME_SPEC == 65.700000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
84420 20210411 0.0          0.0
ERROR: No valid exposures found for tile 77, even though EFFTIME_SPEC == 68.300000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
84348 20210411 0.0          0.0
84349 20210411 0.0          0.0
84350 20210411 0.0          0.0
ERROR: No valid exposures found for tile 185, even though EFFTIME_SPEC == 49.500000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
84356 20210411 0.0          0.0
ERROR: No valid exposures found for tile 212, even though EFFTIME_SPEC == 72.900000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
84645 20210413 0.0          0.0
ERROR: No valid exposures found for tile 132, even though EFFTIME_SPEC == 56.700000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
84815 20210414 0.0          0.0
ERROR: No valid exposures found for tile 186, even though EFFTIME_SPEC == 43.400000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
84813 20210414 0.0          0.0
ERROR: No valid exposures found for tile 78, even though EFFTIME_SPEC == 94.800000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
84807 20210414 0.0          0.0
ERROR: No valid exposures found for tile 105, even though EFFTIME_SPEC == 52.300000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
84808 20210414 0.0          0.0
84809 20210414 0.0          0.0
84810 20210414 0.0          0.0
84811 20210414 0.0          0.0
84812 20210414 0.0          0.0
ERROR: No valid exposures found for tile 213, even though EFFTIME_SPEC == 63.400000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
84814 20210414 0.0          0.0
ERROR: No valid exposures found for tile 133, even though EFFTIME_SPEC == 58.500000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
84936 20210415 0.0          0.0
ERROR: No valid exposures found for tile 24, even though EFFTIME_SPEC == 93.100000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
84929 20210415 0.0          0.0
84930 20210415 0.0          0.0
ERROR: No valid exposures found for tile 52, even though EFFTIME_SPEC == 67.200000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
84932 20210415 0.0          0.0
ERROR: No valid exposures found for tile 187, even though EFFTIME_SPEC == 62.000000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
84939 20210415 0.0          0.0
84940 20210415 0.0          0.0
84941 20210415 0.0          0.0
84942 20210415 0.0          0.0
ERROR: No valid exposures found for tile 214, even though EFFTIME_SPEC == 76.100000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
84943 20210415 0.0          0.0
ERROR: No valid exposures found for tile 347, even though EFFTIME_SPEC == 30.000000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
84944 20210415 0.0          0.0
ERROR: No valid exposures found for tile 106, even though EFFTIME_SPEC == 54.900000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
84937 20210415 0.0          0.0
ERROR: No valid exposures found for tile 374, even though EFFTIME_SPEC == 65.400000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
84418 20210411 0.0          0.0
84419 20210411 0.0          0.0
85641 20210420 0.0          0.0
ERROR: No valid exposures found for tile 375, even though EFFTIME_SPEC == 87.500000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
86508 20210428 0.0          0.0
ERROR: No valid exposures found for tile 79, even though EFFTIME_SPEC == 73.200000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
85619 20210420 0.0          0.0
86494 20210428 0.0          0.0
ERROR: No valid exposures found for tile 215, even though EFFTIME_SPEC == 66.600000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
86505 20210428 0.0          0.0
ERROR: No valid exposures found for tile 401, even though EFFTIME_SPEC == 81.100000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
86507 20210428 0.0          0.0
ERROR: No valid exposures found for tile 107, even though EFFTIME_SPEC == 68.000000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
86495 20210428 0.0          0.0
ERROR: No valid exposures found for tile 321, even though EFFTIME_SPEC == 68.000000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
86509 20210428 0.0          0.0
WARNING: Invalid MJD values detected for tile 88!
WARNING: tile 88 exposure 85616 has MJD-OBS = 59325.179788 in /global/cfs/cdirs/desi/spectro/data/20210420/00085616/desi-00085616.fits.fz!
ERROR: No valid exposures found for tile 429, even though EFFTIME_SPEC == 67.100000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
84829 20210414 0.0          0.0
84830 20210414 0.0          0.0
86753 20210430 0.0          0.0
WARNING: Invalid MJD values detected for tile 80871!
WARNING: tile 80871 exposure 80481 has MJD-OBS = 59288.216706 in /global/cfs/cdirs/desi/spectro/data/20210314/00080481/desi-00080481.fits.fz!
WARNING: tile 80871 exposure 83976 has MJD-OBS = 59313.215656 in /global/cfs/cdirs/desi/spectro/data/20210408/00083976/desi-00083976.fits.fz!
ERROR: No valid exposures found for tile 53, even though EFFTIME_SPEC == 63.900000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
86836 20210501 0.0          0.0
ERROR: No valid exposures found for tile 506, even though EFFTIME_SPEC == 76.800000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
90224 20210529 0.0          0.0
ERROR: No valid exposures found for tile 402, even though EFFTIME_SPEC == 90.600000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
90244 20210529 0.0          0.0
ERROR: No valid exposures found for tile 596, even though EFFTIME_SPEC == 90.300000!
EXPID  NIGHT   MJD EFFTIME_SPEC
----- -------- --- ------------
90239 20210529 0.0          0.0

It seems like a long list, but it's not actually that long given that there are 14723 daily tiles capable of being loaded right now (14739 - 16 unpatched tiles listed above).

@weaverba137
Copy link
Member Author

Thinking about this more: the good news is that we can recover missing MJD values from MJD-OBS in what looks like all cases. But if the MJD-OBS value was always there, why is it missing?

However, the other problem of no valid exposures doesn't have an obvious workaround at this point.

@weaverba137
Copy link
Member Author

A new problem: for some exposures that are in both jura and daily, the values in jura are NaN. So masking the value in daily with jura only copies a null value. I noticed this first with FIBERFAC_GFA, but other columns are affected. What does this mean?

@araichoor
Copy link
Contributor

could you provide an example?
I wanted to check, but I cannot find any non-finite FIBERFAC_GFA values in exposures-jura.csv (I see 49 rows in exposures-daily.csv).
but maybe I m not looking at the correct files, I ve not followed all the discussion in this ticket

>>> d = Table.read("/global/cfs/cdirs/desi/spectro/redux/jura/exposures-jura.csv")
>>> (~np.isfinite(d["FIBERFAC_GFA"])).sum()
0

>>> d = Table.read("/global/cfs/cdirs/desi/spectro/redux/daily/exposures-daily.csv")
>>> (~np.isfinite(d["FIBERFAC_GFA"])).sum()
49

@weaverba137
Copy link
Member Author

exposures-jura.fits. exposures-jura.csv does not contain the FRAMES HDU, so it is never used for database loading. If there is an inconsistency between the files, then that is definitely worth investigating.

@weaverba137
Copy link
Member Author

 NIGHT   EXPID  TILEID  TILERA TILEDEC ...   SKY_MAG_Z_SPEC        EFFTIME_GFA          EFFTIME_DARK_GFA    EFFTIME_BRIGHT_GFA EFFTIME_BACKUP_GFA
 int32   int32  int32  float64 float64 ...      float64              float64                float64              float64            float64      
-------- ------ ------ ------- ------- ... ------------------ ---------------------- ---------------------- ------------------ ------------------
20210202  74307  80679   111.0    41.5 ... 19.993767541215583                     --                     --                 --                 --
20210308  79769  80731  192.86   27.13 ... 19.575426801000127                     --                     --                 --                 --
20210404  83420  80697   145.0  32.375 ...  19.65692757225773 1.0075802546981036e-05 1.0075802546981036e-05                 --                 --
20211125 110852  42262   5.991   4.792 ... 19.157658679585744                     --                     --                 --                 --
20230815 190752  40203 320.573  26.421 ... 19.386191940942705                     --                     --                 --                 --

@araichoor
Copy link
Contributor

thanks!
no inconsistency, it s just that my check failed, because Table.read(exposures-jura.csv) converts those columns in masked columns, so my ~np.isfinite() check is blind to that.
I confirm that for the FIBERFAC_GFA column, the four expids you list have a "masked" value:

>>> d = Table(fitsio.read("/global/cfs/cdirs/desi/spectro/redux/jura/exposures-jura.fits", "EXPOSURES"))
>>> expids = d["EXPID"][~np.isfinite(d["FIBERFAC_GFA"])]
>>> expids.tolist()
[74307, 79769, 110852, 190752]
>>> d[np.in1d(d["EXPID"], expids)]["FIBERFAC_GFA"]
<Column name='FIBERFAC_GFA' dtype='float64' length=4>
nan
nan
nan
nan
>>> d = Table.read("/global/cfs/cdirs/desi/spectro/redux/jura/exposures-jura.csv")
>>> d[np.in1d(d["EXPID"], expids)]["FIBERFAC_GFA"]
<MaskedColumn name='FIBERFAC_GFA' dtype='float64' length=4>
--
--
--
--

@araichoor
Copy link
Contributor

for what is worth, the gfa catalogs have NaN values for those exposures:

>>> g = Table(fitsio.read("/global/cfs/cdirs/desi/survey/GFA/offline_matched_coadd_ccds_SV1-thru_20210928.fits", 2))
>>> g[np.in1d(g["EXPID"], expids)]["EXPID", "NIGHT", "FIBERFAC"]
<Table length=2>
EXPID  NIGHT   FIBERFAC
int64  int64   float64 
----- -------- --------
74307 20210202      nan
79769 20210308      nan
>>> g = Table(fitsio.read("/global/cfs/cdirs/desi/survey/GFA/offline_matched_coadd_ccds_SV3-thru_20240409.fits", 2))
>>> g[np.in1d(g["EXPID"], expids)]["EXPID", "NIGHT", "FIBERFAC"]
<Table length=2>
EXPID   NIGHT   FIBERFAC
int64   int64   float64 
------ -------- --------
110852 20211125      nan
190752 20230815      nan
>>> g = Table(fitsio.read("/global/cfs/cdirs/desi/survey/GFA/offline_matched_coadd_ccds_main-thru_20240819.fits", 2))

those are low-quality exposures, so it could make sense that the gfa pipeline failed for those for some reason:

EXPID   NIGHT    FAFLAVOR  TILEID      EXPTIME            EFFTIME_SPEC    
int64   int64     str19    int64       float64              float64       
------ -------- ---------- ------ ------------------ ---------------------
 74307 20210202  sv1elgqso  80679    566.04931640625    1.3787630796432495
 79769 20210308     sv1ssv  80731 300.06988525390625 5.455439168144949e-05
110852 20211125 mainbackup  42262  601.6654663085938    17.180953979492188
190752 20230815 mainbackup  40203  603.0149536132812    0.6969366669654846

@weaverba137
Copy link
Member Author

Progress on this issue:

  • After the resolution of exposures-jura contains some NaN values #2333, it is now possible to almost fully patch daily tiles and associated exposures that have (LAST)NIGHT >= 20201214 (the first NIGHT in Jura) and EFFTIME_SPEC > 0.
  • MJD values can be patched from the raw data files.
  • Tiles that have no valid exposures (EFFTIME_SPEC == 0), even will not be loaded, even if they have EFFTIME_SPEC > 0.
  • However, there are still 16 tiles, listed above, that have a null value for PROGRAM, even after patching. The next step is to try to patch these by hand. Hopefully PROGRAM can be derived from the fiberassign files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants