-
Notifications
You must be signed in to change notification settings - Fork 23
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
Implement multi-MTL procedure for the DESI extension #833
base: main
Are you sure you want to change the base?
Conversation
…classes (with a view to, e.g., only including LGEs but with all target bits set
…which MTLs could have contributed to a target's state
@araichoor: I haven't added the hooks into the base You can obtain an example output merged MTL for trial updates to
The outputs are:
|
I m giving a look at that, and I ve a question. I guess that s fine from the fiberassign point of view it s ok:
Those last points are relevant for the soon-to-come twin PR in fiberassign, sorry; but those two PRs will be quite intertwined! |
…eful to account for the case where one file is missing
That was intentional, for backward compatibility. But, my latest updates on this branch have a https://github.com/desihub/desitarget/blob/ADM-extension/py/desitarget/io.py#L2983-L2985 That kwarg will write the new columns for a single MTL ledger, too. Perhaps I should propagate that kwarg to |
thanks. |
… can be added in other function
…n_tiles() and read_targets_in_hp()
@araichoor: I think the functionality should exist now to read two ledgers directly using
And then for one ledger:
Or for two ledgers:
I'd appreciate any stress-testing you can do of this new functionality! |
first, quick remark: I guess the syntax in your example in the previous message rather is then, from a quick check, looks like you re not handling the case where
here in the code: desitarget/py/desitarget/io.py Lines 4060 to 4064 in d1ecc10
also I guess you d want to initialize with |
@geordie666, I ve a question: in fiberassign, I ve a sequence like:
the current PR version correctly handles the first step to read 1 or 2 ledgers -- great (btw, I ve not made thorough tests, but it works for my test case if I just edit the I m wondering, for the second step, ie read the static targets files:
for what is worth, the list of added columns is here: https://github.com/desihub/fiberassign/blob/main/py/fiberassign/assign.py#L943-L996 thanks. |
Sorry for my tardiness @araichoor: I'm just getting back to this after daily operations. I'll make your suggested (correct, thanks!) update in my current branch to handle the I think the point with reading the static files is that the In other words, each The |
Also, I updated the syntax in my previous message to match your (correct) interpretation of the function calls. |
oh, right, I forgot that |
hi @geordie666, during my development tests for fiberassign, I notice that there are some duplicates between the dark1b primary ledgers and the secondary ledgers. I find that 533/158,514 TARGETIDs in I then checked for the dark ledgers in so I assume those duplicates between |
Good spot, @araichoor. Unfortunately, I think that's a fundamental problem. We decided to allow the secondary targets to have primary I'll have to think about what to do, here. Could we limit secondary targets to only be part of the survey they were designed for (i.e. DARK secondaries are only allowed on DARK tiles and DARK1B secondaries are only allowed on DARK1B tiles)? Would that still break |
ok I see. first, just checking: do we expect to have {dark1b,bright1b} secondaries? then, "Could we limit secondary targets to only be part of the survey they were designed for" => I think that s doable in fiberassign; will test when nersc is back up. |
I hadn't intended to have dark1b, bright1b secondaries, but the problem you found that we can't have DARK1B primaries mix with DARK secondaries made me thing about that option. I think the other option is some other complicated merging process. But, that's awkward, because you currently merge DARK primaries and secondaries in fiberassign but we'd switch to having to do that in the desitarget multi-MTL process. With additional MTLs that the code doesn't expect. |
thanks again for the clarification. double-checking: the suggestion would be (taking dark, dark1b here; same reasoning for bright, bright1b):
that sounds surely doable in fiberassign, will do! |
in that context, what about ToO? |
This is my suggestion, yes:
I think the ToOs are always OK. They have no concept of program/observing conditions and their |
…Survey targets on extension tiles before running extension targets on extension tiles
This PR updates the MTL framework to use multiple MTLs for the DESI extension.
Features include:
DARK1B
andBRIGHT1B
, which can be updated with redshifts in the usual fashion.io.read_mtl_ledger()
that can handle two MTLs.PRIORITY
+SUBPRIORITY
targets in each MTL, and three new columnsMTL_CONTAINS
,MTL_WANTED
andMTL_HIGHEST
are added to the combined MTL, indicating how the multiple MTLs compared targets that had the sameTARGETID
.From Eddie's careful summary of discussions between him, me, David S., Stephen and Segev:
Let me propose the following new fiberassign header keywords...
and new fields in the FIBERASSIGN extension for each target:
HIGHEST
: bitmask where bit i is 1 if MTLi is the MTL that had the highest priority & subpriority for this target (?)WANTED
: bitmask where bit i is 1 if MTLi has priority > DONE for this target, or priority = DONE if the highest priority over all MTLs for this target is DONE.CONTAINS
: bitmask where bit i is 1 if MTLi contains the targetThen we can update the each MTL using the targets from a tile that have
(keyword & 2**i) != 0
. Option 2 corresponds to HIGHEST, option 3 corresponds to WANTED, and option 1 corresponds to CONTAINS. I think all of the code options we discussed amount to which one of these three fields we use ... but it seems valuable to include all three columns in any case, and that will let us change our mind in later DRs as to what goes in the coadds.