Пример #1
0
	## The shiftlist, object list, and final image are saved in the main folder
	print "Copying shiftfile"
	os.system("cp Shiftlist_"+obj+"_"+filt+".txt "+objFilterDir)
	print "Copying list of frames"
	os.system("cp "+ff+" "+objFilterDir+ff)
	print "Copying final image"
	os.system("cp "+obj+"_"+filt+"_mp.fits "+objFilterDir+obj+"_"+filt+".fits")
	## The intermediate steps get saved to a subdirectory
	print "Copying saved info..."
	os.system("cp "+obj+"_"+filt+"* "+savedDir)

	## Also we should print the FWHM for our target in the combined image
	finalFrame = obj+"_"+filt+"_mp.fits"
	os.system("rm -f "+finalFrame+".fullcoo")

	print "Finding the FWHM for the final frame and exporting to a summary file"
	ao.findStars(finalFrame, aries.useFWHM, aries.useBkg ,aries.useThresh, extra="")
	worked = ao.readFullCooAllStars(finalFrame, aries.useFWHM, aries.useBkg, aries.useThresh, interactive=True)
	while worked[0] != True:
		useFWHM,useBkg,useThresh, useX, useY, useEdge = worked
		os.system("rm -f "+finalFrame+".fullcoo")
		ao.findStars(finalFrame, useFWHM, useBkg, useThresh,extra="")
		worked = ao.readFullCooAllStars(finalFrame, useFWHM, useBkg, useThresh, numXpixels=useX, numYpixels=useY, ignoreEdgePixels=useEdge, interactive=True)


	measFWHM, measX, measY = ao.getFWHM(finalFrame, finalFrame+".coo", fwhmType=aries.useFWHM)
	print obj,measX, measY, measFWHM, eval(measFWHM)*0.02
	print >>g, obj,measX, measY, measFWHM, eval(measFWHM)*0.02

g.close()
Пример #2
0
        useBPM = aries.doBadPixelCorr["default"]

    print "\n Now working on", ff, "using FWHM type", useFwhm
    allFiles = gb.readListFile(ff)
    ## Now get centers, fwhm of brightest object (usually the target)
    shiftListCoords = {}
    for frame in allFiles:
        ## get rid of existing .coo files
        # os.system("rm -f "+frame+".fullcoo")
        # os.system("rm -f "+frame+".coo")
        ### find stars
        if os.path.exists(frame + ".fullcoo"):
            # 			worked = aries.readFullCoo(frame,useFWHM,useBkg,useThresh)
            worked = ao.readFullCooAllStars(frame, useFWHM, useBkg, useThresh)
        else:
            ao.findStars(frame, useFWHM, useBkg, useThresh)
            # 			worked = aries.readFullCoo(frame,useFWHM,useBkg,useThresh)
            worked = ao.readFullCooAllStars(frame, useFWHM, useBkg, useThresh)
        while worked[0] != True:
            useFWHM, useBkg, useThresh = worked
            os.system("rm -f " + frame + ".fullcoo")
            ao.findStars(frame, useFWHM, useBkg, useThresh)
            # 			worked = aries.readFullCoo(frame,useFWHM,useBkg,useThresh)
            worked = ao.readFullCooAllStars(frame, useFWHM, useBkg, useThresh)
            ### Now that we know where the stars are, we can check the FWHM estimate
        measFWHM, measX, measY = ao.getFWHM(frame + "//.red.sub", frame + ".coo", fwhmType=useFwhm)
        print frame + " Measured: X, Y (daophot); X, Y, FWHM (imexam)", worked[1], worked[2], measX, measY, measFWHM
        if 2 < measFWHM < 50:
            useFWHM = measFWHM
            #### NOTE: a seeing criteria is used in step6
Пример #3
0
                worked = ao.readFullCooAllStars(
                    image,
                    fwhm,
                    sigma,
                    thresh,
                    numXpixels=maxX,
                    numYpixels=maxY,
                    ignoreEdgePixels=edgePixels,
                    interactive=False,
                )
            else:
                print "\n", obj, "will make new .coo file"
                os.system("rm -f " + image + ".coo")
                os.system("rm -f " + image + ".fullcoo")
                ### Now look for the stars in the frame iteratively
                ao.findStars(image, fwhm, sigma, thresh, extra="", overwrite=True)
                ### Note! the number of pixels is > 1024 due to combining dithers. In fact, let's just ignore the upper limit
                worked = ao.readFullCooAllStars(
                    image, fwhm, sigma, thresh, numXpixels=maxX, numYpixels=maxY, ignoreEdgePixels=edgePixels
                )
                # import stars, or loop until conditions improve
                print "first pass?", worked
                while worked[0] != True:
                    fwhm, sigma, thresh, maxX, maxY, edgePixels = worked
                    print "trying with new values:", fwhm, sigma, thresh
                    os.system("rm -f " + image + ".fullcoo")
                    ao.findStars(image, fwhm, sigma, thresh, overwrite=True)
                    worked = ao.readFullCooAllStars(
                        image, fwhm, sigma, thresh, numXpixels=maxX, numYpixels=maxY, ignoreEdgePixels=edgePixels
                    )