|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
reading a single value
Hi,
Would this be the right way to read a single value from a fits file? (I add [x:x,y:y,z:z] to the filename and then read one float). Nico -- sprintf(filter,"%s[%d:%d,%d:%d,%d:%d]",this-filename,point[X],point[X],point[Y],point[Y],point[Z],point[Z]); if (!fits_open_file(&fptr, filter, READONLY, &status)) { fits_read_img(fptr,TFLOAT,1,1,0,buffer,0,&status); } // if ================================================== == Nico Vermaas ASTRON - Westerbork Radio Observatory The Netherlands ================================================== == |
#2
|
|||
|
|||
[fitsbits] reading a single value
Nico Vermaas wrote:
Would this be the right way to read a single value from a fits file? (I add [x:x,y:y,z:z] to the filename and then read one float). -- sprintf(filter,"%s[%d:%d,%d:%d,%d:%d]",this-filename,point[X],point[X],point[Y],point[Y],point[Z],point[Z]); if (!fits_open_file(&fptr, filter, READONLY, &status)) { fits_read_img(fptr,TFLOAT,1,1,0,buffer,0,&status); } // if Note that it would be better to send questions that are specific to CFITSIO directly to me at the HEASARC, rather than posting them to this newsgroup. To answer your question though, the above method of reading a single pixel in an image will work, but it is rather unorthodox. (Also, the 7th parameter in the fits_read_img call must be a pointer to an int, not 0). The more direct way would be to first open the image (without any image section filters) then: long fpixel[3]; fpixel[0]=point[X]; fpixel[1]=point[Y]; fpixel[2]=point[Z]; fits_read_pix(fptr,TFLOAT,fpixel,1,0,buffer,&anynu l,&status); -Bill Pence -- __________________________________________________ __________________ Dr. William Pence William.D.Pence @ nasa.gov NASA/GSFC Code 662 HEASARC +1-301-286-4599 (voice) Greenbelt MD 20771 +1-301-286-1684 (fax) |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ASTRONOMERS MEASURE MASS OF A SINGLE STAR -- FIRST SINCE THE SUN (STScI-PR04-24) | INBOX ASTRONOMY: NEWS ALERT | Astronomy Misc | 0 | July 15th 04 03:08 PM |
FAQ-2-B: sci.space.tech reading list | dave schneider | Technology | 11 | June 10th 04 03:54 AM |
multiple launch moon mission vs. Single Launch moon missions | Fred K. | Policy | 2 | March 20th 04 02:29 PM |
Single stage to orbit, Atlas | Jan Philips | History | 79 | October 14th 03 07:05 AM |