astro4j icon indicating copy to clipboard operation
astro4j copied to clipboard

"Extract All"

Open vnp85 opened this issue 6 months ago • 28 comments

Question Is there an "extract all possible pixel shifts / lines from a ser-recording" feature? In ImageMath, the closest I found is "range", or a combination of "list(range())" or "anim(range(-5;5))", but I am uncertain how the memory would be managed (I know the heap error all too well). I apologize if this function exists somewhere but I wasn't thorough enough while looking for it.

Use case Exploring a spectrally wide enough scan. You may remember an earlier anomaly I had, picture below. It would be a brute force, time consuming approach to the "flash spectrum event detection" ticket. https://github.com/melix/astro4j/issues/381

Feature description

  • once the user has confirmed (or has a high confidence) that the polynomial is accurate,
  • there should be a feature to extract all the lines that don't bend (grating projection) out of frame beyond a threshold, via
    • a checkbox on the custom process window, or
    • a button on the UI that could be pressed after basic processing is done, or
    • an ImageMath script solution, something like the javascript-ish pseudocode below
[params]
// Select spectral lines / pixel shifts 
//     that curve so that there is enough data to reconstruct the entire disk, 
//         plus at least 10% radius room for prominences.
//
// Smaller than 1, say 0.9 means that the disk can be reconstructed up to at least 0.9 radius, 
//         but don't fail, just do what's possible, if there isn't enough for the entire disk 
spanInDiskRadius = 1.1 
iterationStepSizeInPixels = 1

[tmp]

possibleLines = listLineShiftsThatSpanAtLeastDiskRadius(spanInDiskRadius , iterationStepSizeInPixels)

// iterate on the selection
possibleLines.forEach(function (pixelShift){
   i = img(pixelShift)
   i.saveToFile(naming:auto) 
   // for pixelShift == 28, should produce custom/...........img28.fits and .png
   i.freeMemory()
});


[outputs]
// perhaps conserve memory, nothing here

image

vnp85 avatar Aug 02 '24 15:08 vnp85