Welcome to iraf.net Saturday, April 20 2024 @ 11:57 AM GMT


 Forum Index > Help Desk > Applications New Topic Post Reply
 Multi-order text file to fits file for splot
   
aturby
 07/27/2014 01:23AM (Read 2290 times)  
+----
Newbie

Status: offline


Registered: 12/17/2013
Posts: 3
Hi! I am unfamiliar with manipulating fits files in IRAF, and was hoping someone could suggest a method that could be used to convert a simple, but very large, 3-column text file to a multi-order fits file that will be analysed in splot.

The text file is made up of echelle data, and has the form:
order number | wavelength | flux value
and is about 3 MB in size.

I could split the text file into multiple smaller files, and convert each individually into a fits file using rspectext, but I am thinking there must a much simpler way, that would not require many separate fits files that will be analyzed ultimately in splot. Rather, the hope is a method to turn this text file into a fits file that the user can use some key, (e.g. ( and ), or %) to switch to other orders within the same spectra.

Thank you in advance for any help or advice!

 
Profile Email
 Quote
valdes
 08/01/2014 04:16PM  
+++++
Active Member

Status: offline


Registered: 11/11/2005
Posts: 728
Unfortunately the answer is mostly no. The only current way to go from a text file to an IRAF spectral fits file is through rspectext. We are working on tools that directly read spectral text tables but even those do not expect multiple spectra (i.e. orders) to be in the same column. I would comment that this format is not totally crazy and maybe we should allow it in the new version. The only other thing to add is that once you have separate files for each order it is possible, I believe, to merge them into a single multispec file with, I think, scopy so that you don't need to keep lots of files in your splot review and analysis.

Would you might telling me how this file came to be and is this something some instrument or observatory is likely to produce frequently?

Yours,
Frank Valdes

 
Profile Email
 Quote
valdes
 08/01/2014 04:19PM  
+++++
Active Member

Status: offline


Registered: 11/11/2005
Posts: 728
I just thought of another comment. While if you are proficient with a text editor and don't have a lot of these echelle files it might be just as fast to separate the orders that way, the nttool package that can operate on tabular text files and has various database-like tools could be used and even a script written (for the more advanced user). If this seems useful I could point you to the tools which you would want to use.

Frank Valdes

 
Profile Email
 Quote
aturby
 08/07/2014 12:06PM  
+----
Newbie

Status: offline


Registered: 12/17/2013
Posts: 3
Thank you very much, I can definitely implement this advice!

I have tried something similar, but I had a few issues using scopy. Initially, I split the entire spectra into the largest files that could be used for rspectext, which ended up producing 18 files with about 5000 data points each. I have also split the files into smaller sets, each containing a single order, and there are 43 files for each objects using this method. However, when I tried to combine all of the 43 fits files into one multispec file, using scopy, I had similar issues to those I encountered with rspectext-- essentially, I run out of space in the header. The maximum number of orders I was able to combine with scopy was 3, so it seems that the largest file size possible is the same as I found using rspectext. I tried a variety of options, but I was wondering if there was anyway to specify the details for the header when using scopy? I know in rspectext, the limiting factor for the file size is due to the header filling up with wavelength references that are included in the data set (because I need to use a nonlinear dtype). And I wonder if this is also the limiting factor when using scopy?

For information on the data set-- this may not be very common, as I googled and looked for similar queries before posting on this site, and found no similar issues. However, this could be because it is a relatively simple issue for most astronomers who are more well-versed in handling fits files. Our data sets that have this format are actually heritage data sets from a previous graduate student in our research group. From what I know about them, these data sets were flux- and wavelength-calibrated (and perhaps further manipulated and clean up) in IDL. While I'm sure he had a good reason for outputting the files in txt format, rather than fits, I'm not sure what that reason could be.

Thanks again for your help!

 
Profile Email
 Quote
   
Content generated in: 0.21 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login