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
handle multiple ToO files #437
Conversation
If I understand correctly, the I'm just checking that there's no chance of creating duplicate |
Thanks for the question. This part of the code just reads the ToO files, and feed them fiberassign. For the tertiary program, we do use So there should be no possible |
I think we're fine unless the Do we check, somehow, that the |
thanks for the clarification. no, there is no such checks for now. note that this I could add a check that the about controlling that the I ll keep thinking on that; thanks for raising that! |
Thanks — I'm not really worried about the My main concern is that somebody uses the select_too script (or the related The issue is that the I think this is probably fine as long as @araichoor and I hold the line that all new ToOs are always added to the one, main ToO ledger. It is a tad fragile, though. |
I think I better understand your concern; though:
but.. I would understand we want to be extra-secure about those TARGETIDs.
@schlafly @geordie666 : what do you think? thanks! |
@araichoor: I'm actually comfortable with the current level of security (I agree that it's highly unlikely that other people than you or me, or a couple of others, would use the It would be nice (and somewhat safer) to implement the suggestion to restrict path-options for the |
@geordie666 : the code change to control the btw, you wrote: "Do we check, somehow, that the --custom_too_file is always from the allowed directory paths in $SURVEYOPS or $MTL_DIR?" |
Yep, I think restricting to $DESI_SURVEYOPS makes a lot of sense. Thanks! |
great. actually, while doing the coding, I m thinking of a corner case: if we design the tile at kpno, and if we want to make a rerun at nersc (or the opposite), then check on $DESI_SURVEYOPS will fail for the rerun. |
I ve pushed commits now implementing:
The requirement that the provided files have to exist is not compulsory; I thought it made sense though, as I see it a safeguard against typo in providing the file path, which would otherwise be silently ignored (the code wouldn t find any file, then proceed with adding zero targets). If we re happy with that, I ll update the first comment of this PR with those changes. |
Thanks for adding these checks, Anand. I think you've addressed my concerns. Others might want to comment, of course, but I think this looks good to merge. |
Bringing an off-list discussion to this PR: For downstream parsing of the fiberassign file headers (e.g., for the targetphot/tractorphot VACs), it would be more convenient to have the multiple TOO filenames match the secondary targeting filename model, i.e., use TOO, TOO2, TOO3, to match SCND, SCND2, SCND3, etc., instead of using a comma-separated list of TOO files. |
thanks for bringing that point here @moustakas. I ll update the original PR message with the changes made the -- useful! -- discussions here. I plan to merge that PR tomorrow morning. |
for info, @moustakas: I ve designed with those changes the following tiles (calibration fields on xmm-lss): if you ve time, it would be great if you could confirm your scripts run smoothly on those! further infos, if relevant:
|
This PR handles the use of several ToO files in the
--custom_too_file
argument.This is in the context of the calibration fields (https://desi.lbl.gov/trac/wiki/SurveyOps/CalibrationFields), where we will:
--custom_too_file
with a list of regular targets)The current main code version does not allow this, as the
--custom_too_file
is already "taken" for the regular targets (choice made when implementing the tertiary program approach, with "hacking" the ToO channel for the tertiary program targets).With this PR, one can provide 2 or more ToO input files.
In
fba_launch_io.create_too()
, all the ToO files are read (+cut), before being "vstacked" in a single catalog.When reading the individual ToO files, if missing, we had the NUMOBS, NUMOBS_MORE, PRIORITY columns, with setting those to NUMOBS_INIT, 0, PRIORITY_INIT (otherwise, the "vstacking" would set those to zero).
And we perform two safety checks before "vstacking", as:
This last check (no duplicated TARGETIDs) sounds safe to me, as I cannot foresee why we would want to provide several files with duplicates.
One smoother way to deal with such a case could be to arbitrarily pick one representation of each TARGETID.
But that could cause ambiguity/discrepancy in knowing which was the parent catalogue for that TARGETID.
Provided that, I think I ll defer to a later PR the handling of such cases.
If only one catalog is provided, the code should behave as in the current main version.
For sanity, I have assessed that the main bright/dark tiles can be rerun with this branch.
Updates from Oct., 31, 2022:
This PR also includes the following (thanks to suggestions):