예제 #1
0
pupilSize=5.0		# pupil diameter in meters (NB: MUST be smaller than phasescreen)
scale=100.0 		# scale factor (pixels/m)
v=1.0			# wind velocity (m/s)
sfrq=2			# number of samples per second
stime=2.0		# desired sampling time (0 = maximum)
atmosphereSize=10.0	# atmosphere patch size in meters
plateScale=10.0		# plate scale (mas/pixel)
wl=1e-6			#base wavelength
chip_px=512			# number of elements per chip (1dim)
exp_time=0.1			# exposure time in seconds

# atmosphere
#wl_delay=phaseScreen(atmosphereSize,scale,r0=0.4,seed=0,ao=0)
# atmosphere
phases=phaseScreen(atmosphereSize,scale,r0=0.2,seed=0,ao=0)*10

# masks
#input N holes Mask 
mask_n=getNHolesMask(diam=pupilSize,holeDiam=0.1*pupilSize,holeCoords=[0.,0.,0.2*pupilSize,0.2*pupilSize],border=0.0,scale=scale)
#input annulus Mask 
mask_ann=getAnnulusMask(diam=pupilSize,innDiam=0.9*pupilSize,border=0.0,scale=scale)
#input full pupil Mask 
mask_full=getFullMask(diam=pupilSize,border=0.0,scale=scale)
#load jwst mask
mask_jwst=np.load('jwst_1000.npy')

#activeMask
mask=mask_n

# image
예제 #2
0
# actuators number is for scale=100.0
act_num = 394  # number of actuators per aperture (strehl=0.6)
# act_num=193 # number of actuators per aperture (strehl=0.4)
# act_num=99 # number of actuators per aperture (strehl=0.2)
# act_num=65 # number of actuators per aperture (strehl=0.1)
# act_num=47 # number of actuators per aperture (strehl=0.05)
# act_num=34 # number of actuators per aperture (strehl=0.02)
# act_num=28 # number of actuators per aperture (strehl=0.01)
ao = np.sqrt(act_num) / pupilSize  # actuators density
#aopower=0.083
# we generate nFrames different atmospheres to get errors for kernel phases later
s = []
screens = []
for i in range(0, nFrames):
    print("---Processing atmosphere %d (%d total)---" % (i + 1, nFrames))
    phases = phaseScreen(atmosphereSize, scale, r0=0.2, seed=i, ao=ao)
    s.append(np.exp(-(phases - phases.mean()).std()**2))  # current strehl
    #generating phasescreen over exposure time for current atmosphere
    pupilScreens = getPhasesEvolution(phases,
                                      pupilSize,
                                      scale,
                                      v,
                                      sfrq,
                                      stime,
                                      expTime=exp_time,
                                      expNum=int(exp_dens * exp_time))
    screens.append(pupilScreens[0])
s = np.asarray(s)
screens = np.asarray(screens)
print("Mean strehl=%f SD=%f" % (s.mean(), s.std()))
예제 #3
0
# actuators number is for scale=100.0	
act_num=394 # number of actuators per aperture (strehl=0.6)
# act_num=193 # number of actuators per aperture (strehl=0.4)
# act_num=99 # number of actuators per aperture (strehl=0.2)
# act_num=65 # number of actuators per aperture (strehl=0.1)
# act_num=47 # number of actuators per aperture (strehl=0.05)
# act_num=34 # number of actuators per aperture (strehl=0.02)
# act_num=28 # number of actuators per aperture (strehl=0.01)
ao=np.sqrt(act_num)/pupilSize # actuators density
#aopower=0.083
# we generate nFrames different atmospheres to get errors for kernel phases later
s=[]
screens=[]
for i in range(0,nFrames) :
	print("---Processing atmosphere %d (%d total)---" % (i+1,nFrames))
	phases=phaseScreen(atmosphereSize,scale,r0=0.2,seed=i,ao=ao) 
	s.append(np.exp(-(phases-phases.mean()).std()**2))# current strehl
	#generating phasescreen over exposure time for current atmosphere
	pupilScreens=getPhasesEvolution(phases,pupilSize,scale,v,sfrq,stime,expTime=exp_time,expNum=int(exp_dens*exp_time))
	screens.append(pupilScreens[0])
s=np.asarray(s)
screens=np.asarray(screens)	
print ("Mean strehl=%f SD=%f" % (s.mean(),s.std()))

# ---- propagating ----
mask_names,idx=np.unique(np.asarray(data)[:,2],return_index=True)
num=0
for i in idx :
	print("Processing %s mask (%d of %d)" % (data[i][2],num+1,len(idx)))
	res=getFocalImages(pupil,data[i][0],screens,scale=scale_f,cropPix=chip_px,photonNoise=False)
	dt=datetime.datetime.now()
예제 #4
0
scale_f=wl/(pupilSize*mas2rad(plateScale))
# input Image
pupil = np.ones((int(scale*pupilSize),int(scale*pupilSize)),dtype='complex') + 0j # plane wave
	
# --- simulating athmosphere
act_num=498 # number of actuators per aperture (strehl=0.6, D=7.77)
act_num=1318 # number of actuators per aperture (strehl=0.8, D=7.77)

ao=np.sqrt(act_num)/pupilSize # actuators density
#aopower=0.083
# we generate nFrames different atmospheres to get errors for kernel phases later
s=[]
screens=[]
for i in range(0,nFrames) :
	print("---Processing atmosphere %d (%d total)---" % (i+1,nFrames))
	phases=phaseScreen(atmosphereSize,scale,r0=0.2,seed=i,ao=ao) 
	s.append(np.exp(-(phases-phases.mean()).std()**2))# current strehl
	#generating phasescreen over exposure time for current atmosphere
	pupilScreens=getPhasesEvolution(phases,pupilSize,scale,v,sfrq,stime,expTime=exp_time,expNum=int(exp_dens*exp_time))
	screens.append(pupilScreens[0])
	
s=np.asarray(s)
screens=np.asarray(screens)	
print ("Mean strehl=%f SD=%f" % (s.mean(),s.std()))

i=0
res=getFocalImages(pupil,data[i][0],screens,scale=scale_f,cropPix=chip_px,photonNoise=False,expCoeff=expCoeff,processes=-1)
dt=datetime.datetime.now()
imageToFits(res,path=ddir+fits_dir,filename=data[i][2]+fits_ext,
	tel='simu',pscale=plateScale,odate=dt.strftime("%b %d, %Y"), otime=dt.strftime("%H:%M:%S.%f"),
	tint=exp_time,filter=wl)