Author Topic: Split the image  (Read 3966 times)

Offline pengsloth

  • Newcomer
  • Posts: 15
Split the image
« on: 2014 November 07 22:17:04 »
Recently I was able to get some raw data from the Kuiper 61" on Mount Bigelow in Tucson Arizona. The data is fantastic however the camera that the telescope uses is actually made of two 4kx2k CCD's that have their data merged.  Together they make a 2048 by 2048 image in 2x2 binning (only binning that is used on the telescope) at that binning I have found there is a 6 pixel gap in the data.

What I have been able to do is make an IRAF script that splits the image and then recombines them with an interpolated 6px band down the center. I would love to be able to do this in my Pixinsight workflow so I come to you! How could I accomplish this?

Here is a single 4 minutes exposure to experiment with.

Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 627
    • Astronomy Pages G.W.
Re: Split the image
« Reply #1 on: 2014 November 08 07:33:54 »
Hi pengsloth!
Find attached a link which shows how to imbedd a vertikal gap between your left and right image parts...
http://www.werbeagentur.org/oldwexi/left_right2.jpg

Crop helps to remove parts of the Image and extend the Image.
So, from left to the right.
Crop removes the right part of the image by simple cropping by -80, this creates the small left Image.
The next crop extends (81 Pixels) the cropped image to the wished final width (including the gap), this creates the full left image.
Than the same Actions with the right part:
Crop removes the left part of the image by simple cropping by -81, this creates the small right image.
The next crop extends (82 pixels) the cropped image to the wished final width (including the gap), this creates the full right image.
Finally the PixelMath combines the left and the right Image including the gap.

From here on i would not interpolate as i tried on the right side, for me this  is more or less image painting, i would simply do the above steps to all Images you have and
Register them and stack them all with the fitting Sigma rejection, this gets you all data into the gap.

Gerald



Offline pengsloth

  • Newcomer
  • Posts: 15
Re: Split the image
« Reply #2 on: 2014 November 08 08:46:10 »
Thank you! That will help me tremendously. Would there be a way to do this in the form of a script? With a few hundred images at this point (of different objects) I think doing it manually will take FOREVER.

Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 627
    • Astronomy Pages G.W.
Re: Split the image
« Reply #3 on: 2014 November 08 11:55:54 »
Hi,
Yes it would be possible to make a script for this. But thats not my playground...

What i would do is,
pack all the "double" images you want to process   in an Image Container.
draw the triangle of the Image Container over the bottom line of the first crop
pack the resultant Images into the Image Container
draw the triangle of the Image Container over the bottom line of the second crop.

pack all the original "double" images you want to process again   in an Image Container.
draw the triangle of the Image Container over the bottom line of the third crop
pack the resultant Images into the Image Container
draw the triangle of the Image Container over the bottom line of fourth crop.

Now you have all the Left Images and right Images prepared
For the pixelmath expression to combine the left and right.
But i dont have an automatic solution for this PixelMath step, this has to be done manually pair by pair.

I think there is the possibility to create a single PixelMath Expression for the complette whole process steps,
which could be used but this will take me some time to explore...

Gerald





Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 627
    • Astronomy Pages G.W.
Re: Split the image
« Reply #4 on: 2014 November 08 14:25:09 »
Hi pengsloth!
O.k. your processing request can be executed simpler for all files.
Find attached the screenshot
http://www.werbeagentur.org/oldwexi/left_right3.jpg

You select in the Image Container the files or views you want to process.

You create an empty ProcessContainer and pull the three processes, ImageIdentifier, Crop and Pixelmath one after the other
into the ProcessContainer. So, now you have a macro which does what you want on every Image you want.

To execute the Macro(ProcessContainer) pull the triangle of the Image Container into the bottom line of the ProcessContainer.

Thats it. The 3 steps willo be done on every Image in the Image Container.

No Script necessary.

Gerald

Offline pengsloth

  • Newcomer
  • Posts: 15
Re: Split the image
« Reply #5 on: 2014 November 08 19:33:28 »
Wow two and a half hours later and you created the script. Thank you very very much. This will help me greatly. You don't by chance know how formats hints work do you?
« Last Edit: 2014 November 08 20:04:35 by pengsloth »

Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 627
    • Astronomy Pages G.W.
Re: Split the image
« Reply #6 on: 2014 November 09 02:38:54 »
Hi pengsloth!
I dont understand your question concerning format hints.
Have i something missed in PI to this issue?

Gerald
« Last Edit: 2014 November 09 06:36:58 by oldwexi »

Offline pengsloth

  • Newcomer
  • Posts: 15
Re: Split the image
« Reply #7 on: 2014 November 09 09:41:58 »
Sorry that was a bit confusing. What I'm trying to say is that your method works perfectly and has been very useful! However I have run into a completely different problem regarding how the FITS image from the Kuiper telescope are saved. If I open say a bias image in pixinsight using the range selector from 0 to 65535 and truncating it it looks fine and perfect. But then when I try to use the batch preprocessor or image integrator (even with hints though maybe not the right ones) it outputs a file that is has almost 100 the signal. Here is 3 bias, 3 flat fields, and one lum image if you don't mind helping with out with this.

http://geekbilt.tk:81/test.zip

You have really been a life saver! Thank you

Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 627
    • Astronomy Pages G.W.
Re: Split the image
« Reply #8 on: 2014 November 09 15:53:38 »
Hi pengsloth!
The bias files look normal if you load them.
Also the light file and the flat files.

But,  the bias is much brighter than the background of
the light including M27 area...
Using another Astro Image processing program shows for the bias partly negative values!

So, the rules for storing fits have a lot of freedom. I assume you have to read the
Manual for the "iraf.noao.fits files" at:
http://iraf.noao.edu/docs/fitsuserguide.html

Maybe there are some hints why These IRAF-Fits fits files you got are so special. I think they
Need the IRAF Fits Software to be interpreted properly.

However the flat and the light can be used, the bias need some treatment before they are usable in PI.
Sorry for having no deeper knowledge here.

Gerald

Offline pengsloth

  • Newcomer
  • Posts: 15
Re: Split the image
« Reply #9 on: 2014 November 09 21:50:52 »
What is really odd is that if you bring in the bias frame as 0-65535 and truncate it, it comes in perfectly and is exactly the values you would expect (between 2 and 7 in 16bit). It is just that image integrator doesn't seem to read it in the same way you can specify in just pixinsight. I don't know. Its weird.