os.system("rm smooth_dir/master_smooth.fits") os.system("rm smooth_dir/smooth_*.fits") ### Go through the folders, identify and reduce each smooth image smooth_files_list = [] stars_to_try = ["ltt4364","eg131"] for star in stars_to_try: count = 1 for i in range(len(folders_to_search)): file_path_current = file_path + folders_to_search[i] ### Find any smooth star exposures ccdlist_info = iraf.ccdlist(file_path_current + "*.fits", Stdout = 1) ccdlist_info = functions.ccdlist_extract(ccdlist_info) ccdlist_match = functions.ccdlist_identify(ccdlist_info,star) ### Reduce any such exposures if len(ccdlist_match) > 0: for j in range(len(ccdlist_match)): file_name = ccdlist_info[ccdlist_match[j]][2] + ".fits" file_path_temp = file_path_current + "temp/" file_path_reduced = file_path_current + "reduced/" print "currently reducing image " + file_path_current + file_name smooth_files_list,count = reduce_image(file_path_current,file_name,file_path_reduced,smooth_files_list,count) ### If exposures were found for starX, then break the for loop if count > 1:
######################## ### Start of program ### ######################## ### Make the required folders print "Making directories temp and reduced" os.system("mkdir " + file_path + "temp") os.system("mkdir " + file_path + "reduced") ######################## ### Form master bias ### ######################## ### Find the bias images print "Finding the bias frame(s)" ccdlist_info = iraf.ccdlist(file_path + "*.fits", Stdout=1) ccdlist_info = functions.ccdlist_extract(ccdlist_info) ccdlist_match = functions.ccdlist_identify(ccdlist_info,"bias") os.system("rm " + file_path_temp + "master_bias.fits") if len(ccdlist_match) < 1: print "!!!!!!! No Bias frames found, using default bias !!!!!!!" os.system("cp default_cal_frames/bias.fits " + file_path_temp + "master_bias.fits") if len(ccdlist_match) >= 1: input_list = "" for i in range(len(ccdlist_match)): bias_file_path = ccdlist_info[ccdlist_match[i]][0] input_list = input_list + bias_file_path + "\n" functions.write_string_to_file(input_list,file_path + "bias_list") print "The bias files found are:"
######################## ### Start of program ### ######################## ### Set file_path file_path = sys.argv[1] #file_path = "/priv/miner3/hat-south/george/Honours/data/wifes/2010/" file_path_temp = file_path + "temp/" file_path_reduced = file_path + "reduced/" ############################################ ### Open file_path and find all SpecPhot ### ############################################ ### Get a list of fits files with objects begining in "HD" object_list = functions.ccdlist_extract(iraf.ccdlist(file_path +"*.fits",Stdout = 1)) HD_match = functions.ccdlist_identify_HD(object_list) HD_match = [] for i in range(len(object_list)): HD_match.append(i) ### Open those images and check if NOTES says "RV Standard" SP_match = check_head(HD_match,"NOTES","SpecPhot") ### Write the file_names to temp textfile SP_list = open(file_path_temp + "SpecPhot_list","w") for i in range(len(SP_match)): file_name = object_list[SP_match[i]][2] + "\n" SP_list.write(file_name)
zero='Zero', flat='nFlat') iraf.ccdproc(images=cal, ccdtype='', fixpix=False, overscan=False, darkcor=False, trim=True, zerocor=True, flatcor=True, trimsec='[*,20:4600]', zero='Zero', flat='niFlat') iraf.ccdlist('Zero, nFlat, niFlat, {0}, {1}'.format(science, cal)) iraf.imstat('Zero') iraf.imstat('nFlat') iraf.imstat(science) iraf.imstat(cal) ref = str(raw_input('Imagen de referencia (eg. hd161103_0001.fits):')) iraf.imexamine(ref) iraf.apall.unlearn() iraf.apall(input=science, format='onedspec', readnoise='rdnoise', gain='gain') iraf.apall(input=cal, format='onedspec',