[DAMD-96] Index fibers from multiple spectrographs in PfsDesign Created: 25/Nov/20  Updated: 02/Feb/21  Resolved: 30/Jan/21

Status: Done
Project: Data Model
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Story Priority: Normal
Reporter: price Assignee: price
Resolution: Done Votes: 0
Labels: SuNSS
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to INSTRM-1138 Update grandfibermap to describe all ... Done
Sprint: 2DDRP-2021 A
Reviewers: hassan

 Description   

Our current PfsDesign (and PfsConfig) assumes a single identifier is sufficient to index all fibers in the entire instrument (all spectrographs), which identifier is called fiberId. However, it appears that this is not a scheme that is currently supported/approved in the slit design.

I argue that all fibers should appear in the PfsDesign, so that the 2D pipeline knows what to extract and record; this means that JEG's "science fiber" index (sfib in the "Grand Fiber Map" table) is not sufficient for this.

I believe our options are:
1. Add a spectrograph index to PfsDesign, so the primary keys are the spectrograph and the fiberId; here, fiberId is what JEG calls hole and the slit design calls "Slit position". I think the pipeline can work with this, but may need a bit of tweaking.
2. Extend fiberId so that it incorporates the spectrograph: fiberId= 651*spectrograph + slitPosition. Then fiberId=1..651 are on spectrograph=1, fiberId=652..1302 are on spectrograph=2, and so on. This is my preferred option, as I think the pipeline already supports it.
3. Use both schemes, so the PfsDesign includes spectrograph, hole and fiberId. This might be the most user-friendly, but I worry about the unnecessary duplication of information.



 Comments   
Comment by price [ 25/Nov/20 ]

fmadec points out that the slit number is potentially different from the spectrograph number. This may or may not complicate things.

Comment by yuki.moritani [ 05/Dec/20 ]

Just for recording...
We had conversations on slack and the option 2 seems preferred (fh+sp*651 in terms of GFM), but Fabrice would like to think a little more about which options is the best. Having the same fiberid between the modules looks also simple.

Comment by yuki.moritani [ 08/Dec/20 ]

I was asked to confirm the fiber mapping on the spectrograph side.
According to the design document by Brazil (document on PBworks), the numbering schema of fiber (fh) hole is identical.

GFM doesn't entry three fibers (fh=280, 309, 359) for SM3 and SM4 since there is no counterpart on PFI side. (If the slit is connected to the all fiber lamp, for instance, these three fibers are illuminated)

Note that FCA4, which is now being assembled on SM2 was built lacking three fibers (fh=280, 309, 359). But mapping is correct.

So, I think the fiber index is defined uniquely when you use spectrograph module (not slit serial number). Note that fiber status (blocked/broken/unilluminated) will change in some cases (but I think this is beyond this ticket..).

Comment by rhl [ 08/Dec/20 ]

So, I think the fiber index is defined uniquely when you use spectrograph module (not slit serial number). Note that fiber status (blocked/broken/unilluminated) will change in some cases (but I think this is beyond this ticket..).

That's right. We set those in the pfsConfig file:

      fiberStatus    32-bit int (enumerated type: GOOD,BROKENFIBER,BLOCKED,BLACKSPOT,UNILLUMINATED)
Comment by hassan [ 05/Jan/21 ]

fmadec: do you have any issues with the proposal (option 2, fh+sp*651) ? I propose if there is no issue by end of business Weds 06 Jan 2021, we implement that proposal.

Comment by fmadec [ 05/Jan/21 ]

I think you should use multi -index, so option 3 , that will be the most flexible solution.

for my perspective (testing) spectrograph, I like to have identification from spectrograph point view. fiber 2 on SM1 is "identical" to fiber 2 on SMx, I mean it should be at the extreme position , etc ...
I guess that will be useful also using the entire instrument to have a fast way to know which fiber is on which SM.

We need to agree on way to use DCB, allfiber, SunSS ... I though we said we need a dedicated telecon for that, it may be better to have this telecon before we set this, no ?

 

Comment by hassan [ 16/Jan/21 ]

Hassan needs to arrange a dedicated telecon the week of 18 Jan 2021 to agree on proposal. Participants: Fabrice, Arnaud, Craig, Paul, Robert, Jim, Yuki.

Comment by hassan [ 26/Jan/21 ]

fmadec has no objections with option 2 given that a trivial function can be introduced to decode the fiberId to extract the SM number. So we shall go with option 2.

Comment by price [ 28/Jan/21 ]

Code changes are done. I haven't yet built new simulated data (for the integration test and weekly) because there are other tickets touching the same dataset, so we'd have to recreate the data again after they merge.

Comment by cloomis [ 28/Jan/21 ]

Should have payed a bit more attention to the grandfibermap.txt changes earlier, sorry.

Ideally, grandfibermap.txt is just a data file and not accessed directly. Until now it has been machine-generated. The trivial code in fiberids.py is supposed to wrap all access – this is the way the ICS (fps/cobraCharmer) accesses the GFM. One could have added a fiberId method or property, though it does not really matter since the GFM will be getting other updates.

The cobras.pdf file covers most of the geometry and nomenclature. The unexplained columns in GFM are:
cm: cobra-in-module. 1-57. 1 is the bottom-left cobra in a module when looked at with the wide (29-cobra) board down. Increasing as you move across the module.
mf: module-in-field. 1-14. The number of the module within the field, with 1 at the center of the PFI.
cf: cobra-in-field (1-798). 57*(mf-1)+cm

Note that the "mod" field is very very confusing and should be renamed. The A and B are not the id of the board, but of the fiber bundle coming off the module.

The "id" column contains the id of the USCONNEC connector hole at the Cable B-C interface according to a convention in a different reference document. I believe that the values are currently both incorrect and incomplete. A different ticket covers updating that map.

Comment by price [ 29/Jan/21 ]

cloomis, I've added code to fiberids.py to read that extra column. Is this sufficient to allow merging?

>>> from pfs.utils.fiberids import FiberIds
>>> ff = FiberIds()
>>> ff.fiberId
array([   2,    3,    4, ..., 2332, 2333, 2334], dtype=uint16)
Comment by cloomis [ 29/Jan/21 ]

Good for me.

Comment by price [ 30/Jan/21 ]

Merged to master.

Generated at Sat Feb 10 15:34:12 JST 2024 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.