How to take advantage of distortion correction info on stacking substacks

Oops, accidentally hit delete on the last post attempt:

I use a script that stacks my data into chuncks (about 100 at a time) to create “sub-stacks”. I then stack these substacks with a final stacking program that understands that these are now debayered 32-bit RGB Fits.

Here is a snippet of the code that uses platesolving for creating of a single substack:

#platesolve the lights
seqplatesolve pp_light1 -disto=distortionFile

# Align lights
# First doing: register pp_light1 -2pass -nostarlist
register pp_light1   -2pass -nostarlist -disto=file ./distortionFile
# Now doing: seqapplyreg pp_light1 -framing=max
seqapplyreg  pp_light1 -framing=max

This works well, The question is, how do I take advantage of the distortion information in the .FITS header when I stack these substacks together.

If I do nothing, I get this note in the console:

12:57:12: Processing all images in the sequence (87)
**12:57:12: Distortion was found in reference image astrometry but you did not include distortion correction when registering the images**
12:57:12: Apply registration: with the current memory and thread limits, up to 27 thread(s) can be used

So it sees the distortion information, but if I put this in my stacking command line:

# Align lights
# First doing: register
register pp_light -2pass -disto=image -nostarlist
# Now doing: seqapplyreg pp_light -framing=max
seqapplyreg  pp_light  -framing=max

It says:

13:01:46: You have selected undistortion from current image but it is not platesolved, perform astrometry first or disable distortion
13:01:46: Error in line 25 (‘register’): invalid arguments.

Do I need to re-platesolve these substacks? I tried but it says they are already platesolved so it creates no distortion file and that then also fails.

How do I accomplish distortion correction using the platesolving that is done on these substacks? I see in the .FITS header it appears to have all the distortion information.

Hello steven,

if you undistort the first sequence pp_light1_, the distortion information should be gone in the images r_pp_light1_ (because they’ve been undistorted when being mapped for the alignment). So your process is correct, you should not undistort twice.

So I’m not sure why it detects distortion again when you gather the substacks in pp_light sequence. In particular the contradiction between we found distortion that you should apply and then there's no distortion in the reference image.
Can you try a command disto on an image of r_pp_light1_ and on your r_pp_light1_ stacked image, just to check the outputs in the console?

BTW, when you paste code here, in particular snippets of scripts, could you knidly enclose those code blocks between ```, Otherwise they get interpreted as markdown which is not good for readability…
Cheers,

Cecile

Thanks for taking a look at this Cecile.

Just so I make sure I conduct the correct test for you, I’ll restate what you want and you can tell me if I’m on the right track:

  1. First you want me to restack one of my “substacks” which I do with platesolving and then you want me to check one of my original registered lights used in this substack with the disto command.

  2. Also you want me to run disto on the resulting substack itself AFTER it is registered against the other substacks.

Did I get this right?

Finally, you noted " In particular the contradiction between we found distortion that you should apply and then there's no distortion in the reference image ."

However, I don’t actually see the console output that says “there’s not distortion in the reference image” in the quotes I gave you but perhaps I’m just not seeing it.

  • Steven

You’re right, it’s not written in your lines, it’s just me doing guess work. I’m assuming that you’ve loaded your substacks as a sequence (so it loads the reference image of this sequence) and then your log says:

13:01:46: You have selected undistortion from current image but it is not platesolved, perform astrometry first or disable distortion

Which is why I’ve have assumed the reference image was not platesolved.

Ok, now to solve your problem, could you share a small folder with 4 images and a mini script that:

  • register/stack the first 2
  • register/stack the other 2
  • register/stack the 2 substacks

In the mini-script, I need exactly all the commands you invoke to do that.
I’m busy with work the next days but I’ll try to get back to you next week-end

Cheers,

Cecile