Reading Level 1 Data in IDL¶ If you downloaded your IRIS FITS files using the method in the previous section IRIS FITS files can be read into memory of your current IDL session using the simple command.
I have a problem reading data from a fits file. Usually i can read data from a fits file just fine but now I have some data files which gives me some problems.When I try to read the file, which should contain three columns and a header, all i get is a table of numbers looking something like this:
[[ 64 195 45 ..., 0 0 0]]
Now this is integers and the data file really should contain three columns containing double and floats in three columns like this:
[9819.3801, 0.00000, 0.00000 ]
[9820.0025, 5.50764e-16, 1.62396e-16 ]
[820.6248, -3.75781e-17, 1.51864e-16]
I know that I should get these values because a package in IDL called mrdfits can be used to retrieve the values. I have tried looking into which data type the fits file contain and which formats, my code looks something like this:
My question is basically; is there another way I can read in the data so that it gives me the three columns of non-integer data? I am wondering if it is because the file is a BINTABLE that it is read in a different way than normally? Is there another way I can load the three columns than what I do at the moment?If you need me to clarify some points please ask, as I have tried out a number of things at the moment I am not sure which direction to take it.Any help would be much appreciated!
Matlab Fits Files
1 Answer
Once you have PyFITS downloaded, you are ready to go! To use PyFITS and obtain the information form the FITS file, here is a small example that uses three columns.
Now the above example has three columns, with headers J,H,K
. You can now call them by saying J,H,K
respectively.
What you are doing in your code is that you are printing f.info
which will only give you the information of the headers and other stuff of your FITS file. It will not print the columns and the information.