-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create setup mechanism and optimize imports
This commit introduces a setup mechanism based on setuptools. As a result, it is now geared to being used as an installed package. The imports have been modified/simplified to work with this new paradigm; import optimization has also been done in an effort to simplify and standardize the code structure. The __load__opao.py files for configuring the path are no longer required and have been removed; the MKL availability check and additional functionality present in those files has been moved to the top level __init__.py. The tutorials have also been modified to work with this new approach. Instructions for installing this package have been added to the README file.
- Loading branch information
1 parent
66c6195
commit d1768da
Showing
60 changed files
with
10,344 additions
and
10,683 deletions.
There are no files selected for viewing
7 changes: 0 additions & 7 deletions
7
AO_modules/mis_registration_identification_algorithm/__init__.py
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
1,422 changes: 712 additions & 710 deletions
1,422
AO_modules/Atmosphere.py → OOPAO/Atmosphere.py
100755 → 100644
Large diffs are not rendered by default.
Oops, something went wrong.
857 changes: 429 additions & 428 deletions
857
AO_modules/DeformableMirror.py → OOPAO/DeformableMirror.py
100755 → 100644
Large diffs are not rendered by default.
Oops, something went wrong.
83 changes: 43 additions & 40 deletions
83
AO_modules/Detector.py → OOPAO/Detector.py
100755 → 100644
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,44 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Created on Mon Feb 24 14:37:29 2020 | ||
@author: cheritie | ||
""" | ||
|
||
import numpy as np | ||
import inspect | ||
class Detector: | ||
def __init__(self,nRes,readoutNoise=0,photonNoise=0,QE=1): | ||
self.resolution=nRes | ||
self.QE=1 | ||
self.readoutNoise=readoutNoise | ||
self.photonNoise=photonNoise | ||
self.frame=np.zeros([nRes,nRes]) | ||
self.tag='detector' | ||
|
||
def rebin(self,arr, new_shape): | ||
shape = (new_shape[0], arr.shape[0] // new_shape[0], | ||
new_shape[1], arr.shape[1] // new_shape[1]) | ||
out = (arr.reshape(shape).mean(-1).mean(1)) * (arr.shape[0] // new_shape[0]) * (arr.shape[1] // new_shape[1]) | ||
return out | ||
|
||
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% END %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
def show(self): | ||
attributes = inspect.getmembers(self, lambda a:not(inspect.isroutine(a))) | ||
print(self.tag+':') | ||
for a in attributes: | ||
if not(a[0].startswith('__') and a[0].endswith('__')): | ||
if not(a[0].startswith('_')): | ||
if not np.shape(a[1]): | ||
tmp=a[1] | ||
try: | ||
print(' '+str(a[0])+': '+str(tmp.tag)+' object') | ||
except: | ||
print(' '+str(a[0])+': '+str(a[1])) | ||
else: | ||
if np.ndim(a[1])>1: | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Created on Mon Feb 24 14:37:29 2020 | ||
@author: cheritie | ||
""" | ||
|
||
import inspect | ||
|
||
import numpy as np | ||
|
||
|
||
class Detector: | ||
def __init__(self,nRes,readoutNoise=0,photonNoise=0,QE=1): | ||
self.resolution=nRes | ||
self.QE=1 | ||
self.readoutNoise=readoutNoise | ||
self.photonNoise=photonNoise | ||
self.frame=np.zeros([nRes,nRes]) | ||
self.tag='detector' | ||
|
||
def rebin(self,arr, new_shape): | ||
shape = (new_shape[0], arr.shape[0] // new_shape[0], | ||
new_shape[1], arr.shape[1] // new_shape[1]) | ||
out = (arr.reshape(shape).mean(-1).mean(1)) * (arr.shape[0] // new_shape[0]) * (arr.shape[1] // new_shape[1]) | ||
return out | ||
|
||
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% END %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
def show(self): | ||
attributes = inspect.getmembers(self, lambda a:not(inspect.isroutine(a))) | ||
print(self.tag+':') | ||
for a in attributes: | ||
if not(a[0].startswith('__') and a[0].endswith('__')): | ||
if not(a[0].startswith('_')): | ||
if not np.shape(a[1]): | ||
tmp=a[1] | ||
try: | ||
print(' '+str(a[0])+': '+str(tmp.tag)+' object') | ||
except: | ||
print(' '+str(a[0])+': '+str(a[1])) | ||
else: | ||
if np.ndim(a[1])>1: | ||
print(' '+str(a[0])+': '+str(np.shape(a[1]))) |
13 changes: 6 additions & 7 deletions
13
AO_modules/closed_loop/__init__.py → OOPAO/M4_model/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Created on Fri Apr 3 10:56:59 2020 | ||
@author: cheritie | ||
""" | ||
|
||
# -*- coding: utf-8 -*- | ||
""" | ||
Created on Fri Apr 3 10:56:59 2020 | ||
@author: cheritie | ||
""" |
Oops, something went wrong.