[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: |
|
||||||||||||
| Story Points: | 2 | ||||||||||||
| Description |
|
As expected following 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 fiberProfiles[fiberProfiles.fiberId==3] returns the FiberProfile corresponding to fiberId 3. |