Welcome to iraf.net Wednesday, May 22 2024 @ 03:26 AM GMT


 Forum Index > Help Desk > Applications New Topic Post Reply
 fxcor echelle aperture regions
   
orsola
 06/15/2006 03:24PM (Read 5684 times)  
+----
Newbie

Status: offline


Registered: 06/12/2006
Posts: 11
Hello - after browsing posts regarding Xcorrelating spectra I still have no answer for my question. So here is a new post.I am Xcorrelating echelle spectra. I would like all 23 apertures to be used and only ONE shift result to be returned to me. I know from previous posts that this is NOT possible: each aperture will retun one value for the shift based on the lines present in that aperture.I can deal with this since I can later average the 23 shift results. However I would like only slected reagion in each of the 23 apertures to be used for the Xcorrelation. This means that I have many ranges (about 40) that I want to input in the template and in the object spectra so that lines found only in those ranges are used for the Xcorrelation. However, when I input these ranges the fxcor task crashes and I have to kill the cl process externally.To give a better example of the program, let's say I am only Xcorrelating 2 apertures, so that fxcor.apertur=14,15 . In aperture 14 I want to use only one line in range 4460-4485A and in aperture 15 I only want to use the range 4330-4355A. So I enter 14,15 in apertur and "4460-4485,4330-4355" in BOTH osample and rsample (I also tried to separate ranges with a semi-colon). This is when the task and cl crash.What am I doing wrong? How can I achieve the Xcorrelation using a subset of each of the used apertures? I do not want to do this manully since I have a lot of spectra and quite a few apertures per spectrum.Thanks,
Orsola

Orsola De Marco, Ph.D. Astrophysics Department American Museum of Natural History New York, NY 10024, USA 212 496 3444
 
Profile Email Website
 Quote
fitz
 06/15/2006 03:24PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Orsola,Sample regions will apply to all apertures and all images, its not like the second sample region applies only to the second aperture in the list and so on. What's happening is that in the first aperture one of the samples is found to be out of bounds and so the sample is rewritten to exclude it, that new sample is used to process the second ap and obviously triggers a bug causing the crash (Ill need to look into that).Since you've got different samples for different apertures and want to average the results, I'd say the best solution would be to write a script that loops over each aperture individually, e.g. extract the aperture to a 1-D spectrum and use a sample you read from a list for that aperture. If you need help with the script just write back, hope this helps.Cheers,
-Mike

 
Profile Email
 Quote
orsola
 06/15/2006 03:24PM  
+----
Newbie

Status: offline


Registered: 06/12/2006
Posts: 11
Hi Mike,finally I get back to this problem! Thanks for the reply, I undestand what is happening. Is there a chance that you could write me the base for a script that I can then fill in the details of?Thanks, Orsola

Orsola De Marco, Ph.D. Astrophysics Department American Museum of Natural History New York, NY 10024, USA 212 496 3444
 
Profile Email Website
 Quote
fitz
 06/15/2006 03:24PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Hi Orsola,Assuming you have a text file containing a column of aperture numbers and the corresponding sample region. e.g.
cl> type ecdat.txt
14 4460-4485,4490-5000
15 4330-4335
: :A script would look something like[code:1:f01e567b8a]
procedure doit (image, aplist)string image {prompt="image list" }
string aplist {prompt="name of aperture list file"}begin
int apnum
string aprange list = aplist
while (fscan (list, apnum, aprange) != EOF) {
fxcor (image, image, apertures=apnum, osample=aprange, ....)
} # get average shift
fields ("fxcor.output", field=6) | average ("new_sample") |
scan (avg, sigma, nsamp)
end
[/code:1:f01e567b8a]This is just a stub of course. I just made up the field column since I can't remember what column its in but you get the idea. Note you'll need to specify a template spectrum and fill out some other parameters as well. Hope this helps.Cheers,
-Mike

 
Profile Email
 Quote
orsola
 06/15/2006 03:24PM  
+----
Newbie

Status: offline


Registered: 06/12/2006
Posts: 11
Dear Mike,
no joy with getting the script to work. After editing it, I run it withcl < fxcor_procedure.clBut get the following error:> cl < fxcor_procedure.cl
ERROR: Illegal variable declarations.
cl (gcur=fxcor_procedure.cl)I realize that gcur is a paramter datatype, but even looking at the gude to IRAF
scrips, I am not sure how to fix this problem.THanks, Orsola

Orsola De Marco, Ph.D. Astrophysics Department American Museum of Natural History New York, NY 10024, USA 212 496 3444
 
Profile Email Website
 Quote
fitz
 06/15/2006 03:24PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Hi Orsola,Its a procedure script so you need to declare it and run it as a task, e.g.[code:1:345c581f88]
cl> task doit = doit.cl
cl> doit myimage.fits aplist.txt
[/code:1:345c581f88]-Mike

 
Profile Email
 Quote
orsola
 06/15/2006 03:24PM  
+----
Newbie

Status: offline


Registered: 06/12/2006
Posts: 11
Not yet working... below are the script, the aperture list and the error message. Thanks, OrsolaPS While I think about it, fxcor needs an object and a template images. I
am tempted to edit the script, but not before I can get it to work the way it
is,or else I will never trace whe problem. The edits I would do are: in the first
line I would have "procedure doit (object, template, aplist)", then in the
declarations: "string object" "string template", and finally in the fxcor line I
would have "fxcor (object, template, apertures=...)". Does it sound right?cl> page doit.clprocedure doit (image, aplist)
#written for me by Mike Fitzpatrick on July 25, 2006string image {prompt="image list" }
string aplist {prompt="name of aperture list file"}begin
int apnum
string aprange list = aplist
while (fscan (list, apnum, aprange) != EOF) {
fxcor (image, image, apertures=apnum, osample=aprange, rsample=aprange)
} # get average shift
fields ("fxcor.output.txt", field=12) | average ("new_sample") |
scan (avg, sigma, nsamp)
endcl> page aperture.list4 4090-4110cl> task doit = doit.cl
cl> doit obj1402.wl.fits aperture.listERROR: segmentation violation
scan ()
doit (image=obj1402.wl.fits, aplist=aperture.list)

Orsola De Marco, Ph.D. Astrophysics Department American Museum of Natural History New York, NY 10024, USA 212 496 3444
 
Profile Email Website
 Quote
   
Content generated in: 0.31 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