Page 1 of 1
Convert .txt to .dat
Posted: Tue Jul 07, 2020 4:03 am
by Peter Velez
Another question for the more experienced users...
How do I convert a .txt file to .dat or .fit?
I downloaded a spectrum from the TNS website prepared by professional astronomers. Its in .txt format. I'd like to compare it to my own data for the same target. If I can convert it to a .dat file, I can then display it in ISIS and compare them. And I can also change it to a .fit file and run it through PlotSpectra.
Is there an easy way to do this? Bear in mind I am not tech savvy and should never be let loose near Excel so plotting is a challenge for me
Pete
Re: Convert .txt to .dat
Posted: Tue Jul 07, 2020 8:21 am
by David Boyd
Open the text file in Notepad and select "Save as" from the "File" menu. In the File name box at the bottom of the window add ".dat" after the file name and press Save.
David
Re: Convert .txt to .dat
Posted: Tue Jul 07, 2020 12:08 pm
by Peter Velez
Thanks David
for some reason that didn't work for me. I was able to save it as a .dat file but ISIS wouldn't recognise it.
Pete
Re: Convert .txt to .dat
Posted: Tue Jul 07, 2020 2:27 pm
by David Boyd
That's curious.
I just downloaded the file tns_2020nvb_2020-07-01.91_LT_SPRAT.txt from TNS and converted it to .dat as I described and then to .fit with ISIS and was able to display it correctly in ISIS.
Had you set the working directory in ISIS correctly?
David
Re: Convert .txt to .dat
Posted: Tue Jul 07, 2020 7:57 pm
by Benjamin Mauclaire
Hi Pete,
There is a dedicated function in Spcaudace for that: just type spc_dat2fits tns_2020nvb_2020-07-01.91_LT_SPRAT.txt
Txt is similar to dat format. These formats are very poor format for astronomy as they don't carry any observationnal information. It should be avoided for storing data.
Benji
Re: Convert .txt to .dat
Posted: Wed Jul 08, 2020 5:27 am
by Peter Velez
Mystery solved
ISIS was looking for a file ending in "-1". Once I added that, I was able to convert the .dat to .fit.
Thanks for the assistance
Pete
Re: Convert .txt to .dat
Posted: Wed Jul 08, 2020 8:47 am
by David Boyd
In the Tools menu of ISIS there is a sub-menu Spectra 3 which contains a function for converting .dat files to .fit files (and vice versa) with no need for the -1 suffix.
There are lots of other useful functions in the ISIS menu structure so it's worth exploring.
David
Re: Convert .txt to .dat
Posted: Thu Jul 30, 2020 3:59 pm
by Benjamin Mauclaire
Hi David,
Your profile let me think you were an Iraf user

Once more my post was just to give a way out to Peter who are in trouble.
I don't understand why you add a note in this thread about the amount of other fucntions in Isis.
Best regards,
Benji