problems with libimfort.a #252
-
Hi All, Some 20 years ago, I was able to write Fortran codes using IRAF libraries and PGPLOT libraries to read in a FITS image and make a finding chart. Years later, I can still deal with the PGPLOT libraries. However, I am having trouble with the IRAF libraries for 2.17. Excluding the PGPLOT libraries, here is the compile command: gfortran -o plotPSR plotPSR.for libimfort.a libsys.a libvops.a libos.a libf2c.a The code compiles just find. However, the code won't run properly. First of all, it won't accept the ".fits" extension for the images. I used IRAF and made a copy in ".imh" format. The code was able to find the image, and apparently open it. However, I don't think the image was read correctly. Here is the first part of the code (which ran some 20 years ago): real rpix(2048),rbright(2048,2048),sfred
real trans(6),xline(2),yline(2)
integer*2 spix(4096),ofred,sbright(2048,2048)
equivalence (rpix, spix)
character*80 oimage, nimage, errmsg
integer ncols, nlines, nbands, j, k, oim, nim
integer ier, axlen(7), naxis, pixtype, nargs, maxp
DATA TRANS/0.,1.,0.,0.,0.,1./
maxp=2048
oimage="WFIcuts"
call imopen (oimage, 1, oim, ier) ! open the image
if (ier .ne. 0) goto 91
call imgsiz (oim, axlen, naxis, pixtype, ier) !! --- Determine the size and pixel type of the image being copied.
if (ier .ne. 0) goto 91
ncols = axlen(1)
nlines = axlen(2)
nbands = axlen(3)
write(*,*)ncols,nlines,nbands,pixtype The screen output is:
That second number should be 251 and not zero (that is the image size is 251 by 251). The rest of the code does not work properly since the image data is not properly loaded. Does anyone have any experience with the libimfort libraries with IRAF 2.17? Thanks, Jerry |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
What changed in the last 20 years is the port of IRAF to 64 bit. This port is limited to the ILP64 memory model which means that integer are 64 bit by default. This requires a special setting for the Fortran compilation, since the default model is to have 32-bit integers. In IRAF itself this is done by a modified f2c program; however if you use an external compiler (gfortran), you should make sure that you choose the correct memory model. Could this the reason for the problem? From the code history of For a more modern programmatic approach to observation planning, it may be worth trying out astroplan, which is an Astropy affiliated Python package specifically designed for that. |
Beta Was this translation helpful? Give feedback.
What changed in the last 20 years is the port of IRAF to 64 bit. This port is limited to the ILP64 memory model which means that integer are 64 bit by default. This requires a special setting for the Fortran compilation, since the default model is to have 32-bit integers. In IRAF itself this is done by a modified f2c program; however if you use an external compiler (gfortran), you should make sure that you choose the correct memory model.
Could this the reason for the problem?
From the code history of
imopnx.x
I would guess that imopen() never supported FITS files; however I may be wrong here.For a more modern programmatic approach to observation planning, it may be worth trying out astr…