Exemplo n.º 1
0
#print "Removing cosmic rays from images"
#cosmic_dict = cosmic_removal_param(telescope)  # Read the parameters (gain,readout noise)
#for index, im in enumerate(list_images["filename"]):
#    if list_images["type"][index] not in ["bias", "flats"]:        
#            newname = remove_cosmics.main(arguments=["--suffix", " -c", "--gain",\
#                   cosmic_dict["gain"], "--readnoise", cosmic_dict["readnoise"], \
#                   "--sigclip", cosmic_dict["sigclip"], "--maxiter", "3", im])
#            list_images["filename"][index] = newname

print "Include world coordinate system"
for index, image in enumerate(list_images["filename"]):
    if list_images["type"][index] in ("cig", "standards", "clusters"):
        hdr = fits.getheader(image)
        RA_header, DEC_header, time = hdr[rak], hdr[deck], hdr[datek]
        time = dateutil.parser.parse(time)
        RA, DEC = utilities.precess_to_2000(RA_header, DEC_header, time)        
        subprocess.call(['solve-field', "--no-plots", "--overwrite", 
                         "--no-fits2fits","--scale-units", "arcsecperpix", 
                         "--scale-low", str(0.98 * pix_scale), "--scale-high", 
                         str(1.03 * pix_scale), "--quad-size-max", "1.", 
                         "--quad-size-min", "0.05", "--ra", str(RA), "--dec", 
                         str(DEC), "--radius", str(FoV), "--depth", "100,250", 
                         "--solved", "solved.txt", np.str(image)]) 


sys.exit()

print "Estimate seeing from images"
for index, image in enumerate(list_images["filename"]):
    if list_images["type"][index] in ("cig", "standards", "clusters"):
        # Victor Terron has promissed changing dirs will soon be unnecessary 
Exemplo n.º 2
0
#    if list_images["type"][index] in ["cig", "standards", "clusters"]:    
#        imdata = fits.getdata(im)
#        #im_median = np.median(imdata)
#        #im_MAD = np.median(np.abs(imdata - im_median))
#        #imdata[imdata < im_median + 6. * im_MAD] = im_median
#        imfiltered = filters.gaussian_filter(imdata, 2)
#        filtered_name = utilities.add_suffix_prefix(im, prefix="filtered-")
#        fits.writeto(filtered_name, imfiltered)

print "Include WCS"
for index, im in enumerate(list_images["filename"]):
    if list_images["type"][index] in ["cig", "standards", "clusters"]:
        # Get date, RA, DEC from images. 
        time, RA_current, DEC_current = utilities.get_from_header(im, datek,
                                                                  rak,deck)
        RA, DEC = utilities.precess_to_2000(RA_current, DEC_current, time)
        RA, DEC, radius = str(RA), str(DEC), str(FoV/2.5)   
    
        # Calculate WCS using sextractor
        subprocess.call(["solve-field", "--no-plots", "--no-fits2fits", 
                         "--ra", RA, "--dec", DEC, "--radius", radius,
                         "--depth", "1-30", "--depth", "1-50", "--depth", 
                         "1-100", "--depth", "10,20,30,40,50,60,70,80,90,100",
                         "--use-sextractor", "--code-tolerance", "0.01",
                         "--overwrite", im])                         

        solved = utilities.replace_extension(im, "solved")
        # Case sextractor couldn't do it, try with astrometry.net's own routine
        if not os.path.exists(solved):
            subprocess.call(["solve-field", "--no-plots", "--no-fits2fits", 
                             "--ra", RA, "--dec", DEC, "--radius", radius,