comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » IDL and FITSIO library
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
IDL and FITSIO library [message #6978] Thu, 05 September 1996 00:00
Jeffrey Newmark is currently offline  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)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: CALL_EXT with SunOS
Next Topic: problem on the TRIGRID in IDL

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 14:19:34 PDT 2025

Total time taken to generate the page: 1.68108 seconds