View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

Imarith error - is not an image or number

fergusjm wrote on Jun 09, 2015


Hello, while trying to flatten my data I keep running into a problem.

The command I'm running is as follows:

imarith trim_18 / flat_hk_mar28_2015 trim_data_flat_18

However I keep receiving an error:

trim_18 is not an image or a number, I know it is though because I can see it in ds9

I tried it again as

imarith trim_18.fits / flat_hk_mar28_2015.fits trim_data_flat_18.fits

but I get the same error, I changed my imtype in the login.cl file to "fits" but that didn't change anything.

Let me know,

Jason

Mike Fitzpatrick wrote on Jun 09, 2015


Do any other tasks work on this file, e.g. IMHEAD, IMSTAT, etc? If not then there may be something invalid in the FITS file, you can check this online with small files by using

http://fits.gsfc.nasa.gov/fits_verify.html

If it's bigger than the 40MB limit of that site please upload to the anonftp at ftp://iraf.noao.edu/pub. It would also help to know which IRAF version and platform (Mac or Linux) you are using.

A rare problem you may be seeing if you're using a 32-bit IRAF system is that you can't open the file if it is on a 64-bit filesystem.


fergusjm wrote on Jun 09, 2015


Thanks for the reply,

Neither of those commands work on the file imhead produces the following error:

trim_18.fits: FXF: must specify which FITS extenstion (trim_18).

I have a Mac computer but I am running IRAF on xgterm. The file is too large for that website, how do I upload to the anonftp? When I follow that link and sign in I just see a window with a bunch of files and no where to upload anything. When I try to drag and drop from another finder window I just get an error cursor.

Sorry for the all the questions, I'm still an undergrad


Mike Fitzpatrick wrote on Jun 09, 2015


The FITS file is probably fine then, your problem is that you have a Multi-Extension FITS (MEF) file and need to specify the extension explicity, e.g.

cl> imhead trim_18.fits[1] l+

will list the header of the first extension.

For a task like IMARITH you would specify the extension of each image, however you should instead be using the MSCRED package to handle the extensions automatically, e.g.

cl> mscarith trim_18.fits / flat_hk_mar28_2015.fits trim_data_flat_18.fits

will automatically expand the extensions and process each. MSCRED is an external package that must be installed separately.

fergusjm wrote on Jun 09, 2015


I installed the mscred package and tried the command again; this time I get the error:

ERROR: Error in number of extensions

Is it possible that the trim_18.fits has multiple extensions but the flat_hk_mar28_2015.fits only has one extension?

Thanks again

Mike Fitzpatrick wrote on Jun 09, 2015


It's your data, you tell me what's possible. Installing MSCRED should also have installed the FITSUTIL package, you can use the FXHEADER command to print out the structure of each file, e.g.

cl> fitsutil

cl> fxheader trim_18.fits

Depending on your IRAF version you might also be seeing a bug in the new image template code, to work around this do

cl> reset use_new_imt = no

before running the mscarith task. If it works you can make the change permanent in your login.cl file.

Last post on Jun 09, 2015