From Friday, January 17th 11 PM CDT (January 18th 5 AM UTC) through Saturday, January 18th 11:30 AM CDT (January 18th 5:30 PM UTC), ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fits format conversion: need help...

Hi,
 
My CCD is saving image as .fits format, a format quite popular among astronomer (I am not an astronomer though).  I believe that it saves as 16 bits unsigned data.
I have to do some array manupulation. I believe that since ccd saves array as binary, I may have to do the following steps:
 
(1) Convert binary array to floating point array.
 
(2) Do the array manupulation for floating point arrays:
C(ij)=A(ij)*B(ij)--> not matrix multiplication, just corresponding element multiplication.
 
(3) Find out C_max, C_min of flaoting point array.
 
(4) Rescale the array C.
 
(5)Storing procedure: Changing header, converting C back to binary arrays.
 
Well, I must say that  I do not know much about header in a particular format and how you can access it and change it etc..?
Also I was curious if I can do the matrix multiplication directly (not the one I have talked about before) without using loops.
 
Thanks,
Dushyant Kumar
0 Kudos
Message 1 of 6
(2,870 Views)
Hello Dushyant,

some answers:

(1) What do you mean by "binary"? You said before it's a u16 array... You can use those u16 values and make your calculation with them (or change them to sgl/dbl, whatever fits your needs).

(2) Labview can do this element by element math. It's standard for arithmetics with arrays. Just wire both arrays (A, B) to a multply node and you're done. (Both arrays should have the same size...)

(3) There's a min/max-node in the array palette.

(4) Same as (2): rescaling is mostly multiplication/adding.

(5) Don't know about FITS format, could not help you on this.



Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,859 Views)
Thanks a lot fot your help.

However, I do not exactly need help regarding  arithmetic. I would be fine with that. I put the details of arithmetic just to make everything explained clearly.
However, I do not have any idea of how to handle fits format and its header (I never dealt with formatting before).
I really appreciate your sincere efforts of helping me.
I believe that some astronomer may be able to help me as "fits" is quite popular in astronomy.
DK

0 Kudos
Message 3 of 6
(2,850 Views)
As of now, I have not been able to sort out the way to read the fits file in labview and save the manupulated array back as fits image. So, any help regarding that would be appreciated..

Thanks,
Dushyant
0 Kudos
Message 4 of 6
(2,824 Views)
Not sure if you've seen this page or not.  But it looks like it might have some good info and tools for you.

http://fits.gsfc.nasa.gov/fits_viewer.html

---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 5 of 6
(2,823 Views)
Thanks for providing me link.

It seems to me that for data-analysis I should prefer not to use labview. I will use IDL for analysis and I believe that there is some labview nodes for running IDL script. I would have to look for that info.

Thanks again,
DK
0 Kudos
Message 6 of 6
(2,818 Views)