Hi, I am writing an IRAF script for an observational spectroscopy course that I am teaching which takes a previous wavelength solution and applies it to comparison spectra for stars taken that night. I have written and used scripts like this many times, all of which are working, but for some reason reidentify is not writing ec and id files to the database. Here is the relevant portion of the script:
noao
onedspec
twodspec
apextract
string list1
string s4=""
list1 = ""
list = ""
list = "reduce.lst"
apextract.dispaxis=1
while(fscan(list,s1,k,s2,s4) != EOF) {
print("\n")
print(s1)
for(i=1; i <= k;i+=1) {
j = fscan(list,s3)
list1 = list1//s3//".ms"
if(i != k) list1 = list1//","
apall(input=s2,format="multispec",references=s3,recenter=no,trace=no,
background=no,interactive=no)
apall(input=s4,format="multispec",references=s3,recenter=no,trace=no,
background=no,interactive=no)
print("point A"
if(i == 1){
reidentify(reference="refcp3",images=s2//".ms",interac=yes,overrid=yes,coordli="linelists$rsoAr.dat",threshold=30.,refit=yes)
reidentify(reference="refcp3",images=s4//".ms",interac=yes,overrid=yes,coordli="linelists$rsoAr.dat",threshold=30.,refit=yes)
}
if(i > 1){
reidentify(reference="refcp3",images=s2//".ms",interac=no,overrid=no,coordli="linelists$rsoAr.dat",threshold=30.,refit=no)
reidentify(reference="refcp3",images=s4//".ms",interac=no,overrid=no,coordli="linelists$rsoAr.dat",threshold=30.,refit=no)
}
print("point B")
hedit(images=s3//".ms.fits",fields="REFSPEC1",value=s2//".ms",
add=yes,show=yes,verify=no)
hedit(images=s3//".ms.fits",fields="REFSPEC2",value=s4//".ms",
add=yes,show=yes,verify=no)
print("point C")
dispcor(input=s3//".ms",output=s3//".ms",linearize=no)
print("point D")
.....
The script is written so that the user checks the wavelength solution before that wavelength solution is applied to all the spectra taken for a particular star. Images s2 and s4 are the arc spectra taken before and after the stellar spectra. s3 are the stellar spectra. At point C, the script issues an error that looks like:
point C
Warning: Cannot open file (database/ecComp_Zet_Leo1.ms)
Warning: Cannot open file (database/idComp_Zet_Leo1.ms)
Warning: ZetaLeo4DSF.ms: Dispersion data not found
point D
where Comp_Zet_Leo1 is the first arc spectrum. The ec and id files are NOT in the database, so dispcor cannot find them, and the script fails. The initial solution (in "refcp3") was created in another script. idrefcp3 is in the database, and contains the wavelength solution. I am certain I am overlooking something simple. Can you help?
Richard