china_108 |
03/01/2009 06:12AM (Read 5910 times)
|
|
|
Status: offline
Registered: 09/24/2008
Posts: 25
|
I read this post https://iraf.net/phpBB2/viewtopic.php?p=145225 but it doesn't work for my data.When I type in
st = mst (@'date-obs', ut, obsdb ("lco", "longitude"))it says
** Syntax error
**: st = mst (@"date-obs", ut, obsdb ("lco", "longitude"))
^Even if I changed to st = mst (@'date-obs''time-obs',ut, obsdb ("lco", "longitude")),it still doesn't work. One more question, the observatory is in Beijing , do I have to change the longitude to 117, which is the longitude of Beijing? Here is the header.V650Tau_V_0015.fit[1340,1300][ushort]:
No bad pixels, min=0., max=0. (old)
Line storage mode, physdim [1340,1300], length of user area 2673 s.u.
Created Sat 16:34:20 28-Feb-2009, Last modified Sun 13:56:16 01-Mar-2009
Pixel file "V650Tau_V_0015.fit" [ok]
EXTEND = F / File may contain extensions
BSCALE = 1.000000E0 / REAL = TAPE*BSCALE + BZERO
BZERO = 3.276800E4 /
ORIGIN = 'NOAO-IRAF FITS Image Kernel July 2003' / FITS file originator
DATE = '2009-02-28T08:34:20' / Date FITS file was generated
IRAF-TLM= '13:56:16 (01/03/2009)' / Time of last modification
BINNING = 1
CCDTYPE = OBJECT
EXPTIME = 10.
DATE-OBS= 2008-11-19
TIME-OBS= 11:15:59.906
FILTER =
CCD-TEMP= -40.
READPORT= High Capacity
RSPEED = 100 KHZ
GAIN = 2
OBJNAME = V650Tau_V
R.A. = 00:00:00.00
DEC. = +00:00:00.0
EPOCH = 2000
TELESCOP= XL50cm
CCD = PI1340*1300B
LONGITUD= 117.5774583
LATITUDE= 40.39586667
ALTITUDE= 892.
ASTRONOM= FuJianNing
ASSIST = MiFengFeng
RA = 3.790786
DEC = 23.67834
|
|
|
|
fitz |
03/01/2009 06:12AM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
The 'syntax error' looks like it coming from the CL, are you putting this command in a file or using it on the commandline directly? It should be in a file, however there are some differences you need to make for it to work.Since you want to use Beijing as the observatory, I suggest you use the 'BAO' entry in the observatory database. Also, your header does not have a UT keyword, I assume you want to use TIME-OBS at the ut value.
The problem however is that both your DATE-OBS and TIME-OBS keywords aren't quoted as strings and particularly for DATE-OBS will cause a problem. To put the values in quotes you can use commands like[code:1:3f05953611]
hselect ("test", "time-obs", "yes") | scan (s1)
hselect ("test", "date-obs", "ye")s | scan (s2)
hedit ("test", "time-obs", '"'//s1//'"')
hedit ("test", "date-obs", '"'//s2//'"')[/code:1:3f05953611]This will use the existing values but put them in quotes in the header, most likely you would wrap this in a small script to update many images. With that done, you can use ASTHEDIT by putting the following in a test file called 'cmd':[code:1:3f05953611]st = mst (@'date-obs', @'time-obs', obsdb("BAO","longitude"))[/code:1:3f05953611]and then execute[code:1:3f05953611]cl> asthedit test.fits cmd[/code:1:3f05953611]Cheers,
-Mike
|
|
|
|
china_108 |
03/01/2009 06:12AM
|
|
|
Status: offline
Registered: 09/24/2008
Posts: 25
|
Thank you very much, Mike. It works for the data of another telescope which already has date-obs in quotes. However, there are still some problem with the data of this telescope.First, I have got many fits images. Say test01.fit, test02.fit......
When I type in
1:93D7A1A58E Formatted Code hselect ("test*.fit", "time-obs", "yes") | scan (s1)[/code:1:93d7a1a58e]
All the time-obs of the images are updated with the same time-obs, which is the time-obs of the first image.
Second, when I type in
[code:1:93d7a1a58e]cl> asthedit test.fits cmd[/code:1:93d7a1a58e]
It says
ERRORS: segmentation violation
|
|
|
|
fitz |
03/01/2009 06:12AM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
[quote:c4e26a2c63]
First, I have got many fits images. Say test01.fit, test02.fit......
When I type inhselect ("test*.fit", "time-obs", "yes") | scan (s1)All the time-obs of the images are updated with the same time-obs, which is the time-obs of the first image[/quote:c4e26a2c63]This is because your HSELECT is getting the values from many images but the scan is to a single variable and so all you get is the first value. To process many images you would need to wrap things up into a script command and process them individually, e.g.[code:1:c4e26a2c63]
procedure fixit()
begin
string fname files ("test*.fit", > "imagelist") # create a list of the files
list = "imagelist"
while (fscan (list, fname) != EOF) {
hselect (fname, "time-obs", "yes") | scan (s1)
hselect (fname, "date-obs", "ye")s | scan (s2)
hedit (fname, "time-obs", '"'//s1//'"')
hedit (fname, "date-obs", '"'//s2//'"') asthedit (fname, "cmd") # fix the image
}
end
[/code:1:c4e26a2c63]Note I'm using literal strings for the command filename and the image names, you would change these as needed. Since the task doesn't have any parameters you would declare it as[code:1:c4e26a2c63]task $fixit = /path/fixit.cl[/code:1:c4e26a2c63]where the '$' indicates no params.The segmentaton violation I've seen when the DATE-OBS string isn't quoted (we'll fix this to catch it). The HSELECT task only gets the current value, it is the HEDIT that does the change but be sure the 'update' parameter is set and verify the change. In the above script you may want to just to the edits first and then run ASTHEDIT separately.Cheers,
-Mike
|
|
|
|
china_108 |
03/01/2009 06:12AM
|
|
|
Status: offline
Registered: 09/24/2008
Posts: 25
|
Sorry, Mike, but please help again.
I tried to run fixit(This is the very first step. I think it puts date-obs and time-obs in quotes first and then I can put "asthedit *test*.fit cmd" in the command line ). All the date-obs were quoted but not time-obs. Only the time-obs of the first image is quoted after running fixit.
On the command line, it says
ERROR on line 15: segmentation violation
|
|
|
|
fitz |
03/01/2009 06:12AM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
The first thing to do is to separate the quoting from the asthedit command so we can figure out which isn't working. If you use the fixit script, comment out the asthedit line so all the script does is quote the values, but note there is a typo in the script posted for the hselect command that works on date-obs (i.e. the last argument isn't quoted correctly).The segfault makes sense only if you ran the script as-is and what's happening is that the date-obs, not time-obs, isn't being quoted. If you fix the script and comment out the asthedit command, run it on some test images and verify the values are quoted, if not let me know. If you do get the quotes and asthedit still fails, please post another image header of the fixed image.-Mike
|
|
|
|
china_108 |
03/01/2009 06:12AM
|
|
|
Status: offline
Registered: 09/24/2008
Posts: 25
|
Hello, Mike thanks a great deal for your help. It works fine when I remove this line from the script.[code:1:3ae47d8ebe]asthedit (fname, "cmd")[/code:1:3ae47d8ebe]All the date-obs and time-obs are properly quoted. But then when I run [code:1:3ae47d8ebe]asthedit test*.fits cmd[/code:1:3ae47d8ebe]Again it says segmentation violation. I am not sure if this is the situation you mean
[quote:3ae47d8ebe]If you do get the quotes and asthedit still fails, please post another image header of the fixed image[/quote:3ae47d8ebe]And I don't know how to post another image header of the fixed image.
|
|
|
|
fitz |
03/01/2009 06:12AM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
Instead of a list of images, try running the task on a single fixed file, e.g. [code:1:bd90f6a497]asthedit test001.fits cmd[/code:1:bd90f6a497]This may still fail but will tell us the list isn't the problem.If it does fail, you can get a listing of the image header with, e.g.[code:1:bd90f6a497]cl> imhead test001.fits long+[/code:1:bd90f6a497]Then just simply post the output in your next message. With that, I can create a dummy image here and investigate further. You should also post the contents of the 'cmd' file so I can be sure to reproduce exactly what you're doing.-Mike
|
|
|
|
china_108 |
03/01/2009 06:12AM
|
|
|
Status: offline
Registered: 09/24/2008
Posts: 25
|
Hello, Mike, really thanks a lot.Again when I just tried a single image when running asthedit, it says segmentation violation.Here is the image header now, with date-obs and time-obs in quotes.
----------------------------------------------------------------------------
V650Tau_V_0050.fit[1340,1300][ushort]:
No bad pixels, min=0., max=0. (old)
Line storage mode, physdim [1340,1300], length of user area 1215 s.u.
Created Thu 12:59:44 05-Mar-2009, Last modified Thu 12:59:43 05-Mar-2009
Pixel file "V650Tau_V_0050.fit" [ok]
EXTEND = F / File may contain extensions
BSCALE = 1.000000E0 / REAL = TAPE*BSCALE + BZERO
BZERO = 3.276800E4 /
ORIGIN = 'NOAO-IRAF FITS Image Kernel July 2003' / FITS file originator
DATE = '2009-03-04T06:00:35' / Date FITS file was generated
IRAF-TLM= '12:59:43 (05/03/2009)' / Time of last modification
BINNING = 1
CCDTYPE = OBJECT
EXPTIME = 10.
DATE-OBS= "2008-11-19"
TIME-OBS= "11:33:29.890"
FILTER =
CCD-TEMP= -40.
READPORT= High Capacity
RSPEED = 100 KHZ
GAIN = 2
OBJNAME = V650Tau_V
EPOCH = 2000
TELESCOP= XL50cm
CCD = PI1340*1300B
LONGITUD= 117.5774583
LATITUDE= 40.39586667
ALTITUDE= 892.
ASTRONOM= FuJianNing
ASSIST = MiFengFeng
RA = 3.790786
DEC = 23.67834
--------------------------------------------------------
Here is the cmdst = mst (@'date-obs', @'time-obs', obsdb("BAO","longitude"))
|
|
|
|
fitz |
03/01/2009 06:12AM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
Aaargh. The commands I gave you put a double-quote around the value, this is what's causing the problem. The correct HEDIT command should use[code:1:54716de282]
hedit (fname, "time-obs", "'"//s1//"'")
hedit (fname, "date-obs", "'"//s2//"'")
[/code:1:54716de282]That is, double quotes enclosing a single quote. Simply making the change to the fixit script and running it over the same images should be enough to change the quotes in the images you've already edited.Sorry for the mixup.-Mike
|
|
|
|
china_108 |
03/01/2009 06:12AM
|
|
|
Status: offline
Registered: 09/24/2008
Posts: 25
|
Hello, Mike, thanks again. Now the date-obs and time-obs are all put in single quotes. But when I run asthedit, it still says segmentation violation.Here is now the imheader.
----------------------------------------------------------------
V650Tau_V_0024.fit[1340,1300][ushort]:
No bad pixels, min=0., max=0. (old)
Line storage mode, physdim [1340,1300], length of user area 1215 s.u.
Created Fri 10:53:29 06-Mar-2009, Last modified Fri 10:53:37 06-Mar-2009
Pixel file "V650Tau_V_0024.fit" [ok]
EXTEND = F / File may contain extensions
BSCALE = 1.000000E0 / REAL = TAPE*BSCALE + BZERO
BZERO = 3.276800E4 /
ORIGIN = 'NOAO-IRAF FITS Image Kernel July 2003' / FITS file originator
DATE = '2009-03-06T02:53:29' / Date FITS file was generated
IRAF-TLM= '10:53:37 (06/03/2009)' / Time of last modification
BINNING = 1
CCDTYPE = OBJECT
EXPTIME = 10.
DATE-OBS= '2008-11-19'
TIME-OBS= '11:20:29.890'
FILTER =
CCD-TEMP= -40.
READPORT= High Capacity
RSPEED = 100 KHZ
GAIN = 2
OBJNAME = V650Tau_V
R.A. = 00:00:00.00
DEC. = +00:00:00.0
EPOCH = 2000
TELESCOP= XL50cm
CCD = PI1340*1300B
OBSERVAT= Xinglong
LONGITUD= 117.5774583
LATITUDE= 40.39586667
ALTITUDE= 892.
ASTRONOM= FuJianNing
ASSIST = MiFengFeng
---------------------------------------------------------------------------------------------
the cmd
st = mst (@'date-obs', @'time-obs', obsdb("BAO","longitude"))
------------------------------------------------------------------------------------------
and the asthedit parameters
images = "V650*.fit" Images to be operated upon
commands = "cmd" File of commands
(table = "") File of values
(colnames = "") Column names in table file
(prompt = "asthedit> ") Prompt for STDIN commands
(update = yes) Update image header?
(verbose = no) Verbose output?
(oldstyle = no) Use old style format?
(mode = "ql")
|
|
|
|
china_108 |
03/01/2009 06:12AM
|
|
|
Status: offline
Registered: 09/24/2008
Posts: 25
|
Mike, would you please help again. Thank you.
|
|
|
|
| |
|