IMAGEW and IMAGEH

34 views
Skip to first unread message

Max van de Kamp

unread,
May 20, 2025, 9:03:31 AMMay 20
to astrometry
Hello,

I tried to analyse pictures which I have in JPG format. I converted them to FITS format using Gimp, and them could convert them into xy-lists using image2xy.

But then astrometry-engine complains that IMAGEW and IMAGEH are not in the header. Which indeed they are not. I read from other posts here that those are not standard FITS header parts, but have been added by astrometry.

So how do I get IMAGEW and IMAGEH into the header of the FITS files? Should I do the conversion from JPG to FITS using an astrometry tool instead of Gimp?

Thank you
Max van de Kamp
Finnish Meteorological Institute

Dustin Lang

unread,
May 20, 2025, 10:11:59 AMMay 20
to Max van de Kamp, astrometry
Hi,

You can feed JPEG images to the solve-field program directly, maybe that would be easier.

I thought image2xy did put the IMAGEW/IMAGEH into the headers.

Can you please send example commands that you are running, plus the error messages?

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 visit https://groups.google.com/d/msgid/astrometry/a7f12b25-80f2-4fe1-9946-826103b5a798n%40googlegroups.com.

Max van de Kamp

unread,
May 20, 2025, 11:50:08 AMMay 20
to astrometry
If I try to run image2xy on a JPG image, it fails:

~/astrometry.net-0.97$ solver/image2xy /mnt/c/Data/LOUARN/sky_pictures/134489_b9b1b9dc36bf18480623047bd4eb9040.jpg
../util/cfitsutils.h:26:cfitserr: This does not look like a FITS file.
../util/cfitsutils.h:26:cfitserr: /mnt/c/Data/LOUARN/sky_pictures/134489_b9b1b9dc36bf18480623047bd4eb9040.jpg
../util/cfitsutils.h:26:cfitserr: ffopen could not interpret primary array header of file:
../util/cfitsutils.h:26:cfitserr:
../util/cfitsutils.h:26:cfitserr: Extension doesn't start with SIMPLE or XTENSION keyword. (ffrhdu)
../util/cfitsutils.h:26:cfitserr: 1st key not SIMPLE or XTENSION
image2xy-files.c:47:image2xy_files: Failed to open FITS input file /mnt/c/Data/LOUARN/sky_pictures/134489_b9b1b9dc36bf18480623047bd4eb9040.jpg
image2xy-main.c:191:main: image2xy failed.

But on the FITS file that I had made using GIMP, image2xy works without error:

~/astrometry.net-0.97$ solver/image2xy /mnt/c/Data/LOUARN/sky_pictures/134489_b9b1b9dc36bf18480623047bd4eb9040.fits
This looks like a multi-color image: processing the first image plane only.  (NAXIS=3)
simplexy: found 869 sources.

And it produces a file with the extension .xy.fits. But if Í try to run astrometry-engine on that file, I get:

~/astrometry.net-0.97$ solver/astrometry-engine -c etc/astrometry.cfg /mnt/c/Data/LOUARN/sky_pictures/134489_b9b1b9dc36bf18480623047bd4eb9040.xy.fits
Reading file "/mnt/c/Data/LOUARN/sky_pictures/134489_b9b1b9dc36bf18480623047bd4eb9040.xy.fits"...
Must specify positive "IMAGEW" and "IMAGEH".
engine-main.c:341:main: Failed to read job file "/mnt/c/Data/LOUARN/sky_pictures/134489_b9b1b9dc36bf18480623047bd4eb9040.xy.fits"

Dustin Lang

unread,
May 20, 2025, 12:12:47 PMMay 20
to Max van de Kamp, astrometry
Hi,

Is there some reason you don't want to use solve-field?  That's the standard, easy way.

As you say, image2xy only processes FITS images.

Converting JPEG to FITS is easy, and then image2xy can give you a .xy file.

astrometry-engine, however, doesn't take xy files, it takes "augmented" xy files ("axy" files), which are like xy files but have additional header cards that tell astrometry-engine what to do.  Normally, solve-field adds those cards.

cheers,
dustin




Max van de Kamp

unread,
May 20, 2025, 12:45:05 PMMay 20
to astrometry
No I just didn't know which tool to use for what. 

I have no idea which procedure to follow with the code; I didn't find that information anywhere on your website. So I just tried out things. 

OK, so I'd have to use solve-field first? Does that take JPG files or FITS files?

Dustin Lang

unread,
May 20, 2025, 1:02:40 PMMay 20
to Max van de Kamp, astrometry
There's some documentation here,


solve-field can take JPEG or FITS.



Max van de Kamp

unread,
May 21, 2025, 3:06:24 AMMay 21
to astrometry
It works now.
Thank you!
Reply all
Reply to author
Forward
0 new messages