I found that automatically registering images such as the following of M43 OIII was very touch and go even if image set was cleaned/dark subtracted.
Rather than manually defining the aligning source and target location I thought I'd look to see if masking would work to identify a specific region to auto align on. E.g., right side of above image. Astroalign does not allow you to do this as it does not pass a masked array to sep. Sep does allow you to work with masked image regions and it aslo appears to work if you pass in the mask array separately via mask= argument. This works as I have used it to extract only from specific regions of an image.
Looking at astroalign, I see _find_sources() will do something with a masked image if it is allowed to pass through. By making the following change to source and target processing in find_transform():
I found that automatically registering images such as the following of M43 OIII was very touch and go even if image set was cleaned/dark subtracted.
Rather than manually defining the aligning source and target location I thought I'd look to see if masking would work to identify a specific region to auto align on. E.g., right side of above image. Astroalign does not allow you to do this as it does not pass a masked array to sep. Sep does allow you to work with masked image regions and it aslo appears to work if you pass in the mask array separately via mask= argument. This works as I have used it to extract only from specific regions of an image.
Looking at astroalign, I see _find_sources() will do something with a masked image if it is allowed to pass through. By making the following change to source and target processing in find_transform():
_source_controlp = _find_sources(
_bw(_data(source)), DSH FIX
I was able to align on a selected region such as shown below:
The circled objects are the aligned points which were defined by masking. Example code:
_ref_data = ma.masked_array(ref_data, mask=mask) data_in = ma.masked_array(data[i, :, :], mask=mask) . transform, (s_list, t_list) = astroalign.find_transform(data_in, ref_data, max_control_points=control_points, detection_sigma=det_sigma, min_area=minarea)
Will it be possible or feasible to allow the use of masking to specify target/source regions in a future release of astroalign?