[PIPE2D-890] fiberProfileSet does not return the expected number of fibers Created: 25/Aug/21  Updated: 25/Aug/21

Status: Open
Project: DRP 2-D Pipeline
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Normal
Reporter: hassan Assignee: price
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to PIPE2D-770 Support sub-selection of pfsConfig Done
relates to PIPE2D-819 fiberProfiles should contain an entry... Done
Story Points: 2

 Description   

As expected following PIPE2D-819, when reading in an example SuNSS fiberProfileSet instance, the number of fibers returned is expected to be 254, so the number of good fibers (251) plus the 3 known bad fibers.

However only 251 fibers are returned in this particular case:

In [1]: import lsst.daf.persistence as dafPersist 
   ...: dataDir='/projects/HSC/PFS/Subaru' 
   ...: calibRoot='/projects/HSC/PFS/Subaru/CALIB-SuNSS-2021-06-16' 
   ...: butler = dafPersist.Butler(dataDir, calibRoot=calibRoot) 
   ...: dataId = dict(visit=46229, arm="r", spectrograph=1) 
   ...: fiberProfiles = butler.get("fiberProfiles", dataId) 
   ...: len(fiberProfiles.fiberId)                                                                                                                                         
CameraMapper INFO: Loading exposure registry from /projects/HSC/PFS/Subaru/registry.sqlite3
CameraMapper INFO: Loading calib registry from /projects/HSC/PFS/Subaru/CALIB-SuNSS-2021-06-16/calibRegistry.sqlite3
Out[1]: 251

Moreover, the indexing is such that one has to specify the fiberId, not the element position:

In [6]: fiberProfiles[0]                                                                                                                                                   
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-6-53f0baa2a284> in <module>
----> 1 fiberProfiles[0]

/tigress/HSC/PFS/stack/20190925/stack/miniconda3-4.5.12-1172c30/Linux64/drp_stella/w.2021.34/python/pfs/drp/stella/fiberProfileSet.py in __getitem__(self, fiberId)
     79 
     80     def __getitem__(self, fiberId):
---> 81         return self.fiberProfiles[fiberId]
     82 
     83     def __setitem__(self, fiberId, fiberProfile):

KeyError: 0

In [7]: fiberProfiles[3]                                                                                                                                                   
Out[7]: <pfs.drp.stella.fiberProfile.FiberProfile at 0x2b8346e68fd0>

It would be useful, and consistent, to have the NumPy-style indexing on a boolean condition (as implemented for pfsConfig in PIPE2D-770), such that:

fiberProfiles[fiberProfiles.fiberId==3]

returns the FiberProfile corresponding to fiberId 3.


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