Hi, finally here it is the correct version of the script.Simply, it edits the image headers to ensure Maxim DL compatibility.
1300b direct CCD camera or any image with similar headers.
The problem arises when trying to use Maxim DL software on images that have the DATE-OBS key not with Maxim's format. This format does not comply with the DATE-OBS key expected by Maxim as aaaa:mm:ddThh:mm:ss
on your images (or whatever you want) with Maxim.
The script looks for either .fit or .fits images.It has to be used in two steps, option 1 and 2.
[b:ee59339bdb]option 1[/b:ee59339bdb] creates needed files.
the name for the prefered application.
created called salida.
Thus each line in the "new" date_list file should be likeyear:month:dayThh:mm:ss
2009:07:08T01:08:00Save this file again and run option 2.
[b:ee59339bdb]option 2[/b:ee59339bdb] The script edits the headers.
I hope that it would be useful.
I have to thanks [b:ee59339bdb]fitz[/b:ee59339bdb] for his remarkable suggestion.
1:EE59339BDB Formatted Code
procedure Maxim_header (start)
#version 1.0
int start {prompt="Please select to create the needed files, e.g, 1st time,(1) or to EDIT Image Headers, 2nd (2)?: "}
struct *list
begin
string s1
string imlist
struct s2
int ss
ss=start
print("........................................................................................................... ")
print("Maxim Header ver 1.0 " )
print("This script will correct the DATE-OBS keyword")
print("in a series of images in order to make them 'readable'")
print("by the Maxim DL software")
print("This is a known issue in direct images taken with the Roper 1300B CCD")
print("camera at CASLEO. The keyword DATE-OBS doesn't have the apropiate")
print("yyyy:mm:dddThh:mm:ss format. This script corrects that.")
print("")
print("............................................................................................................")
del("ut_list")
del("date_list")
del("ut_list_T")
del("final")
switch(ss) {
case 1: { #It creates the list of images to process, either .fit or .fits
!ls *.fits >"imlist"
!ls *.fit >> "imlist"
print("")
print("....................................................................")
print(" Generating date_list and ut_list_T files")
print("....................................................................")
print("")
print("")
print("")
hselect("@imlist","DATE-OBS",yes, > "date_list")
hselect("@imlist", 'UT',yes, > "ut_list")
list="ut_list"
while (fscan(list,s1) !=EOF){
files("T"//s1 ,>>"ut_list_T")
}
!paste date_list ut_list_T > salida #It creates the output file needed for option #2
#**
!gedit salida & #It calls gedit, change it if needed
print("............................................................")
print("Save your file as salida by deleting")
print("the space between the two columns")
print("in order to have in each line the yyyy::ddThh:mm:ss format")
print("Please run the script again but selecting option 2")
print("this will automatically edit your image headers")
print(".............................................................")
print("******")
print("DONE")
print("******")
}
case 2: {
print("..................................................................................................")
print("Image headers will be corrected to ensure Maxim DL compability")
print("...............................................................................................")
print("")
print("")
print("")
print("")
if(access("salida")){ #Hediting image headers
!paste imlist salida > final
list = "final"
while (fscan (list, s1, s2) != EOF) {
hedit (s1, "DATE-OBS", s2, add+, up+, ver-)
}
del("salida")
print("*............................................................................*")
print("The Image headers have been edited SUCCESFULLY")
print("EXITING NOW")
print("*..........................................Maxim_header_v1a.*")
}
else{
print("")
print("................................................")
print("File salida not present")
print("Did you first run option #1?")
print("................................................")
}
}
default:
print("Please select option #1 or #2")
}
end
[/code:1:ee59339bdb]