[DAMD-110] Add mapping of fibre to MTP connector to pfsConfig/Design Created: 27/Apr/21  Updated: 29/Jun/21  Resolved: 29/Jun/21

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

Type: Task Priority: Normal
Reporter: fmadec Assignee: rhl
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates INSTRM-1259 Add better accessors for SuNSS fiber ... Won't Fix
Relates
relates to INSTRM-1258 Update the fiberids.py accessor for t... Done
relates to INSTRM-1288 Provide a function to map fiberIds to... Won't Fix
Story Points: 2
Sprint: 2DDRP-2021 A 4, 2DDRP-2021 A5, 2DDRP-2021 A 6

 Description   

it would be nice to know to which MTP belong a given fiber.
at least when the flux uniformity across the slit is checked at LAM we do need this.



 Comments   
Comment by cloomis [ 27/Apr/21 ]

That is in the GFM file, though encoded in a slightly non-obvious way.

Comment by rhl [ 27/Apr/21 ]

price How should we do this? Adding an extra column to the DESIGN/CONFIG tables would probably be best, but we'll have to think about backwards compatibility.
There was also talk about adding a relative transmission for each fibre (e.g. 3 is c. 10% due to a Cable A problem), should we do that at the same time? Currently there's just a binary decision "Is fibre BLOCKED?"

Comment by rhl [ 27/Apr/21 ]

I think we need it in the pfsConfig as it looks as if e.g. we may need this information for sky subtraction.

Comment by price [ 28/Apr/21 ]

I don't see the need to have it in the pfsConfig if it's in pfs_utils (pfs.utils.fiberids.FiberIds) and static. But if it's not static, then we need a way of minimally choosing the correct configuration.

Having the relative transmission might be nice (though it's theoretically available through the fiberProfiles), but again I don't see the need to put it in the pfsConfig.

Comment by rhl [ 28/Apr/21 ]

Currently the pipelines don't use anything accessed via pfs_utils, and I think it makes things more complicated if we have to start doing so. My concern is what we should do if MTPs move together (and I think that there's evidence for that).
If it's just Fabrice in his lab, then I agree that documenting the interface for him would probably be enough.

Comment by price [ 28/Apr/21 ]

We already distribute pfs_utils along with the 2D pipeline, and we use it to create pfsDesign files for DCB (makeDummyCableBDesign.py).

Comment by price [ 06/May/21 ]

I think we agreed in a recent meeting that using the mapping in pfs_utils is sufficient. I propose closing this WONTFIX.

Comment by fmadec [ 07/May/21 ]

well

if so can we be sure that we have the proper API with pfs_utils and so a proper ticket? hassan ?

Comment by hassan [ 07/May/21 ]

OK. Let me check. If there is missing/failing functionality I will file a new ticket.

Comment by rhl [ 07/May/21 ]

I'm working on this (that is, I wrote the code). I assume that the name we want is e.g. D1-3-1

Comment by fmadec [ 08/May/21 ]

D1-3 tell us which mtp but not which fiber in the mtp connector, if I am correct

D1-3-<specId>-<mtp position>
it would be nice to have also the position in case we identify fiber that show bad illumination (as we did on SM1)

Comment by rhl [ 08/May/21 ]

There are 4 of values per fibre (A, BA, BC, and C).  So do you want me to return

("D0-1-1", (2, 26, 31, 7))

or something else?

Or just the 4 raw strings, including the cobra number?

Comment by fmadec [ 08/May/21 ]

it may be worth to have the complete information, no ?
or we could have different option that returns different information ?

for my perspective I only need which mtp and position on Cable A but... so D0-1-x-26 for example or simply DO-1 according what I am looking for (mtp only for this last example)

Comment by hassan [ 10/Jun/21 ]

As discussed during the DRP telecon on 2021-06-04, this functionality will be implemented in pfs_utils, not the datamodel. INSTRM-1288 covers that work.

Comment by rhl [ 16/Jun/21 ]
Return MTP information for the specified fiberIds

        Args
        ----
        fiberIds : array of 1-indexed fiberIds
        pfsConfig : `pfs.datamodel.PfsConfig`
           Tell us e.g. which fibres go to SuNSS

        Returns
        -------
        an array of ("MTPID", (holes), cobraId) where "holes" are for the A, BA, BC, and C connectors,
        and cobraId is the 0-indexed global cobra ID

        For SuNSS, the "cobra ID" is negative, and its absolute value is the ID in the
        ferrule (for the imaging leg) or 127 + ID (for the diffuse leg)

The usage is:

import lsst.daf.persistence as dafPersist
import pfs.utils.fiberids as fiberids

butler = dafPersist.Butler("/projects/HSC/PFS/Subaru")
dataId = dict(visit=45783, arm="r", spectrograph=1)
pfsConfig = butler.get('pfsConfig', dataId)

fiberIds = fiberids.FiberIds()

fiberIds.fiberIdToMTP(pfsConfig.fiberId, pfsConfig)[100] 

which returns

('U1-2-1', [26, 2, 7, 31], -51)

(where -51 indicated an imaging SuNSS "cobra").

Comment by rhl [ 16/Jun/21 ]

Pushed to tickets/DAMD-110

Comment by hassan [ 18/Jun/21 ]

Proposed changes in branch look fine.

Comment by hassan [ 29/Jun/21 ]

Merged to master.

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