MOSAIC mIFU: tabular output - #968
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #968 +/- ##
==========================================
+ Coverage 75.46% 75.90% +0.43%
==========================================
Files 70 70
Lines 9003 9038 +35
==========================================
+ Hits 6794 6860 +66
+ Misses 2209 2178 -31 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
teutoburg
left a comment
There was a problem hiding this comment.
Didn't try to fully understand the transformations behind this (it's too hot), I assume you did. Two minor comments, otherwise 👍
| pass | ||
|
|
||
| else: | ||
| logger.warning("Unknown output format: %s", output_format) |
There was a problem hiding this comment.
| logger.warning("Unknown output format: %s", output_format) | |
| logger.error("Unknown output format: %s", output_format) |
I'd say an unknown value here is more than a warning. logger.error only log the error, does not stop execution like raising an exception would, so the behavior is identical to setting output_format="image".
| i = 0 | ||
| for sptid, spt in tqdm(self.spectral_traces.items(), | ||
| desc="Fiber traces", position=2): | ||
| x_mm = detwcs.all_pix2world(np.arange(image.shape[1]), 1, 0)[0] | ||
| lam = spt.x2lam(x_mm) | ||
|
|
||
| y_mm = spt.table["y"][0] | ||
| jfib = int(detwcs.all_world2pix(0, y_mm, 0)[1]) | ||
| idarr.append(sptid) | ||
| xarr[i] = (self.aplist['left'][i] + self.aplist['right'][i]) / 2 | ||
| yarr[i] = (self.aplist['top'][i] + self.aplist['bottom'][i]) / 2 | ||
| specarr.append(image[jfib,]) | ||
| lamarr.append(lam) | ||
| i += 1 |
There was a problem hiding this comment.
Maybe use enumerate instead of incrementing a counter?
The PR introduces a new effect
MosaicOutputFormatthat sets the format produced byreadout()for MOSAIC.collapse1d: the spectra from the fibers in a bundle are summed to a single spectrum. To be used for the MOS modes.table: the spectra from the fibers in a bundle are arranged in a binary fits table with one row per fiber. To be used for the mIFU modes.image: the image format for the (pseudo-)detector is kept. Only for testing purposes.