Problem in solving image

53 views
Skip to first unread message

Gaetano Zarcone

unread,
Nov 15, 2022, 12:26:30 PM11/15/22
to astrometry
Hi,

I have some problems in solving image.
I start from a raw image (in particular it is a .cr2 file) and after a demosaicing procedure I obtain a png file. Then, I'd like to solve this png but my astrometry local version is not able to solve it.

This is my solve-field command line in a python script

'solve-field --dir ' + output_dir + ' --no-plots --new-fits ' + solved_file + ' --match none --crpix-center --rdls none --index-xyls none --overwrite --downsample 2 --tweak-order 3 --scale-low 0.1 --scale-high 180.0 --scale-units degwidth ' + input_file

where
output_dir is the output directory
solved_file is the filename of the solved image
input_file is the input image

The issue is that astrometry is able to solve the same image but in a jpg format (converted directly by the digital camera).
My questions are:
- does astrometry work with a .cr2 file?
- does astrometry work with a .tiff file?
I'd like to share my image, so maybe someone could work on it, but its size is 45Mb (too large).
How can I do?

Thanks

Dustin Lang

unread,
Nov 15, 2022, 1:24:20 PM11/15/22
to Gaetano Zarcone, astrometry
Hi,

solve-field is supposed to be able to handle (some kinds of) RAW images.  It uses the "dcraw" program to do that.  It should also be able to handle (some kinds of) TIFF files, using tifftopnm from netpbm.
Are you getting some error messages or anything from the raw/tiff version?  Or just failing to get a solution?  If it's failing to get a solution, that's likely due to something happening with source detection, ie, something's messed up in the image.  The plots should be helpful here; try --plot-scale 0.5 or --plot-scale 0.25 if they're too large.

cheers,
dustin

--
You received this message because you are subscribed to the Google Groups "astrometry" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astrometry+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/astrometry/CAGm%2BbRWCb9VGp8t%3DKC%3DTYqev%3DVRjntj9_%3DCw5p0fBPGAAcC1ug%40mail.gmail.com.

Bryan

unread,
Nov 15, 2022, 6:15:26 PM11/15/22
to astrometry
FYI

I have no problem solving CR2 files (20 MB) from a Canon 6D in a local version of astrometry.net.  I also can solve TIF files.  If I get a PNG file, for example from SharpCap, I convert it to JPG for solving.

What happens if you use a program, e.g. Canon Utilities or Irfanview, to make a smaller image as a TIF and try solving.

Do you have a DropBox account or other cloud-based server on which to put the 45MB file?

Bryan

Gaetano Zarcone

unread,
Nov 16, 2022, 11:54:32 AM11/16/22
to Dustin Lang, astrometry
Hi Dustin,


Are you getting some error messages or anything from the raw/tiff version?  Or just failing to get a solution? 

no error or anything else. It's just a fail to get a solution.
 
If it's failing to get a solution, that's likely due to something happening with source detection, ie, something's messed up in the image.  The plots should be helpful here; try --plot-scale 0.5 or --plot-scale 0.25 if they're too large.

Ok, I'll try it.

Cheers

Gaetano Zarcone

unread,
Nov 16, 2022, 11:59:14 AM11/16/22
to Bryan, astrometry
Hi Bryan

I tried to solve a cr2 file with my local version of astrometry but it doesn't work.
Could you check my solve-field command line in the previous email? Maybe I'm not considering some options

What happens if you use a program, e.g. Canon Utilities or Irfanview, to make a smaller image as a TIF and try solving.

I don't know, I'll try it.
 
Do you have a DropBox account or other cloud-based server on which to put the 45MB file?

I could share you this image (both cr2 and png format) using wetransfer but i need your email. Can I use this bcas...@gmail.com??

Thanks

Bryan

unread,
Nov 24, 2022, 2:39:09 PM11/24/22
to astrometry
I have investigated my use of Canon CR2 files in astrometry.net.  I have found a subtlety that I did not realize.  The bottom line is that I DO NOT solve CR2 files, but JPG files instead.

I use BackyardEOS and Astrotortilla (a GUI front-end to astrometry.net).  It turns out that when you ask Astrotortilla to capture an image in BackyardEOS and then solve it, it calls for a JPG file, EVEN if I have BackyardEOS set to RAW only.  This is via a sub-function of BackyardEOS called Preview.

I apologize for my misinformation.  You could try Canon Utilities or Irfanview to make generate a JPG file form the RAW file and solve the JPG.  I believe that both use dcraw, as Dustin mentioned, to generate the JPG.

You will likely have to use a different set of index files for your wide field.   See  Getting Index files in https://astrometry.net/doc/readme.html

Bryan

Gaetano Zarcone

unread,
Nov 30, 2022, 7:53:47 AM11/30/22
to Bryan, astrometry
Hi Bryan,
thanks for your answer.
I hoped for a moment that you were able to solve cr2 file directly😅
Anyway, thanks for your suggestion.

Now I have another question.
Which is the difference between the all_pix2world routine and the wcs-xy2rd one for the conversion of pixel coordinates in ra dec?

Cheers
Gaetano

--
You received this message because you are subscribed to the Google Groups "astrometry" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astrometry+...@googlegroups.com.

Bryan

unread,
Nov 30, 2022, 12:34:45 PM11/30/22
to astrometry
Gaetano

I will have to defer to Dustin on this question. Sorry!


Bryan

On Wednesday, November 30, 2022 at 5:53:47 AM UTC-7

Dustin Lang

unread,
Nov 30, 2022, 12:41:49 PM11/30/22
to Bryan, astrometry
Raw files are supposed to work.  I haven't tested them in a long time, but it just uses the "dcraw" program to identify and decode raw images, so if "dcraw" understands your CR2 files, it should work.


--
You received this message because you are subscribed to the Google Groups "astrometry" group.
To unsubscribe from this group and stop receiving emails from it, send an email to astrometry+...@googlegroups.com.

Bryan

unread,
Dec 1, 2022, 12:00:03 AM12/1/22
to astrometry
Dustin

Is dcraw called within astrometry when the file type is CR2?  Are there added parameters to solve-field that I need?

When I run a solve-field on a CR2 file, it appears that it thinks the file is a TIFF and doesn't like it, which is not a surprise since its a CR2.



Bryan

Dustin Lang

unread,
Dec 1, 2022, 11:07:05 AM12/1/22
to Bryan, astrometry
Hi Bryan,

Looking in the code, it looks like that is the expected behavior - "file" identifies the image as TIFF, but then it's supposed to run "dcraw" on it.

cheers,
dustin

Reply all
Reply to author
Forward
0 new messages