Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding dispersion error to load_errors.py #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions heeps/wavefront/load_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,17 @@ def load_errors(nframes=20, nstep=1, npupil=285, add_phase=True, f_phase='',
amp_screens = np.array([None]*nscreens)

# load pointing errors (in mas)
if conf['disp'] is True:
dispersion = os.path.join(dir_temp, 'dispersion_vals.fits')
disp = np.array(fits.getdata(dispersion), ndmin= 2)
if len(disp) > 1: # cube
disp = disp[:nframes][::nstep]
if verbose is True:
print("Load dispersion values '%s'"%os.path.basename(dispersion))
print(' nscreens=%s'%(len(disp)))
else:
disp = np.zeros((nscreens,2))#np.array([None]*nscreens)

if add_point_err is True:
tiptilts = np.array(fits.getdata(f_point_err), ndmin= 2)
if len(tiptilts) > 1: # cube
Expand All @@ -88,7 +99,7 @@ def load_errors(nframes=20, nstep=1, npupil=285, add_phase=True, f_phase='',
print("Load pointing errors from '%s'"%os.path.basename(f_point_err))
print(' nscreens=%s'%(len(tiptilts)))
else:
tiptilts = np.array([None]*nscreens)
tiptilts = np.zeros((nscreens,2))#np.array([None]*nscreens)

# load apodizer drift
if add_apo_drift is True and 'RAVC' in conf['mode']:
Expand All @@ -110,4 +121,4 @@ def load_errors(nframes=20, nstep=1, npupil=285, add_phase=True, f_phase='',
else:
ls_misaligns = np.array([ls_misalign]*nscreens) # constant misalignment

return phase_screens, amp_screens, tiptilts, apo_misaligns, ls_misaligns
return phase_screens, amp_screens, tiptilts+disp, apo_misaligns, ls_misaligns