Skip to content
Snippets Groups Projects
Commit 1f416750 authored by rfetick's avatar rfetick
Browse files

Add phasemask shift

parent b19f2653
No related branches found
No related tags found
No related merge requests found
......@@ -6,5 +6,8 @@ nact: 39
name: MUSE_NFM
occ: 0.14
phasemask_path: null
phasemask_shift: !!python/tuple
- 0.0
- 0.0
res: 1.1977272727272726e-07
ron: 15.0
......@@ -12,5 +12,8 @@ nact: 40
name: ZIMPOL
occ: 0.14
phasemask_path: null
phasemask_shift: !!python/tuple
- 0.0
- 0.0
res: 1.69683257918552e-08
ron: 20.0
......@@ -29,6 +29,7 @@ def load(name):
instru.fullname = d['fullname']
instru.filters = d['filters']
instru.phasemask_path = d['phasemask_path']
instru.phasemask_shift = d['phasemask_shift']
return instru
#%% INSTRUMENT CLASS
......@@ -75,9 +76,10 @@ class Instrument(object):
self.name = "default" # unique identifier name
self.fullname = "MAOPPY Instrument" # human readable name
# phasemask (not used yet)
# phasemask (not tested yet)
self.phasemask_enable = False
self.phasemask_path = None
self.phasemask_shift = (0.0,0.0)
self._phasemask = None
def __repr__(self):
......@@ -117,8 +119,9 @@ class Instrument(object):
x = np.arange(p.shape[0])/p.shape[0]
y = np.arange(p.shape[1])/p.shape[1]
self._phasemask = interp2d(x,y,p)
x = np.arange(Npix[0])/Npix[0] - 0.5/Npix[0]
y = np.arange(Npix[1])/Npix[1] - 0.5/Npix[1]
cx,cy = self.phasemask_shift
x = np.arange(Npix[0])/Npix[0] - cx/Npix[0]
y = np.arange(Npix[1])/Npix[1] - cy/Npix[1]
wf = self._phasemask(x,y)
if wvl is None: wvl = self.wvl(samp) # samp must be defined if wvl is None
wf = np.exp(2j*np.pi/wvl*wf)
......@@ -147,6 +150,7 @@ class Instrument(object):
data['nact'] = self.Nact
data['filters'] = self.filters
data['phasemask_path'] = self.phasemask_path
data['phasemask_shift'] = self.phasemask_shift
with open(filename,'w') as f: yaml.dump(data,f)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment