Every survey object contains a server class which performs all the heavy querying and data retreival work. The server class that you write must implement the methods inside the abstract parent class Server.
The mosaicing and position-updating procedure will only work if the returned value of these functions coincide with what the mosacingin program expects. Generally, it is easier to write the code for each method according to this sequence:
Here is some sample code that parses the output XML file returned by queries, you can adjust this to conform to the particular data services that you are using.
#Parse XML to find URL of all objects lying inside field
with open("result.txt") as f:
n=0
i=0
for line in f:
#The URL is stored in the line after <fitsurl>
if (line =="<fitsurl>"):
#passing till 1 lines down <fitsurl>
n+=1
pass
elif (n==1):
n=0
url = line.split('[')[-1].split(']')[0]
if (i>0):
#preventing other downloads to override the initial file
filename = "{}_{}_{}_{}_{}.fits".format(survey.name,band,str(ra),str(dec),str(i))
else:
filename = "{}_{}_{}_{}.fits".format(survey.name,band,str(ra),str(dec))
print ("wget -O {} {}{}{} ".format(filename,' "',url,'" '))
os.system("wget -O {} {}{}{} ".format(filename,' "',url,'" '))
i+=1
Since we are mosaicing 2 color images with different parameters to emphasize low surface structure and wipe away the background, so we modify the parameters in the Survey object's stiff_param_low and stiff_param_best as command line arguements to overrride the default stiff configuration file.
These are parameters that are required for the essential mosaic and cordinate update algorithms to work but they are nice information to have around.