panoptes / panoptes-utils

A set of Astronomical utility functions. PANOPTES style. :hammer_and_wrench: :telescope: :stars:
https://panoptes-utils.readthedocs.io
MIT License
4 stars 9 forks source link

Add new polar alignments utils #157

Closed wtgee closed 4 years ago

wtgee commented 4 years ago

Add functions for overlaying grid on polar image (see plot-constellations from astrometry.net).

Pulled from #113.

wtgee commented 4 years ago

Adding some more information:

When a unit is first being set up it needs to be polar aligned by taking some pictures of the pole star. We currently have a script that will take this picture as well as take a long exposure shot taken while the mount it slewing.

The long exposure shot does not need any extra processing.

For the picture of the pole star we simply want to overlay the coordinate axis onto the image. If the unit is well-aligned the coordinate axis will converge in the center.

The plot-constellation script from astrometry.net does exactly this. However, I could never figure out how to get it to work correctly.

I've attached the original FITS file and the jpg as well as the overlay that I created with the commands below. The idea would be to merge the overlay image onto the jpg image. Note that the overlay is a png but the original image is a jpg. We need the png for the transparency on the overlay so the final image will probably be a png.

I'm pretty sure plot-constellation or another tool within astrometry.net does this already. If not then maybe doing something with Wand (which I've never used).

We'll also want to play with the other options, -G 60 and the -g (color), etc to see what gives enough information.

➜ plot-constellations -w pole_canon01.fits -G 60 -B -b 25 -o output.png
The star Polaris (αUMi)
The star Yildun (δUMi)
The star 24UMi

Note that this works even though there are clouds in this image.

Original image:

pole_canon01

Overlay:

overlay

pole_canon01.fits

So the end goal is to have one image that looks like the original but has the overlay on top of it.

wtgee commented 4 years ago

I also just noticed that the overlay is flipped vertically w.r.t. to the original jpg (Polaris is above the middle line in the overlay but below on the original), so when the two are combined the overlay will need to be flipped. That will be annoying with the fonts, so maybe we'll have to invert the FITS before running the command.

However, that can be figured out after figuring out how to merge the two.

jlibermann commented 4 years ago

Hi, I was able to get the plot-constellations function to work. I first installed imagemagick via sudo apt-get install imagemagick. I then flipped the jpeg image using convert -flip Documents/pole_canon.jpg Documents/pole_canonfl.jpg. I then ran jpegtopnm Documents/pole_canonfl.jpg | plot-constellations -w Documents/pole_canon01.fits -G 60 -B -b 25 -f 30 -i- -o output1.png. The output image is below:

output1