IDL and FITSIO library [message #6978] |
Thu, 05 September 1996 00:00 |
Jeffrey Newmark
Messages: 8 Registered: April 1996
|
Junior Member |
|
|
Hi,
I am using the CFITSIO library to read FITS binary tables. I am
linkimage'ing this into IDL and therefore am taking advantage of
the IDL internals. Below is a fragment of my code where the "***" is
the offending line. The column data I want to read is of type long.
In the RSI Advanced Development Guide it recommends the use of
IDL_TYP_LONG for machine independence of long type, i.e. so long
is 32-bits always whereas on 64-bit machines C uses long as 64-bits.
Therein lies my problem, at least I think. When I compile the code I
do get a compiler WARNING of incompatible pointer types for the input of
the CFITSIO routine ffgcvj (fits_read_col_lng). When I run this to read
the data into pointer pix it blows up with a segmentation violation. I
believe the memory address is not large enough but what why?
I tried using "long" instead of "IDL_LONG" but that didn't seem to
work any better. Has anyone else tried this sought of thing before?
Are there any C/IDL gurus out there who can recognize quickly my
mistake????
thanks in advance,
Jeff Newmark
IDL_VARIABLE *dirbe_aaf(argc,argv,argk)
int argc;
IDL_VARIABLE *argv[];
char *argk;
{
IDL_LONG *pix,*srecs,dim[2],inull,frow,nelmt,index;
fitsfile *iunit;
pix = (IDL_LONG *) IDL_MakeTempArray(IDL_TYP_LONG,1,dim,
IDL_BARR_INI_ZERO,&ret_dat[numargs]);
ffgcvj(iunit,colnum,frow,felem,dim[0],inull,pix,&anyflg, &status); ***
IDL_VarCopy(ret_dat[numargs],argv[numargs+2]);
}
------------------------------------------------------------ ------
Dr. Jeffrey Newmark
SOHO - EIT Team Scientist
voice: (301) 286-3163 Code 682.3
email: newmark@eitv2.nascom.nasa.gov GSFC/NASA
newmark@gsfc.nasa.gov Greenblet, MD 20771
Hi,
I am using the CFITSIO library to read FITS binary tables. I am
linkimage'ing this into IDL and therefore am taking advantage of
the IDL internals. Below is a fragment of my code where the "***" is
the offending line. The column data I want to read is of type long.
In the RSI Advanced Development Guide it recommends the use of
IDL_TYP_LONG for machine independence of long type, i.e. so long
is 32-bits always whereas on 64-bit machines C uses long as 64-bits.
Therein lies my problem, at least I think. When I compile the code I
do get a compiler WARNING of incompatible pointer types for the input of
the CFITSIO routine ffgcvj (fits_read_col_lng). When I run this to read
the data into pointer pix it blows up with a segmentation violation. I
believe the memory address is not large enough but what why?
I tried using "long" instead of "IDL_LONG" but that didn't seem to
work any better. Has anyone else tried this sought of thing before?
Are there any C/IDL gurus out there who can recognize quickly my
mistake????
thanks in advance,
Jeff Newmark
IDL_VARIABLE *dirbe_aaf(argc,argv,argk)
int argc;
IDL_VARIABLE *argv[];
char *argk;
{
IDL_LONG *pix,*srecs,dim[2],inull,frow,nelmt,index;
fitsfile *iunit;
pix = (IDL_LONG *) IDL_MakeTempArray(IDL_TYP_LONG,1,dim,
IDL_BARR_INI_ZERO,&ret_dat[numargs]);
ffgcvj(iunit,colnum,frow,felem,dim[0],inull,pix,&anyflg, &status); ***
IDL_VarCopy(ret_dat[numargs],argv[numargs+2]);
}
------------------------------------------------------------ ------
Dr. Jeffrey Newmark
SOHO - EIT Team Scientist
voice: (301) 286-3163 Code 682.3
email: newmark@eitv2.nascom.nasa.gov GSFC/NASA
newmark@gsfc.nasa.gov Greenblet, MD 20771
-
Attachment: help.let
(Size: 1.73KB, Downloaded 61 times)
|
|
|