[DAMD-20] Discuss strategy to persist pfsFiberTrace Created: 16/Aug/17  Updated: 12/May/18  Resolved: 12/May/18

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

Type: Story Priority: Normal
Reporter: aritter Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to PIPE2D-235 Change sliced FiberTrace Image/Profil... Done
Story Points: 1

 Description   

To persist the new `FiberTraces` after the recent changes to the design of the `FiberTrace` class we need to change the datamodel and persist the `MaskedImage` for each `FiberTrace`. There are currently 2 proposals how to do that. One would be to cat all `MaskedImage` s into one single `MaskedImage` and also add an additional data array for the unpacking. This could possibly be achieved by saving the `MaskedImage` first using the `MaskedImage.writeFits` method and then add all additional data to that fits file using `pyfits`. The second proposal would be to find a way to store multiple `MaskedImage` s in one fits file - one `MaskedImage` per `FiberTrace`. This appears to be rather complicated as the `MaskedImage` class was not designed to put multiple arrays into one file. Changes to the `MaskedImage` class might be required



 Comments   
Comment by rhl [ 16/Aug/17 ]

There's no problem writing multiple MaskedImages to a file, but I don't think we want to end up with 1800 HDUs (3 for each fibre). So we definitely want to merge the images into one.

Comment by aritter [ 18/Aug/17 ]

The `FiberTraceSet` only contains the fibers which could be traced while the datamodel for `pfsFiberTrace` requires all `FiberTrace` s to be set in `pfsFiberTrace...fits`. This means that somewhere on the way from the `FiberTraceSet` to the `pfsFiberTrace...fits` file we need to add in empty (zero?) values into the `BinTableHDU` for each `FiberTrace` ID not in the `FiberTraceSet`. Should we do that each time when we create a `PfsFiberTrace` object (and undo it when reconstructing the `FiberTraceSet` from the `PfsFiberTrace` object) or only in the `PfsFiberTrace.write` and `PfsFiberTrace.read` functions? I would lean towards the latter...
Also, should I implement this change as part of PIPE2D-235 or as an individual ticket? Probably individual ticket but it would kind of make sense to do this in PIPE2D-235 as there are plenty of changes already in `pfsFiberTrace.py`...

Comment by aritter [ 19/Aug/17 ]

I have pushed the proposed changes to the Datamodel for PfsFiberTrace to the branch tickets/DAMD-20 in the datamodel repository. The proposed changes are already implemented and tested in PIPE2D-235. Should I file a RFC for the proposed changes?

Comment by hassan [ 12/May/18 ]

Following discussions with cloomis, this ticket is regarded as done.

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