Where to find Centre RA and Dec?

800 views
Skip to first unread message

Tony Hugo

unread,
Oct 3, 2013, 1:48:34 AM10/3/13
to astro...@googlegroups.com
Hello.

Such a silly question but where is the centre of the solved field recorded?

I have checked the WSC header but that gives a reference RA, DEC to a reference pixel X, Y that usually is not in the centre of the image.
I know it is somewhere because it is printed on the console when a solve succeeds. I haven't seen it in the other files but I could have missed it.

I've tried hacking solve-field.c to produce a file with this info (ra dec width height and orient) written as binary doubles but that's not a solution I'm happy with.
It works beautifully but there must be a standard way.

I am using fedore 19 and writing a program which includes telescope control and I need the centre position to do corrective goto for the mount.

Since other will be using the program I need a way to get this info from the default install of astronomy.net.

Please tell me what I've missed.

Thanks,
Tony

Dustin Lang

unread,
Oct 3, 2013, 8:42:46 AM10/3/13
to astro...@googlegroups.com
Good question!

If you run solve-field with the "--crpix-center", it will put the reference point in the middle of the image, and then the CRVAL1,CRVAL2 fields will be the RA,Dec of that reference point.

OR, you can run the "wcsinfo" program on the resulting wcs.fits file, and it will tell you a bunch of details about the WCS header, including the center (in a couple of different formats).

OR, use wcs-xy2rd to convert x,y pixel coordinates to RA,Dec coordinates.

I thought solve-field wrote out a (text) field center when it found a solution.  But you want high-precision coords, probably.

If none of those solutions work, I would be fine with adding a line of (text) output to solve-field's results, or even an extra header card in the WCS, giving the RA,Dec center.  It's a reasonable thing to want.  If you want to send a patch, I'll be happy to review and probably include it in the next release.

cheers,
dustin

Tony Hugo

unread,
Oct 3, 2013, 8:49:25 PM10/3/13
to astro...@googlegroups.com
Hello,

Mate, you are a champion! That is what I needed to know.

My preference is to use the crpix-center option as this will keep the default install as is.
I will try them and see which is best.

Thanks for the option of offering a patch, but I have seen your code and anything I could add would only spoil it.

By the way, I found it ridiculously easy to add plate-solve to my program- by just calling up astrometry.net.
Great work and many thanks,
Tony

Feichen Shen

unread,
Apr 14, 2015, 4:30:57 PM4/14/15
to astro...@googlegroups.com
Hi,

This topic is exactly what I'm looking for. However, I do have some more question regarding the reference coordinates. 

I'm trying to interface the WCS.fits with the Starry Night Pro Plus 6 user image and Stellarium. In SN6, the user images are defined by center RA-DEC coordinates and the above reply already solves it. However, it also requires the field width and height, as well as a rotation angle relative to the center pixel. 

These 3 I wasn't able to find using the standard wcstools.

Best,
Feichen 

Dustin Lang

unread,
Apr 14, 2015, 5:15:48 PM4/14/15
to astro...@googlegroups.com
Hi,

The wcs.fits file contains cards IMAGEW and IMAGEH that tell you the image height and width, in pixels.  If you want in degrees, compute the pixel scale and multiply by imagew or imageh.  Pixel scale = sqrt(abs(CD1_1 * CD2_2 - CD1_2 * CD2_1)) in degrees/pixel.  For rotation, here is the routine we use:
https://github.com/dstndstn/astrometry.net/blob/9a085ee2a35c6da12144c5f32fa5970938ff1b2d/util/sip.c#L550

Hope that helps,
--dustin

Feichen Shen

unread,
Apr 14, 2015, 6:08:52 PM4/14/15
to astro...@googlegroups.com
Hi Dustin,

I had thought about that but since most of my images are very wide field. Thus tangent project should be considered somehow (pixel scale in the corner are larger than the center).

Best,
Feichen

Dustin Lang

unread,
Apr 14, 2015, 7:10:09 PM4/14/15
to astro...@googlegroups.com
Then use pixel to radec routines using the full WCS solution.  Or figure out how the tangent plane projection affects the size.  Any program that is using width,height,orientation is doing something approximate anyway.



Reply all
Reply to author
Forward
0 new messages