Hello all,
At the moment I am busy making a program to model line (Hα) profiles....
Can anybody tell me how to read a 1D fit(s) file in VB?
Now I am using the .dat files generated by ISIS, but it would be nice to be able to read the .fit.
Regards Arnold
reading 1D fits files
-
- Posts: 6
- Joined: Thu Aug 25, 2016 2:28 pm
- Location: Bussum
-
- Posts: 168
- Joined: Fri Apr 04, 2014 6:31 pm
- Location: Arnprior Ontario
Re: reading 1D fits files
This NASA documentation will help. It is what I used to write my c# routine for reading 1D fit files in PlotSpectra.
https://fits.gsfc.nasa.gov/fits_primer.html
When it comes to reading the data block I found I had to reverse the byte order to get sensible numbers out.
Here is a link to the source code for my routine. It may help even if you are not familiar with c#.
https://1drv.ms/t/s!AvXqhKI5kEGRjEfjmBdgpWx8yX86
Tim
https://fits.gsfc.nasa.gov/fits_primer.html
When it comes to reading the data block I found I had to reverse the byte order to get sensible numbers out.
Here is a link to the source code for my routine. It may help even if you are not familiar with c#.
https://1drv.ms/t/s!AvXqhKI5kEGRjEfjmBdgpWx8yX86
Tim
-
- Posts: 6
- Joined: Thu Aug 25, 2016 2:28 pm
- Location: Bussum
Re: reading 1D fits files
Great Tim!
Much appreciated
and thanks for sharing your code. Although I will be using vb, this will certainly help!
Btw, in my program I added:
If NAXIS>1 message "not a 1D spectrum" to avoid loading a 2D fits file
Regards Arnold
Much appreciated

Btw, in my program I added:
If NAXIS>1 message "not a 1D spectrum" to avoid loading a 2D fits file

Regards Arnold