You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It could be nice to write metadata and header information to the resulting stack from the 'SelectiveStack' Block.
Motivation
I tried doing the plate solving for automatic target detection on the stack (instead of the reference) to have the clearest contrast of star/background, when it started giving me issues like that it's missing 'pixel_scale' in the header (and so on). Currently, the stack image as produced by the 'SelectiveStack' Block does not get any header information. If this is on purpose and the user is encouraged to write the header for the stack themselves, then nevermind! Just thought this could help beginner users like myself!
Alternatives
Currently, I implemented a few lines in the 'SelectiveStack' Block that would just write the metadata and header of the last image that went into the block to the resulting stack image. I know that this is a bit crude and a careful selection of just few of the metadata/header properties would be more fitting. I am happy to think about what such a selection could be, if you are interested to include a header and metadata in the stack.
class SelectiveStack(Block):
def init(self, n=5, name=None):
"""Build a median stack image from the n best-FWHM images
|read| :code:`Image.fwhm`
Parameters
----------
n : int, optional
number of images to use, by default 5
name : str, optional
name of the blocks, by default None
"""
super().__init__(name=name)
self.n = n
self._images = []
self._sigmas = []
def run(self, image: Image):
sigma = image.fwhm
self.metadata = image.metadata ######################## EDIT
self.header = image.header ############################ EDIT
if len(self._images) < self.n:
self._images.append(image)
self._sigmas.append(sigma)
else:
i = np.argmax(self._sigmas)
if self._sigmas[i] > sigma:
self._sigmas[i] = sigma
self._images[i] = image
def terminate(self):
self.stack = Image(easy_median([im.data for im in self._images]))
self.stack.metadata = self.metadata ######################## EDIT
self.stack.header = self.header ############################ EDIT
The text was updated successfully, but these errors were encountered:
Feature Request
It could be nice to write metadata and header information to the resulting stack from the 'SelectiveStack' Block.
Motivation
I tried doing the plate solving for automatic target detection on the stack (instead of the reference) to have the clearest contrast of star/background, when it started giving me issues like that it's missing 'pixel_scale' in the header (and so on). Currently, the stack image as produced by the 'SelectiveStack' Block does not get any header information. If this is on purpose and the user is encouraged to write the header for the stack themselves, then nevermind! Just thought this could help beginner users like myself!
Alternatives
Currently, I implemented a few lines in the 'SelectiveStack' Block that would just write the metadata and header of the last image that went into the block to the resulting stack image. I know that this is a bit crude and a careful selection of just few of the metadata/header properties would be more fitting. I am happy to think about what such a selection could be, if you are interested to include a header and metadata in the stack.
class SelectiveStack(Block):
def init(self, n=5, name=None):
"""Build a median stack image from the
n
best-FWHM imagesThe text was updated successfully, but these errors were encountered: