Welcome to iraf.net Wednesday, April 24 2024 @ 12:51 PM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 String manipulation in IRAF
   
grayro
 01/20/2017 09:58PM (Read 1168 times)  
++---
Junior

Status: offline


Registered: 03/15/2014
Posts: 23
Hi, I am having problems with some RA and DEC keywords in fxcor. fxcor wants the values to be delimited with colons, such as "12:30:56", but I have some spectra which have spaces instead: "12 30 56" and fxcor chokes on those. I want to be able to edit the header to correct those strings (by simple character replacement: replace " " with ":"), but I cannot find a string function in IRAF that will do that replacement. I could do this easily in "C", but do not see how to do this within IRAF. Can you help?

Richard

 
Profile Email
 Quote
fitz
 01/20/2017 10:37PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040

You can wrap it up in a script to process lists of images, but the basic steps would make use of the 'sed' foreign command in something like:

hselect ("foo.fits", "RA", yes) | sed("-e 's/ /:/g'") | scan (s1)
hedit ("foo.fits", "RA", s1, update+, verify-)

and then the same for the 'DEC" keyword. Unfortunately there isn't a string replacement function built directly into any of the header tasks.

 
Profile Email
 Quote
   
Content generated in: 0.13 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