Skip to content

Commit

Permalink
include gaussian mode in logamp calcs
Browse files Browse the repository at this point in the history
  • Loading branch information
ojdf committed Sep 2, 2024
1 parent 5a5c62d commit 3da410b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions fast/fast.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ def init_frequency_grid(self):
logger.warning(f"Current value: {self.Npxls}")
logger.warning(f"Recommended value: {temporal_Npxls}")

if self.Npxls > 2048:
logger.warning(f"NPXLS is large ({self.Npxls}) and may cause very high memory usage")

self.Npxls_pup = int(numpy.ceil(self.D_ground/self.dx)) + 2

self.freq = SpatialFrequencies(self.Npxls, self.dx)
Expand Down Expand Up @@ -378,7 +381,7 @@ def init_pupil_mask(self):
self.pupil_mode_sat, self.W0_sat = funcs.compute_gaussian_mode(self.pupil_sat, self.dx_sat, "opt", ptype="gauss")


self.pupil_filter = funcs.pupil_filter(self.freq.main, self.pupil, spline=False)
self.pupil_filter = funcs.pupil_filter(self.freq.main, self.pupil * self.pupil_mode, spline=False)

# Cut out only the actual pupil
self.pup_coords = numpy.array((numpy.arange((self.Npxls-self.Npxls_pup)//2,(self.Npxls+self.Npxls_pup)//2), numpy.arange((self.Npxls-self.Npxls_pup)//2,(self.Npxls+self.Npxls_pup)//2))).astype(int)
Expand All @@ -394,8 +397,9 @@ def init_pupil_mask(self):
N_req = int(2*numpy.ceil(2*numpy.pi/(self.freq.main.df * dx_req)/2)) # ensure even

pupil_temporal = funcs.compute_pupil(N_req, dx_req, self.D_ground, self.obsc_ground, Ny=2*self.Npxls_pup)
mode_temporal, _ = funcs.compute_gaussian_mode(pupil_temporal, dx_req, W0=self.W0, ptype="gauss")
self.freq.make_logamp_freqs(Nx=N_req, dx=dx_req, Ny=2*self.Npxls_pup, dy=self.dx)
self.pupil_filter_temporal = funcs.pupil_filter(self.freq.logamp, pupil_temporal, spline=True)
self.pupil_filter_temporal = funcs.pupil_filter(self.freq.logamp, pupil_temporal * mode_temporal, spline=True)

# self.smf = self.params['SMF']
# self.fibre_efield = 1.
Expand Down

0 comments on commit 3da410b

Please sign in to comment.