Author Topic: CatalogStarGenerator  (Read 13412 times)

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
CatalogStarGenerator
« on: 2013 March 05 04:01:08 »
I wrote the script CatalogStarGenerator the last year to generate a "copy" of an image without imperfections (geometric distortions, gradients, etc) using data from a catalog . A few weeks ago there was a request for an script with similar functionality so I have decided to publish it. For this, I had to modify it to implement a configuration dialog and allow setting manually the geometry.

The script tries to simulate an star field where the brightest stars are saturated and the dimmest are drown out in the sky background. The following parameters can be configured:
  • Geometry: The geometry of the image can be a copy of the geometry of the active window (only when it has been plate solved and has WCS coordinates) or can be defined by the user. The geometry of the image is defined by the coordinates of the center, the resolution or focal, size in pixels and rotation. It is also important to define the epoch when using a catalog with the proper motion of the stars.
  • Catalog: The list shows all the catalogs available in AnnotateImage. Only the catalogs with stars should be used.
  • Saturation magnitude: The stars with a magnitude less than this value will be saturated. This value is necessary to limit the dynamic range of the image.
  • Maximum magnitude: This parameter limits the magnitude of the stars read from the catalog.
  • Background magnitude: This is the magnitude of the sky background. This value is necessary to limit the dynamic range of the image.
  • PSF model: The script has implemented Gauss and Moffat Point Spread Functions. For both it is possible to choose the FWHM of the distribution. For Moffat there is an additional beta parameter.
  • Generate noise: When this option is selected, noise is added to the image using an uniform distribution.
Since the script has not the limitations of a CCD camera (especially the well capacity or dynamic range) it is possible to generate very high dynamic range images. In this case ScreenTransferFunction has not enough precision to stretch the image. This happens when the difference between the background and saturation magnitudes is more than 10. The script warns when this happens. In this case if it is necessary to stretch the image for visualizing it, the best method is to open STF, apply the autostretch, drag the STF to the HistogramTransformation, apply the HT to the image and reset the STF. This method is useful for any HDR image.

I have also a couple of improvements in AnnotateImage:
  • Graphics scale: This slider modifies the size of all the elements in the image at the same time. It is useful for applying the same annotation to images of different size. If the image is very big, the annotation can be too small. Increasing the "graphics scale" parameter the texts and markers are drawn bigger.
  • Preview: The preview button opens  a window with a previsualization of the annotation. The preview window can be resized, zoomed (using the toolbar or with the mouse wheel), and scrolled dragging the cursor. The preview caches the data from the catalogs so doing several tries for adjusting the annotation parameters is faster with the preview than before.
Latest version
This message will be kept updated with the latest versions of the scripts:
  • ImageSolver v1.7.2
  • AnnotateImage v1.5
  • CatalogStarGenerator v0.1.1
« Last Edit: 2013 March 07 02:20:32 by Andres.Pozo »

Offline Philippe B.

  • PixInsight Old Hand
  • ****
  • Posts: 399
    • CIEL AUSTRAL
Re: CatalogStarGenerator
« Reply #1 on: 2013 March 05 07:40:45 »
Thank you, very useful (and what I needed)
I will test it soon  8)

Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 627
    • Astronomy Pages G.W.
Re: CatalogStarGenerator
« Reply #2 on: 2013 March 05 12:33:21 »
Thank You Andres!
again a great gift.

Before i install the scripts  a question:
Do they run only in PI 1.8  or only PI 1.7
or in both ?

Thanks
Gerald

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: CatalogStarGenerator
« Reply #3 on: 2013 March 05 13:23:11 »
Before i install the scripts  a question:
Do they run only in PI 1.8  or only PI 1.7
or in both ?
I have only tested them in PI 1.8RC3. I think that they should run in 1.7, but I don't know.

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: CatalogStarGenerator
« Reply #4 on: 2013 March 07 02:21:26 »
I have fixed a few small errors in CatalogStarGenerator:
  • The search coordinates button didn't work.
  • The window ID when using user defined geometry was not correct.
  • The FITS tags for the images with user defined geometry were wrong.

This version also fixes an small error in ImageSolver: It had a half pixel error in RA reading the coordinates from the FITS tags.

The new version can be downloaded from the first post in this thread.

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: CatalogStarGenerator
« Reply #5 on: 2013 March 07 03:34:56 »
Would it make sense to distribute this via Juan's update system?
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Philippe B.

  • PixInsight Old Hand
  • ****
  • Posts: 399
    • CIEL AUSTRAL
Re: CatalogStarGenerator
« Reply #6 on: 2013 March 13 07:36:59 »
Hello
I made some tests and it seems to work fine (but we have to think about several values  8) which can be wrong )

If you have time to improve thsi script, I would suggest :

- choice of local PPMX catalog (like you have in Image Solver script, where you can choose local or internet catalog)
- in "user define geometry" choice, could you read the RA and DEC of the image (solved by "imagesolver" for example). Then put the values in the cases. Sometimes, I want to use the default image parameter but put a bigger star map with an angle. So if by default the RA and Dec values are filled like you have in Annotate script, it should be fine !!!!

Many thanks for your script. It was what I needed to preprocess all my images with my newest method.

Cheers
Philippe
 

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: CatalogStarGenerator
« Reply #7 on: 2013 March 13 08:02:47 »
Hi Philippe,

- choice of local PPMX catalog (like you have in Image Solver script, where you can choose local or internet catalog)
I don't know if this is possible. I don't know the format of PPMX.bin and if it is possible to read it using Javascript. Perhaps I could use the process StarGenerato to write in a file the position and flux of the stars and then read this file and draw the stars.
I will think about it.
- in "user define geometry" choice, could you read the RA and DEC of the image (solved by "imagesolver" for example). Then put the values in the cases. Sometimes, I want to use the default image parameter but put a bigger star map with an angle. So if by default the RA and Dec values are filled like you have in Annotate script, it should be fine !!!!
This should be easy. I can add a new button that copies the values of the current window to the "user defined" fields.

The configuration dialog has tooltips in all the fields describing the function of each parameter. If there is any not clear enough please report it to me. Thanks.

Andrés.

Offline Philippe B.

  • PixInsight Old Hand
  • ****
  • Posts: 399
    • CIEL AUSTRAL
Re: CatalogStarGenerator
« Reply #8 on: 2013 March 13 08:17:18 »
Hi andres
Many thanks !


For PPMX.bin, look at your IMAGE SOLVER script
You already have this option in the Model Parameter option (local or VizieR star catalogs)
On local, you can choose PPMX.bin on the hard drive and it seems to be OK

Cheers
Philippe


Offline gvanhau

  • PixInsight Old Hand
  • ****
  • Posts: 345
Re: CatalogStarGenerator
« Reply #9 on: 2013 March 13 08:48:02 »
Hello Andres
Las night I tried the scrip in order to generate a starfield as base for a big mosaic I'm building.
I selected an area of 10000x10000 pixels, and used focal lenght and pixels size option for scale.

The script ended normally, buy it only generated few stars in a horisontal band at the center of the image (about 1/3 of image).
I tried this with two different catalogs getting same result.

What could be wrong?

Regards
Geert
Geert Vanhauwaert

Offline Philippe B.

  • PixInsight Old Hand
  • ****
  • Posts: 399
    • CIEL AUSTRAL
Re: CatalogStarGenerator
« Reply #10 on: 2013 March 13 09:06:20 »
Hi Geert
I got the same result bu I think (but I'm not sure) it is limited by the download size from the servers.
If you ask for a mag 19 stars with 10000x10000, maybe it is more than 100,000 stars and it cannot accept and reduce the size to an R.A. range ?
Try lower the max magnitude 

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: CatalogStarGenerator
« Reply #11 on: 2013 March 13 09:46:48 »
Hello Andres
Las night I tried the scrip in order to generate a starfield as base for a big mosaic I'm building.
I selected an area of 10000x10000 pixels, and used focal lenght and pixels size option for scale.

The script ended normally, buy it only generated few stars in a horisontal band at the center of the image (about 1/3 of image).
I tried this with two different catalogs getting same result.

What could be wrong?

Regards
Geert
When a query to a VizieR server produces a large result, the server only returns the first X rows, where X is a quite large value (>100.000).

The solution is to generate the image by tiles or to reduce the maximum magnitude.

Offline gvanhau

  • PixInsight Old Hand
  • ****
  • Posts: 345
Re: CatalogStarGenerator
« Reply #12 on: 2013 March 14 08:56:25 »
Thanks Philippe and Andrés.
I finnaly reduced the max magnitude and it worked ok.

Regards
Geert
Geert Vanhauwaert

Offline Alejandro Tombolini

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1267
    • Próxima Sur
Re: CatalogStarGenerator
« Reply #13 on: 2013 March 17 16:36:48 »
Would it make sense to distribute this via Juan's update system?
+1

Hi Andres, thanks for all your scripts!!! :)

I am not sure if I have the latest version of the script, but in this version I noticed that the Reset button do not works as I expected when the windows comes from an icon. It reset to the values of the original icon when I was expected to erase all values.
There is no problem when it comes from Script>Render>CatalogStarGenerator.

Saludos. Alejandro


Offline troypiggo

  • PixInsight Addict
  • ***
  • Posts: 258
Re: CatalogStarGenerator
« Reply #14 on: 2015 July 23 22:30:52 »
Hi Andres,

Is there any way to use colour catalogues and generate coloured stars?