Welcome to iraf.net Thursday, May 02 2024 @ 07:47 AM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 Scripting question
   
massey
 05/29/2018 04:14PM (Read 673 times)  
+++++
Active Member

Status: offline


Registered: 02/10/2006
Posts: 162
I’m calling “phot” within a script, and I’d like to give it three different aperture sizes. If I were
doing this with numbers I would say:

phot(s1,"default","default",datamax=dataxv,datamin=datanv,apertur=“3,5,7",calgori="none",interact-,verify-,verbose-,filter=s2,obstime=s3,annulu=10,dannu=8)

and it would then do photometry through apertures with radii of 3, 5, and 7.

Instead, I’d like to do it using variables. If I do a

phot(s1,"default","default",datamax=dataxv,datamin=datanv,apertur=fwhmv,calgori="none",interact-,verify-,verbose-,filter=s2,obstime=s3,annulu=10,dannu=8)

it works fine. (I declare fwhmv as a real.) However, if I do:

phot(s1,"default","default",datamax=dataxv,datamin=datanv,apertur=fwhmv,fwhmB,fwhmvC,calgori="none",interact-,verify-,verbose-,filter=s2,obstime=s3,annulu=10,dannu=8)

it doesn’t like the syntax. (fwhmB and fwhmC are also declared as reals). So, instead I tried putting them in quotes:

phot(s1,"default","default",datamax=dataxv,datamin=datanv,apertur="fwhmv,fwhmB,fwhmvC",calgori="none",interact-,verify-,verbose-,filter=s2,obstime=s3,annulu=10,dannu=8)

and instead it just does a single aperture with a radius of 3.0.

Thoughts?

Thanks!
--phil

 
Profile Email Website
 Quote
fitz
 05/29/2018 04:21PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
The parameter needs to be passed as a string, so you need to first create the string from the script variables. E.g.

string aps

aps = str(fwhmv)//","//str(fwhmCool//","//str(fwhmC)

phot (......, aperture=aps, ....)

Note you need to also use the concatenation operator '//' to construct a comma-delimited string.

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