View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

CNSHD102826 Re: STSDAS programming help

Help@stsci.edu wrote on Jun 21, 1999

If you need to respond to this message please do so by replying to this message or create a new message with call number CNSHD102826 included in the subject line.

Call Log : 
   06/21/99 09:31:54     mcleskey
      
      Request from wyckoff@stsci.edu
       
      To: IN%"help@stsci.edu"
      Cc: 
       
      
      ----- Begin Included Message -----
      
      >From adass-iraf-applications@noao.edu Sun Jun 20 15:21 EDT 1999
      Date: Sun, 20 Jun 99 12:21:04 MST
      Originator: adass-iraf-applications@iraf.noao.edu
      From: irafmail-gateway@noao.edu (Shel Woodruff)
      To: wyckoff@stsci.edu
      Subject: (none)
      X-Listprocessor-Version: 6.0c -- ListProcessor by Anastasios Kotsikonas
      
      Hello.  I am a recent IRAF user, who would like to write a program to do
      some simple tasks. Basically, I take images of stars from a file and write
      down their coordinates and some info using imexamine by hand! There must be
      a way for the computer to do this for me. This is how far I have gotten: 
      cl> sections image.* >star.lis 
      cl> list = "star.lis" 
      cl> while (fscan (list, s1) ! = EOF) { 
      >>> doafind //to find the stars 
      >>> tvmark //to mark them 
      >>> hedit imexam logfile = s1".dat" //to put the info into a file 
      >>> imexam tvmark //to get the info for the file 
      } 
      I know I am a long way off from writing this program, but if you could even
      just tell me a better way to put the info from the 'a' function of imexam
      into a file, I would really appreciate it. Is their a digiphot command that
      makes it easier. Also, can I call the logfile, s1".dat"? Will the computer
      understand what I want to do? Should I not be surprised that a script in
      not already available? Shel
      
      
      
      
      ----- End Included Message -----
      
   06/21/99 09:43:16     plee
         plee changed platform to STSDAS
   06/21/99 09:51:11     wyckoff
         wyckoff changed status to Hold
      
         wyckoff assigned call to wyckoff
   06/21/99 14:29:07     wyckoff
      Shel,
      
      > I take images of stars from a file and write down their coordinates
      > and some info using imexamine by hand!
      
      You could run a star finder routine like IRAF's daofind.  Then you 
      could use this list as input to other programs in the
      noao.digiphot.apphot package.  These programs can give you all the 
      information you could want from a star's image. 
      
      As far as the programming goes, once you decide what it is that you
      want to fo repeatedly, a simple terminal script would be the way to
      go.  A terminal script is a list of commands that you have in a file,
      that are sequentially executed until the end of the file is reached.
      
      Start by using the task 'mkscript' which will create the command in 
      the form you want it in; with all the parameters defined.  Go from 
      there.  
      
      Once you have mastered this, you can worry about trickier things.
      
      Good Luck,
      
      Eric, STSDAS Sr. Data Analyst
      ----
      
         wyckoff changed status to Resolved
      
         wyckoff mailed the current call log entry to irafmail-gateway@noao.edu
   06/21/99 14:40:48     wyckoff
         wyckoff changed update user to Entire Once
      
         wyckoff mailed the entire call log entry to adass-iraf-applications@noao.edu

Help@stsci.edu wrote on Jun 22, 1999

If you need to respond to this message please do so by replying to this message or create a new message with call number CNSHD102826 included in the subject line.

Current call log entry :  
   
   Shel,
   
   Could you begin addressing your mail messages to help@stsci.edu?  They 
   will be sent directly to me, but be part of the helpdesk history.
   As it is now, I forward all your messages to help after I gett them.
   
   Thanks.
   
   ---
   
   Re: Your script
   
   I see a problem with your script that may or may not be a cause for
   your problem.
   
   > procedure new (imagefile, galaxyfile)
   > string imagefile {prompt="Images?"} 
   > string galaxyfile {prompt= "Galaxy list?"} 
   > struct *imagelist 
   > struct *galaxylist
   > begin 
   > int i 
   > string imagename, starname, tempimage 
   > galaxylist = galaxyfile 
   > tempimage = mktemp ("tmp$star") 
   > sections (imagefile, > tempimage) 
   
   Right here  ^^^^^^^^^, you are using a script parameter in the program
   mode (ie. after the 'begin' statement) that has not been defined as
   a different local variable; like you did with galaxylist = galaxyfile
   above.  You can't do this.
   
   Also, the '>' redirection in that same line will never be more than
   one line long, the last one.  This continually overwrites the file
   defined by 'tempimage'.  To concatenate in that file you would want 
   to change that character to these '>>'.  Just like you use in the
   'imexam' line.   
   
   You are NOT a long way from writing a program script!  You are either 
   VERY modest or a very hard worker!  
   
   Also, in the start clause of your while loop, you have the string
   variable 'imagename' which is declared, but never defined.  At least,
   I can't see it in the code you sent me.  
   
   What is 'ukey'?  You seem to know more about script programming than I 
   do.
   
   Bye,
   Eric
   ---------

Last post on Jun 22, 1999