0

I'm trying to use the READFITS() function on IDL 8.3 on Mac 10.9.3

My input on the IDL promt:

readfits('image.fits',h, /EXTEN, /SILENT)

Result:

readfits('image.fits',h, /EXTEN, /SILENT)
                          ^
% Syntax error.

*note: the '^' is below '/EXTEN'

Maybe it will help, so here is a link to the IDL help page on using READFITS() --> http://www.exelisvis.com/docs/readfits.html

I tried using the brackets like they show on that help page, but it still didn't work, so I'm stuck now. Didn't know if anyone here has experience reading .fits files in IDL.

randers
  • 5,031
  • 5
  • 37
  • 64
deedsy
  • 57
  • 2
  • 11

2 Answers2

1

ok, so it turns out the readfits procedure isn't included in IDL's original library, so I just had to download AstroLib (contains lots of useful astronomy procedures - including Readfits). The original syntax then worked.

deedsy
  • 57
  • 2
  • 11
0

I'm using IDL 8.2.2 on OS X 10.9.4.

Try keeping it simple first. Do these work?

readfits('image.fits')
readfits('image.fits', header)

Next try this:

readfits('image.fits', header, EXTEN_NO=0)

I suspect you really want extension number 0, not 1. See (e.g.) http://www.stsci.edu/documents/dhb/web/c02_datafiles.fm2.html.

koma
  • 1
  • 1
  • 1
  • well, only including the image name and ',header' worked. But putting in any extension number caused the syntax error. I tried not putting in any extension, but keeping '/SILENT', and the syntax error just pointed to '/SILENT' then. – deedsy Jul 10 '14 at 16:26
  • Ah yes, I was assuming you had AstroLib installed. – koma Jul 10 '14 at 20:05