Welcome to iraf.net Sunday, February 25 2018 @ 05:54 PM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 Problem with script
   
KarolinaS
 01/17/2018 09:27AM (Read 513 times)  
+----
Newbie

Status: offline


Registered: 01/16/2018
Posts: 3
Hello everyone,

I have a problem with script. Everything seems to be ok, but when I try to run it, I see error:

ERROR: image keyword ‘hedit’ not found

My script looks like this:

hedit @a.lst date-obs '(@"DATE-OBS")' add+ ver-
hedit @a.lst UT '(@"TM-START"/3600)' add+ ver-
hedit @a.lst EPOCH '1994.8' add+ ver-
hedit @a.lst RA '(@"POSTN-RA"/15)' add+ ver-
hedit @a.lst DEC '(@"POSTN-DE")' add+ ver-
hedit @a.lst exptime '(@"TM-END"-@"TM-START")' add+ ver-
noao
observatory set lasilla
astutil
setjd @a.lst
# eso is 4.7153 hours west of Greenwich
hedit @a.lst st '(6.6974-(2451543.5-@"ljd")/15.21842447-4.7153+@"UT"*1.002738)' add+ ver-
# sidereal time may be bigger than 24 hours, so we subtract days first.
hedit @a.lst st '(@"st"-24.0*int(@"st"/24))' ver-
# if sidereal time is negative we add additional 24 hours
hedit @a.lst st '((@"st">0.0) ? (@"st") : (@"st"+24.0))' ver-
# now comes the hour angle
hedit @a.lst ha '(@"st"-@"RA")' add+ ver-
# eso is at fi=-29.2566 deg, so sin(fi)=-0.488721 and cos(fi)=0.872440
hedit @a.lst sinh '(-0.488721*sin(@"DEC")+0.872440*cos(@"DEC")*cos(@"ha"*15))' add+ ver-
# and finally the elevation above horizon
hedit @a.lst h '(asin(@"sinh"))' add+ ver-
# and the airmass.
hedit @a.lst airmass '(1/@"sinh")' add+ ver-
hedit @a.lst sinh . del+ ver-


@a.lst contains lists of images

b0012.wv.fits
b0014.wv.fits
b0017.wv.fits
b0020.wv.fits
b0028.wv.fits
b0030.wv.fits

It is strange, because when I manually, separately write command hedit, it all work, but when I try to run script it show me error.


Thank you for help in advance,
Karolina

 
Profile Email
 Quote
fitz
 01/18/2018 04:52AM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 3998
How exactly are you running the script? The error message looks to be coming from a task trying to find the 'hedit' keyword in the image header. For a command script like this the usual way to run it would be using redirection as something like

cl

 
Profile Email
 Quote
KarolinaS
 01/18/2018 09:21AM  
+----
Newbie

Status: offline


Registered: 01/16/2018
Posts: 3
Hello,

I try to run my script typing astutil. It looks like this:

cl
astutil
asthedit @a.lst eso.dat

eso.dat is a file with script

Furthermore, I try to run my script using pyraf, and its also not working. In pyraf I added to script command line:

import sys
from pyraf import iraf

Thank you for help in advance,
Karolina

 
Profile Email
 Quote
fitz
 01/20/2018 11:18PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 3998

The script you posted is what we'd call a "CL script", i.e. a file of CL commands to be executed. This is different than the script file expected by the ASTHEDIT task which has it's own syntax. In particular, the "hedit @a.lst" in your 'eso.dat' file should be removed -- the 'hedit' is an IRAF task that takes the '@a.lst' argument as the file list to process, but ASTHEDIT is expecting the first word on each line to be the keyword to be added/modified, hence the message that 'hedit' is an invalid keyword.

Just remove that 'hedit @a.lst' from each line of your script file.

 
Profile Email
 Quote
KarolinaS
 01/29/2018 11:13AM  
+----
Newbie

Status: offline


Registered: 01/16/2018
Posts: 3
Hello again,

Unfortunately, I still have problem with my script. Now, after some changes, it looks like this:

observat = "lasilla"
ut = sexstr ((@'tm-start' + 0.1) / 3600.)
utend = sexstr ((@'tm-end' + 0.1) / 3600.)
epoch = epoch (@'date-obs', ut)
lst = mst (@'date-obs', ut, obsdb (observat, "longtitude"))
exptime = (utend > ut) ? (utend - ut) * 3600. : (utedn + 24 - ut) * 3600.
ra = setr (@'postn-ra' / 15)
dec = sexstr (@'post-dec')
airmass = airmass (ra, dec, st, obsdb (observat, "latitude"))


When I try to run it, I see error message: ERROR: OBSGSTR: Observatory parameter not found

I don’t understand that, obviously iraf don’t see parameter observat = “lasilla”, but I set it properly, I guess.

 
Profile Email
 Quote
fitz
 01/29/2018 03:26PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 3998
lst = mst (@'date-obs', ut, obsdb (observat, "longtitude"))


'longitude' instead of 'longtitude'

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