Convert .txt to .dat

Design, construction, tuning of spectroscopes
Information and discussion about softwares (telescope remote, autoguiding, acquisition, spectral processing ...)
Post Reply
Peter Velez
Posts: 146
Joined: Tue May 12, 2020 7:36 am

Convert .txt to .dat

Post 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
David Boyd
Posts: 161
Joined: Wed Dec 11, 2013 5:50 pm

Re: Convert .txt to .dat

Post 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
Peter Velez
Posts: 146
Joined: Tue May 12, 2020 7:36 am

Re: Convert .txt to .dat

Post 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
David Boyd
Posts: 161
Joined: Wed Dec 11, 2013 5:50 pm

Re: Convert .txt to .dat

Post 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
Benjamin Mauclaire
Posts: 258
Joined: Thu Sep 29, 2011 10:14 am

Re: Convert .txt to .dat

Post 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
Spcaudace spectroscopy software: saving you hundred hours of frustration.
Peter Velez
Posts: 146
Joined: Tue May 12, 2020 7:36 am

Re: Convert .txt to .dat

Post 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
David Boyd
Posts: 161
Joined: Wed Dec 11, 2013 5:50 pm

Re: Convert .txt to .dat

Post 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
Benjamin Mauclaire
Posts: 258
Joined: Thu Sep 29, 2011 10:14 am

Re: Convert .txt to .dat

Post 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
Spcaudace spectroscopy software: saving you hundred hours of frustration.
Post Reply