<p>What you probably want is the information stored in the WCS header keywords, which are in the <code>wcs.fits</code> table file that astronometry.net generates; it's one of the available downloads on the Results page. (I'm assuming you're using the web interface, but I imagine it's generated by the command-line version of the code, too.)</p>
<p>The relevant keywords that define <em>the</em> &quot;reference pixel&quot; for the image are:</p>
<pre><code>CRPIX1 = image x-coordinate of reference pixel
CRPIX2 = image y-coordinate of reference pixel
CRVAL1 = right ascension in decimal degrees of reference pixel
CRVAL2 = declination in decimal degrees of reference pixel
</code></pre>
<p>(Note that in the &quot;Advanced&quot; section of the upload page, you can specify your own desired reference pixel (CRPIX1,CRPIX2) coordinates, in case you want something other than the somewhat arbitrary values that astronmetry.net determines.)</p>
<p>You also need the transformation (&quot;CD&quot;) matrix values, which include the effects of both pixel scale and rotation: <code>CD1_1, CD1_2, CD2_1, CD2_2</code> .</p>
<p>In principle, to compute the celestial coordinates of any pixel <span class="math-container">$(x,y)$</span>, you would do</p>
<pre><code>RA = CRVAL1 + delta_RA
Dec = CRVAL2 + delta_Dec
</code></pre>
<p>where the offset values are computed as</p>
<pre><code>delta_RA = CD1_1 * (x - CRPIX1) + CD1_2 * (y - CRPIX2)
delta_Dec = CD2_1 * (x - CRPIX1) + CD2_2 * (y - CRPIX2)
</code></pre>
<p>This is the basic version of WCS computation; higher-order terms can provide better accuracy, especially over a wide field of view. I think astrometry.net includes &quot;SIP distortions&quot; keywords in <code>wcs.fits</code>, which will improve the accuracy, but I'm not familiar with the associated computations. If you really want the extra accuracy, it's probably best to use something like the <a href="https://docs.astropy.org/en/stable/wcs/index.html" rel="nofollow noreferrer">WCS code in astropy</a>.</p>
<p>To estimate the accuracy, the thing to do would probably to use the pixel coordinates of the stars with known &quot;reference&quot; coordinates (i.e., true RA,Dec) to compute predicted RA,Dec using the WCS parameters, and compare the predicted values to the known values.</p>

CC BY-SA 4.0
2022-06-19T08:52:16.237Z
Thank you for your thorough answer, it is a great sum up. Meanwhile, all the steps you mentioned, I am already doing. I familiarize myself with Astrometry.net output, .wcs solution, as well as with .corr file. Maybe I should be using different terminology, my question would be more clear. Anyway, by reference coordinates, I mean true RADec, and those coords can be obtained from the catalog(or index files), but only for the stars.
Using the Astrometry .wcs file, and astropy's all_pix2world() function, I can convert any pixel position to a celestial coordinate. Or using CD__ as you described.
Falco Peregrinus
CC BY-SA 4.0
2022-06-19T08:53:33.370Z
My procedure for estimating solving accuracy is the same as you describe. Once I get from astrometry predicted celestial coords, I can calculate the separation(great circle distance) between that estimated coordinate of a star and the true coordinate(from the catalog, or index file). If I do that for all the detected stars, I can get the average distance between the true and predicted coordinates. And that is fine for now.
Falco Peregrinus
CC BY-SA 4.0
2022-06-19T08:53:38.473Z
But, what if my starfield only contains stars in one part of the image, but I need coordinates for the whole image? Astrometry would still provide celestial coords for all pixels, but the problem is that for the pixels where are no stars, we don't have true coordinates. And mapping on those pixels could be terrible(extrapolation problem). And then, how to estimate mapping accuracy for those pixels, where we don't have stars(true coordinates)?
Falco Peregrinus
CC BY-SA 4.0
2022-06-21T15:12:36.860Z
The best you can really do is assume the mean accuracy for the stellar coordinates applies to the whole image. (If you have lots of stars, you could try making maps of the 2D variation in the accuracy -- maybe one side of the image has larger errors in RA than the other -- but that's probably overkill.)
Peter Erwin
CC BY-SA 4.0
2022-06-16T12:35:41.147Z
2022-06-16T12:35:41.147Z
Peter Erwin
<p>I am solving starfield using Astrometry.net, an amazing piece of software I must say. After solving the starfield, Astrometry gives celestial coordinates of centroids of every star in the image, as well as celestial coordinates of those stars from the catalog. Therefore, it can be easily calculated on sky separation between stars in the image and stars in the catalog which can be used to calculate average solving accuracy. However, I would like to know what is the precision of mapping one particular pixel in the image, where no star can be found. I have its coords from Astrometry.net, but I don't have reference coordinates for that pixel from the catalog. Is it possible to know the position of every pixel from the catalog? Does someone have the same problem/task to solve? How would you calculate the average solving accuracy for some random pixel, or in my case, the accuracy of mapping the central pixel in the image?</p>

CC BY-SA 4.0
2022-06-13T13:54:42.083Z
If you need just the accuracy, you could compute coordinates for adjacent pixels and estimate? Here are some long answers re converting pixels to coordinates: https://photo.stackexchange.com/questions/6111/pixel-to-ra-dec-mapping-in-digitized-astrophotography
Barry Carter
CC BY-SA 4.0
2022-06-13T15:50:40.773Z
I have coorrdinates for every pixel, which Astrometry.net estimate using star locations. But there is no reference coordinates for those pixels. Thanks for the link, I will look into it.
Falco Peregrinus
CC BY-SA 4.0
2022-06-14T16:09:43.780Z
OK, I'm missing something: you have coordinates, but not reference coordinates?
Barry Carter
CC BY-SA 4.0
2022-06-14T22:12:25.820Z
That is true. Astrometry.net gives coordinates interpolated from the coordinates of the stars in the image, therefore for pixels with stars, I have both coordinates, estimated from astrometry and true from catalog. But I don't have reference coordinates for other pixels. And I would like to measure Astrometry.net accuracy of mapping coordinates to the central pixel - center of camera FoV
Falco Peregrinus
CC BY-SA 4.0
2022-06-15T12:10:12.547Z
@barrycarter I assume that by "reference coordinates" Falco means celestial coordinates (right ascension and declination), while "coordinates for every pixel" means pixel coordinates $x,y =$ (column number, row number) on the image.
Peter Erwin
CC BY-SA 4.0
2022-06-15T16:06:40.790Z
@PeterErwin Thanks, Peter, I get it now. I thought astrometry.net also provided some sort of linear transform or formula to convert pixels to ra/dec, but maybe not.
Barry Carter
CC BY-SA 4.0
2022-06-20T13:23:39.460Z
Thanks,@barrycarter and @PeterErwin.By reference coordinates, I mean true celestial coordinates, like the one we have from the catalog of stars, but only for stars. And coordinates that astrometry gives I call predicted. Therefore, for star positions, I have both, true and predicted, and I can calculate mapping accuracy. But for some random position in the image, i.e. center of the image, I don't have true coordinates, only predicted. So I can't exactly measure mapping accuracy, but I can estimate. But the problem is that, if there are no stars in that region, the estimation won't be accurate.
Falco Peregrinus
<coordinate><astrometry>
Celestial coordinates of every pixel in the image
Falco Peregrinus
# Celestial coordinates of every pixel in the image

(Asked by: username_0 on 2022-06-10)

I am solving starfield using Astrometry.net, an amazing piece of software I must say. After solving the starfield, Astrometry gives celestial coordinates of centroids of every star in the image, as well as celestial coordinates of those stars from the catalog. Therefore, it can be easily calculated on sky separation between stars in the image and stars in the catalog which can be used to calculate average solving accuracy. However, I would like to know what is the precision of mapping one particular pixel in the image, where no star can be found. I have its coords from Astrometry.net, but I don't have reference coordinates for that pixel from the catalog. Is it possible to know the position of every pixel from the catalog? Does someone have the same problem/task to solve? How would you calculate the average solving accuracy for some random pixel, or in my case, the accuracy of mapping the central pixel in the image?

**Tags:** coordinate, astrometry
> **Comments:**
> **username_1**: If you need just the accuracy, you could compute coordinates for adjacent pixels and estimate? Here are some long answers re converting pixels to coordinates: https://photo.stackexchange.com/questions/6111/pixel-to-ra-dec-mapping-in-digitized-astrophotography  
> **username_0**: I have coorrdinates for every pixel, which Astrometry.net estimate using star locations. But there is no reference coordinates for those pixels. Thanks for the link, I will look into it.  
> **username_1**: OK, I'm missing something: you have coordinates, but not reference coordinates?  
> **username_0**: That is true. Astrometry.net gives coordinates interpolated from the coordinates of the stars in the image, therefore for pixels with stars, I have both coordinates, estimated from astrometry and true from catalog. But I don't have reference coordinates for other pixels. And I would like to measure Astrometry.net accuracy of mapping coordinates to the central pixel - center of camera FoV  
> **username_2**: @barrycarter I assume that by "reference coordinates" Falco means celestial coordinates (right ascension and declination), while "coordinates for every pixel" means pixel coordinates $x,y =$ (column number, row number) on the image.  
> **username_1**: @PeterErwin Thanks, Peter, I get it now. I thought astrometry.net also provided some sort of linear transform or formula to convert pixels to ra/dec, but maybe not.  
> **username_0**: Thanks,@barrycarter and @PeterErwin.By reference coordinates, I mean true celestial coordinates, like the one we have from the catalog of stars, but only for stars. And coordinates that astrometry gives I call predicted. Therefore, for star positions, I have both, true and predicted, and I can calculate mapping accuracy. But for some random position in the image, i.e. center of the image, I don't have true coordinates, only predicted. So I can't exactly measure mapping accuracy, but I can estimate. But the problem is that, if there are no stars in that region, the estimation won't be accurate.  

---

## 1 answers

### Answer by username_2 on 2022-06-16. Score: 3

What you probably want is the information stored in the WCS header keywords, which are in the wcs.fits table file that astronometry.net generates; it's one of the available downloads on the Results page. (I'm assuming you're using the web interface, but I imagine it's generated by the command-line version of the code, too.)
The relevant keywords that define the "reference pixel" for the image are:
CRPIX1 = image x-coordinate of reference pixel
CRPIX2 = image y-coordinate of reference pixel
CRVAL1 = right ascension in decimal degrees of reference pixel
CRVAL2 = declination in decimal degrees of reference pixel

(Note that in the "Advanced" section of the upload page, you can specify your own desired reference pixel (CRPIX1,CRPIX2) coordinates, in case you want something other than the somewhat arbitrary values that astronmetry.net determines.)
You also need the transformation ("CD") matrix values, which include the effects of both pixel scale and rotation: CD1_1, CD1_2, CD2_1, CD2_2 .
In principle, to compute the celestial coordinates of any pixel $(x,y)$, you would do
RA = CRVAL1 + delta_RA
Dec = CRVAL2 + delta_Dec

where the offset values are computed as
delta_RA = CD1_1 * (x - CRPIX1) + CD1_2 * (y - CRPIX2)
delta_Dec = CD2_1 * (x - CRPIX1) + CD2_2 * (y - CRPIX2)

This is the basic version of WCS computation; higher-order terms can provide better accuracy, especially over a wide field of view. I think astrometry.net includes "SIP distortions" keywords in wcs.fits, which will improve the accuracy, but I'm not familiar with the associated computations. If you really want the extra accuracy, it's probably best to use something like the WCS code in astropy.
To estimate the accuracy, the thing to do would probably to use the pixel coordinates of the stars with known "reference" coordinates (i.e., true RA,Dec) to compute predicted RA,Dec using the WCS parameters, and compare the predicted values to the known values.

> **Comments:**
> **username_0**: Thank you for your thorough answer, it is a great sum up. Meanwhile, all the steps you mentioned, I am already doing. I familiarize myself with Astrometry.net output, .wcs solution, as well as with .corr file. Maybe I should be using different terminology, my question would be more clear. Anyway, by reference coordinates, I mean true RADec, and those coords can be obtained from the catalog(or index files), but only for the stars. Using the Astrometry .wcs file, and astropy's all_pix2world() function, I can convert any pixel position to a celestial coordinate. Or using CD__ as you described.  
> **username_0**: My procedure for estimating solving accuracy is the same as you describe. Once I get from astrometry predicted celestial coords, I can calculate the separation(great circle distance) between that estimated coordinate of a star and the true coordinate(from the catalog, or index file). If I do that for all the detected stars, I can get the average distance between the true and predicted coordinates. And that is fine for now.  
> **username_0**: But, what if my starfield only contains stars in one part of the image, but I need coordinates for the whole image? Astrometry would still provide celestial coords for all pixels, but the problem is that for the pixels where are no stars, we don't have true coordinates. And mapping on those pixels could be terrible(extrapolation problem). And then, how to estimate mapping accuracy for those pixels, where we don't have stars(true coordinates)?  
> **username_2**: The best you can really do is assume the mean accuracy for the stellar coordinates applies to the whole image. (If you have lots of stars, you could try making maps of the 2D variation in the accuracy -- maybe one side of the image has larger errors in RA than the other -- but that's probably overkill.)  

---

