LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unreadable FITS images

I tried to handle FITS images with the plug-in gfitsio but the image produced by the example.vi 'does appear to be a FITS image' according to ImageJ.

Does anyone already had this problem ?

Thank you for your help.

0 Kudos
Message 1 of 4
(1,094 Views)

If you can, post what you have.

 

Both the image as the code, and some links maybe, would help us help you.

0 Kudos
Message 2 of 4
(1,032 Views)

Hello,

Thanks for looking at my problem.

Here are the elements.

I modified example.vi (giving in gfitsio library) to read a working image (example_GS12.fits created by ImageJ and that can be opened by imageJ) and to write a new one (example_GS12_2.fits that cn not be opened by ImageJ)

I tried to open the second image with python (astropy) and I can access the data but I got a strange structure (I am guessing the problem comes from that ..).

Any though will be welcome.

Cedric

 

hdu_list = fits.open('E:\Temp\gfitsio\example_GS16_2.fits')
hdu_list.info()

Filename: E:\Temp\gfitsio\example_GS16_3.fits
No.    Name      Ver    Type      Cards   Dimensions   Format
  0  PRIMARY       1 PrimaryHDU       6   ()      
  1                1 ImageHDU        10   (298, 280)   int16 (rescales to uint16)   

image_data = hdu_list[1].data

 
 
<type 'numpy.ndarray'>
(280L, 298L)

plt.imshow(image_data, cmap='gray')
plt.colorbar()

 

 

cray1903_0-1600078253495.png

cray1903_2-1600078325398.png

 

 

 

0 Kudos
Message 3 of 4
(1,026 Views)

I have all kinds of problems running that code. For starters, I have 64 bit LabVIEW, and the library is for 32 bit...

 

Examining those image files in notepad does show that they are quite different. It seems your file is opened, and then added to. There seem to be two headers? I don't know anything about those image files. Should it be possible to have more than one image in a file?

 

I'd try to first create a new image (e.g. delete the old file, don't use open or create, but create). The first image I'd try to make would have the same data type as the original image. In other words, try to get something working, than try to move towards the goal one small step at the time...

0 Kudos
Message 4 of 4
(1,021 Views)