I'm writing an Android UI for astap_cli. I can run astap_cli fine, but I'm
having a trouble converting RA/Dec values to the pixel coordinates on the
original image. Below is the math I'm using:
Given (ra, dec):
# 2*2 matrix for converting pixel -> (ra,dec)
M = [ CD1_1, CD1_2
CD2_1, CD2_2 ]
# Compute the inverse of M
det = 1 / (CD1_1*CD2_2 - CD1_2*CD2_1)
Mi = [ CD2_2 * det, -CD1_2 * det,
-CD2_1 * det, CD1_1 * det ]
# relative (ra, dec) in vector form
V = [ ra - CRVAL1, dec - CRVAL2 ]
P = Mi * V return (P[0] + CRPIX1, P[1] * CRPIX2)
The values CD, CR are extracted from *.ini files.
I notice that, for many images, the pixel coords are off by ~10%. That is, the P
values are about ~10% larger that what they should be based on my visual
inspection. But some images compute the coordinates perfectly. Can someone spot
what I'm doing wrong?
You need formula 5) . Formula 6) is for the reverse. I think the error is due to the declination. In your first example the declination is much higher.
It is likely the formulas are mutilated in this forum. Have a look to the original document.
Thanks so much. I got it to mostly work. The remaining issue is that I need to multiply the values of (x-CRPIX1, y-CRPIX2) by 57.5 to achieve a proper alignment. I came up with 57.5 by trial and error, and it seems to hold for many images I tried.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to do the same thing, but am a very long way behind in terms of learning all elements of this process. My use case is to enable the use of an embedded Android App in a Sony Alpha A7 camera, so that I can take a photo, and have it report back the actual co-ordinates, to determine how much to adjust by tripod head, then to run an intervalometer to take photo's of the desired location to stack later.
At this stage, I have just modified an existing Alpha A7 demo app of an Intervalometer to be able to make changes, and am currently seeking information on how to embed the ASTAP_CLI into the project. If you have any interest in collaborators in your project, I'd be happy to assist (Although I am very early in my learning curve of Android development).
Warm regards,
Ian.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you can make something work, that would be nice. I have tried here but the problem with smart phone cameras is that in almost all cases they are not sensitive enough to collect images with enough stars. (ASTAP 30 stars, Astrometry.net maybe 5 stars) I tried here with a S10 phone. You will need about 30 stars to make it work. An other problem is distortion of the image. So first thing to test is to take solvable sky images with an Android camera. Maybe an extra lens will help.
Regards, Han
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm writing an Android UI for astap_cli. I can run astap_cli fine, but I'm
having a trouble converting RA/Dec values to the pixel coordinates on the
original image. Below is the math I'm using:
Given (ra, dec):
The values CD, CR are extracted from *.ini files.
I notice that, for many images, the pixel coords are off by ~10%. That is, the P
values are about ~10% larger that what they should be based on my visual
inspection. But some images compute the coordinates perfectly. Can someone spot
what I'm doing wrong?
An example of an image that resolves wrong:
An example of an image that resolves OK:
Hello Yasushi ,
Writing Android UI, that is good news! Android is not something I'm not familliar with so i'm glad to leave it to somebody else.
The conversion goes a little different. I'm using the formulas from Alian Klotz which he nicely documented. I local copy is here (in French):
https://sourceforge.net/projects/astap-program/files/some%20documentation%20and%20info/Methode%20de%20calibration%20astrometrique.html/download
You need formula 5) . Formula 6) is for the reverse. I think the error is due to the declination. In your first example the declination is much higher.
It is likely the formulas are mutilated in this forum. Have a look to the original document.
Han
Last edit: han.k 2022-05-29
This forum removes the multiply stars. I have corrected it now in my above post.
Thanks so much. I got it to mostly work. The remaining issue is that I need to multiply the values of (x-CRPIX1, y-CRPIX2) by 57.5 to achieve a proper alignment. I came up with 57.5 by trial and error, and it seems to hold for many images I tried.
180/pi=57.295779513 ?
What kind of use are you developing?
Hello. I just found this thread.
I am trying to do the same thing, but am a very long way behind in terms of learning all elements of this process. My use case is to enable the use of an embedded Android App in a Sony Alpha A7 camera, so that I can take a photo, and have it report back the actual co-ordinates, to determine how much to adjust by tripod head, then to run an intervalometer to take photo's of the desired location to stack later.
At this stage, I have just modified an existing Alpha A7 demo app of an Intervalometer to be able to make changes, and am currently seeking information on how to embed the ASTAP_CLI into the project. If you have any interest in collaborators in your project, I'd be happy to assist (Although I am very early in my learning curve of Android development).
Warm regards,
Ian.
Hello Ian,
If you can make something work, that would be nice. I have tried here but the problem with smart phone cameras is that in almost all cases they are not sensitive enough to collect images with enough stars. (ASTAP 30 stars, Astrometry.net maybe 5 stars) I tried here with a S10 phone. You will need about 30 stars to make it work. An other problem is distortion of the image. So first thing to test is to take solvable sky images with an Android camera. Maybe an extra lens will help.
Regards, Han
Use the W08 database for wide field images.
Last edit: han.k 2022-06-06