emccd-detect 2.3.0__py3-none-any.whl → 2.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- emccd_detect/__init__.py +1 -1
- emccd_detect/emccd_detect.py +116 -42
- emccd_detect/nonlinearity.py +2 -0
- emccd_detect-2.4.0.dist-info/METADATA +72 -0
- {emccd_detect-2.3.0.dist-info → emccd_detect-2.4.0.dist-info}/RECORD +7 -7
- {emccd_detect-2.3.0.dist-info → emccd_detect-2.4.0.dist-info}/WHEEL +1 -1
- emccd_detect-2.3.0.dist-info/METADATA +0 -69
- {emccd_detect-2.3.0.dist-info → emccd_detect-2.4.0.dist-info}/top_level.txt +0 -0
emccd_detect/__init__.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
__version__ = '2.
|
2
|
+
__version__ = '2.4.0'
|
emccd_detect/emccd_detect.py
CHANGED
@@ -12,7 +12,7 @@ from emccd_detect.rand_em_gain import rand_em_gain
|
|
12
12
|
from emccd_detect.nonlinearity import apply_relgains
|
13
13
|
from emccd_detect.util.read_metadata_wrapper import MetadataWrapper
|
14
14
|
try:
|
15
|
-
from arcticpy import add_cti, CCD, ROE,
|
15
|
+
from arcticpy import add_cti, CCD, ROE, TrapInstantCapture
|
16
16
|
except:
|
17
17
|
pass
|
18
18
|
|
@@ -94,12 +94,15 @@ class EMCCDDetectBase:
|
|
94
94
|
self.numel_gain_register = numel_gain_register
|
95
95
|
|
96
96
|
# Placeholders for trap parameters
|
97
|
-
self.
|
98
|
-
self.
|
99
|
-
self.
|
100
|
-
self.
|
101
|
-
self.
|
102
|
-
self.
|
97
|
+
self.parallel_ccd = None
|
98
|
+
self.parallel_roe = None
|
99
|
+
self.parallel_traps = None
|
100
|
+
self.parallel_express = None
|
101
|
+
self.serial_ccd = None
|
102
|
+
self.serial_roe = None
|
103
|
+
self.serial_traps = None
|
104
|
+
self.serial_express = None
|
105
|
+
|
103
106
|
|
104
107
|
# Placeholders for derived values
|
105
108
|
self.mean_expected_rate = None
|
@@ -123,36 +126,72 @@ class EMCCDDetectBase:
|
|
123
126
|
try:
|
124
127
|
def update_cti(
|
125
128
|
self,
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
129
|
+
parallel_ccd=None,
|
130
|
+
parallel_roe=None,
|
131
|
+
parallel_traps=None,
|
132
|
+
parallel_express=1,
|
133
|
+
serial_ccd=None,
|
134
|
+
serial_roe=None,
|
135
|
+
serial_traps=None,
|
136
|
+
serial_express=1,
|
137
|
+
parallel=True,
|
138
|
+
serial=True,
|
139
|
+
**kwargs # any other arguments that arcticpy.add_cti() might accept
|
132
140
|
):
|
141
|
+
'''See arcticpy documentation for details on parameters. Any arguments
|
142
|
+
not explicitly listed here can be handed to arcticpy.add_cti() via
|
143
|
+
kwargs.
|
144
|
+
|
145
|
+
Parallel and serial CTI can each be switched on or off via the
|
146
|
+
"parallel" and "serial" arguments of this function. True means that
|
147
|
+
type of CTI is simulated. Both are True by default.'''
|
133
148
|
# Update parameters
|
134
|
-
self.
|
135
|
-
self.
|
136
|
-
self.
|
137
|
-
|
138
|
-
self.
|
139
|
-
self.
|
140
|
-
self.
|
149
|
+
self.parallel_ccd = parallel_ccd
|
150
|
+
self.parallel_roe = parallel_roe
|
151
|
+
self.parallel_traps = parallel_traps
|
152
|
+
self.parallel_express = parallel_express
|
153
|
+
self.serial_ccd = serial_ccd
|
154
|
+
self.serial_roe = serial_roe
|
155
|
+
self.serial_traps = serial_traps
|
156
|
+
self.serial_express = serial_express
|
157
|
+
self.kwargs = kwargs
|
158
|
+
self.parallel = parallel
|
159
|
+
self.serial = serial
|
141
160
|
|
142
161
|
# Instantiate defaults for any class instances not provided
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
162
|
+
|
163
|
+
if parallel_ccd is None:
|
164
|
+
self.parallel_ccd = CCD()
|
165
|
+
if parallel_roe is None:
|
166
|
+
self.parallel_roe = ROE()
|
167
|
+
if parallel_traps is None:
|
148
168
|
#self.traps = [Trap()]
|
149
|
-
self.
|
169
|
+
self.parallel_traps = [TrapInstantCapture()]
|
170
|
+
if self.parallel is False: # overrides
|
171
|
+
self.parallel_ccd = None
|
172
|
+
self.parallel_roe = None
|
173
|
+
self.parallel_traps = None
|
174
|
+
|
175
|
+
if serial_ccd is None:
|
176
|
+
self.serial_ccd = CCD()
|
177
|
+
if serial_roe is None:
|
178
|
+
self.serial_roe = ROE()
|
179
|
+
if serial_traps is None:
|
180
|
+
self.serial_traps = [TrapInstantCapture()]
|
181
|
+
if self.serial is False: #overrides
|
182
|
+
self.serial_ccd = None
|
183
|
+
self.serial_roe = None
|
184
|
+
self.serial_traps = None
|
150
185
|
|
151
186
|
def unset_cti(self):
|
187
|
+
'''This turns off all CTI implementation.'''
|
152
188
|
# Remove CTI simulation
|
153
|
-
self.
|
154
|
-
self.
|
155
|
-
self.
|
189
|
+
self.parallel_ccd = None
|
190
|
+
self.parallel_roe = None
|
191
|
+
self.parallel_traps = None
|
192
|
+
self.serial_ccd = None
|
193
|
+
self.serial_roe = None
|
194
|
+
self.serial_traps = None
|
156
195
|
except:
|
157
196
|
pass
|
158
197
|
|
@@ -225,16 +264,26 @@ class EMCCDDetectBase:
|
|
225
264
|
|
226
265
|
def clock_parallel(self, actualized_e):
|
227
266
|
# Only add CTI if update_cti has been called
|
228
|
-
if self.
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
267
|
+
if self.parallel_ccd is not None and self.parallel_roe is not None and self.parallel_traps is not None:
|
268
|
+
try:
|
269
|
+
parallel_counts = add_cti(
|
270
|
+
actualized_e.copy(),
|
271
|
+
parallel_roe=self.parallel_roe,
|
272
|
+
parallel_ccd=self.parallel_ccd,
|
273
|
+
parallel_traps=self.parallel_traps,
|
274
|
+
parallel_express=self.parallel_express,
|
275
|
+
**self.kwargs
|
276
|
+
)
|
277
|
+
except:
|
278
|
+
parallel_counts = add_cti(
|
279
|
+
actualized_e.copy(),
|
280
|
+
parallel_roe=self.parallel_roe,
|
281
|
+
parallel_ccd=self.parallel_ccd,
|
282
|
+
parallel_traps=self.parallel_traps,
|
283
|
+
parallel_express=self.parallel_express,
|
284
|
+
parallel_window_range=0,
|
285
|
+
**self.kwargs
|
286
|
+
)
|
238
287
|
else:
|
239
288
|
parallel_counts = actualized_e
|
240
289
|
|
@@ -242,12 +291,37 @@ class EMCCDDetectBase:
|
|
242
291
|
|
243
292
|
def clock_serial(self, actualized_e_full, empty_element_m):
|
244
293
|
# Actualize cic electrons in prescan and overscan pixels
|
245
|
-
# XXX Another place where we are fudging a little
|
294
|
+
# XXX Another place where we are fudging a little as far as the order of operations(?)
|
246
295
|
actualized_e_full[empty_element_m] = np.random.poisson(actualized_e_full[empty_element_m]
|
247
296
|
+ self.cic)
|
248
|
-
|
297
|
+
|
298
|
+
# add serial CTI; the addition of CIC (serial and parallel) is really
|
299
|
+
# *during* the addition of CTI, but this corrective effect would not be very significant
|
300
|
+
if self.serial_ccd is not None and self.serial_roe is not None and self.serial_traps is not None:
|
301
|
+
try:
|
302
|
+
cti_actualized_e_full = add_cti(
|
303
|
+
actualized_e_full.copy(),
|
304
|
+
serial_roe=self.serial_roe,
|
305
|
+
serial_ccd=self.serial_ccd,
|
306
|
+
serial_traps=self.serial_traps,
|
307
|
+
serial_express=self.serial_express,
|
308
|
+
**self.kwargs
|
309
|
+
)
|
310
|
+
except:
|
311
|
+
cti_actualized_e_full = add_cti(
|
312
|
+
actualized_e_full.copy(),
|
313
|
+
serial_roe=self.serial_roe,
|
314
|
+
serial_ccd=self.serial_ccd,
|
315
|
+
serial_traps=self.serial_traps,
|
316
|
+
serial_express=self.serial_express,
|
317
|
+
serial_window_range=0,
|
318
|
+
**self.kwargs
|
319
|
+
)
|
320
|
+
else:
|
321
|
+
cti_actualized_e_full = actualized_e_full
|
322
|
+
|
249
323
|
# Flatten row by row
|
250
|
-
actualized_e_full_flat =
|
324
|
+
actualized_e_full_flat = cti_actualized_e_full.ravel()
|
251
325
|
|
252
326
|
# Clock electrons through serial register elements
|
253
327
|
serial_counts = self._serial_register_elements(actualized_e_full_flat)
|
emccd_detect/nonlinearity.py
CHANGED
@@ -0,0 +1,72 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: emccd_detect
|
3
|
+
Version: 2.4.0
|
4
|
+
Summary: EMCCD detector image simulation
|
5
|
+
Author: Bijan Nemati, Sam Miller, Kevin Ludwick
|
6
|
+
Author-email: bijan.nemati@tellus1.com, sam.miller@uah.edu, kevin.ludwick@uah.edu
|
7
|
+
Classifier: Development Status :: 4 - Beta
|
8
|
+
Classifier: Intended Audience :: Developers
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
10
|
+
Classifier: Programming Language :: Python :: 3.6
|
11
|
+
Classifier: Programming Language :: Python :: 3.7
|
12
|
+
Classifier: Programming Language :: Python :: 3.8
|
13
|
+
Requires-Python: >=3.6
|
14
|
+
Description-Content-Type: text/markdown
|
15
|
+
Requires-Dist: astropy
|
16
|
+
Requires-Dist: matplotlib
|
17
|
+
Requires-Dist: numpy
|
18
|
+
Requires-Dist: scipy
|
19
|
+
Requires-Dist: pynufft ==2020.0.0
|
20
|
+
Requires-Dist: pyyaml
|
21
|
+
|
22
|
+
# EMCCD Detect
|
23
|
+
|
24
|
+
Given an input fluxmap, emccd_detect will return a simulated EMCCD detector image. Website: (<https://github.com/roman-corgi/emccd_detect/tree/master/emccd_detect>)
|
25
|
+
|
26
|
+
|
27
|
+
# Version
|
28
|
+
|
29
|
+
The latest version of emccd\_detect is 2.4.0. Main differences from previous version: the ability to implement readout nonlinearity and the latest version of arcticpy for charge transfer inefficiency implementation.
|
30
|
+
|
31
|
+
|
32
|
+
## Getting Started
|
33
|
+
### Installing
|
34
|
+
|
35
|
+
This package requires Python version 3.6 or higher. If the user wants the ability to apply charge transfer inefficiency (CTI) to detector frames using the optional tool (older version of arcticpy which is pure Python) provided in emccd\_detect, then the Python version should be >=3.6 and <=3.9. If the newer version of arcticpy (wrapper around C++ code) is installed, there is no upper limit restriction for Python version. For installation instructions and documentation for the newer arcticpy, see <https://github.com/jkeger/arctic>. emccd\_detect works apart from arcticpy and does not require it.
|
36
|
+
|
37
|
+
emccd\_detect is available on PyPI.org, so the following command will install the module (without CTI capabilities):
|
38
|
+
|
39
|
+
pip install emccd-detect
|
40
|
+
|
41
|
+
To install emccd\_detect instead from this package download, after downloading, navigate to the emccd\_detect directory where setup.py is located and use
|
42
|
+
|
43
|
+
pip install .
|
44
|
+
|
45
|
+
This will install emccd\_detect and its dependencies, which are as follows:
|
46
|
+
|
47
|
+
* astropy
|
48
|
+
* matplotlib
|
49
|
+
* numpy
|
50
|
+
* scipy
|
51
|
+
* pynufft==2020.0.0
|
52
|
+
* pyyaml
|
53
|
+
|
54
|
+
To optionally implement CTI capabilities with the pure-Python arcticpy, navigate to the arcticpy directory (<https://github.com/roman-corgi/emccd_detect/tree/master/arcticpy_folder>), and there will be a file called setup.py in that directory. Use
|
55
|
+
|
56
|
+
pip install .
|
57
|
+
|
58
|
+
This will install arcticpy version 1.0. See (<https://github.com/jkeger/arcticpy/tree/row_wise/arcticpy>) for documentation. If
|
59
|
+
you have Python>3.9, the CTI functionality will not work if you are using the arcticpy installation that was included with this emccd_detect package, but everything else will work fine.
|
60
|
+
|
61
|
+
|
62
|
+
### Usage
|
63
|
+
|
64
|
+
For an example of how to use emccd\_detect, see example_script.py.
|
65
|
+
|
66
|
+
|
67
|
+
## Authors
|
68
|
+
|
69
|
+
* Bijan Nemati (<bijan.nemati@tellus1.com>)
|
70
|
+
* Sam Miller (<sam.miller@uah.edu>)
|
71
|
+
* Kevin Ludwick (<kevin.ludwick@uah.edu>)
|
72
|
+
|
@@ -1,13 +1,13 @@
|
|
1
|
-
emccd_detect/__init__.py,sha256=
|
1
|
+
emccd_detect/__init__.py,sha256=FwzLqOGO--eOgOxuK6wCfzsc5yCUneMzLELAeD7Rc7Q,45
|
2
2
|
emccd_detect/cosmics.py,sha256=wRE47QOB3fwxkH5PHTeoyLjJ0fgJki6Z8hLDPx2h3SQ,3991
|
3
|
-
emccd_detect/emccd_detect.py,sha256=
|
4
|
-
emccd_detect/nonlinearity.py,sha256=
|
3
|
+
emccd_detect/emccd_detect.py,sha256=iOLp-I6NibxJeZwmb7V5cqo5xZI3BxV5XB-1AcQLnac,26678
|
4
|
+
emccd_detect/nonlinearity.py,sha256=DWBGjoShInMXBX0BLj6lT9dlY_lx6pdn8VU84jk_djU,4938
|
5
5
|
emccd_detect/rand_em_gain.py,sha256=3eF9T7PNYFZT0coGZwBmNTYz6B9pj2lXxTR8ROG6_7Q,6297
|
6
6
|
emccd_detect/util/__init__.py,sha256=iwhKnzeBJLKxpRVjvzwiRE63_zNpIBfaKLITauVph-0,24
|
7
7
|
emccd_detect/util/metadata.yaml,sha256=hcKTg4kMy12dfbCmmvZeKEqjeUA3BYiAcZc5vZpc3bE,1149
|
8
8
|
emccd_detect/util/read_metadata.py,sha256=r511ENJ6zbIvLDWiVic7KsVXYrBphSdTKUQbuwocjLs,2764
|
9
9
|
emccd_detect/util/read_metadata_wrapper.py,sha256=oBh2KpJ-uLTSIY_hPzw8sNIcJ6MENBSf38ks8OaFOSQ,5473
|
10
|
-
emccd_detect-2.
|
11
|
-
emccd_detect-2.
|
12
|
-
emccd_detect-2.
|
13
|
-
emccd_detect-2.
|
10
|
+
emccd_detect-2.4.0.dist-info/METADATA,sha256=sX4JDwVH__aNVtFOAliynk1oLCiMwLSokSACT6noa9g,3039
|
11
|
+
emccd_detect-2.4.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
12
|
+
emccd_detect-2.4.0.dist-info/top_level.txt,sha256=V0qxOcGf8TowSJXnTxWEMuK9BBsySwhtKNitfdokD0A,13
|
13
|
+
emccd_detect-2.4.0.dist-info/RECORD,,
|
@@ -1,69 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: emccd_detect
|
3
|
-
Version: 2.3.0
|
4
|
-
Summary: EMCCD detector image simulation
|
5
|
-
Home-page: https://github.jpl.nasa.gov/WFIRST-CGI/emccd_detect
|
6
|
-
Author: Bijan Nemati, Sam Miller, Kevin Ludwick
|
7
|
-
Author-email: bijan.nemati@tellus1.com, sam.miller@uah.edu, kevin.ludwick@uah.edu
|
8
|
-
Classifier: Development Status :: 4 - Beta
|
9
|
-
Classifier: Intended Audience :: Developers
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
11
|
-
Classifier: Programming Language :: Python :: 3.6
|
12
|
-
Classifier: Programming Language :: Python :: 3.7
|
13
|
-
Classifier: Programming Language :: Python :: 3.8
|
14
|
-
Requires-Python: >=3.6
|
15
|
-
Description-Content-Type: text/markdown
|
16
|
-
Requires-Dist: astropy
|
17
|
-
Requires-Dist: matplotlib
|
18
|
-
Requires-Dist: numpy
|
19
|
-
Requires-Dist: scipy
|
20
|
-
Requires-Dist: pynufft ==2020.0.0
|
21
|
-
Requires-Dist: pyyaml
|
22
|
-
|
23
|
-
# EMCCD Detect
|
24
|
-
|
25
|
-
Given an input fluxmap, emccd_detect will return a simulated EMCCD detector image. Website: (<https://github.com/roman-corgi/emccd_detect/tree/master/emccd_detect>)
|
26
|
-
|
27
|
-
|
28
|
-
# Version
|
29
|
-
|
30
|
-
The latest version of emccd\_detect is 2.3.0.
|
31
|
-
|
32
|
-
|
33
|
-
## Getting Started
|
34
|
-
### Installing
|
35
|
-
|
36
|
-
This package requires Python version 3.6 or higher. If the user wants the ability to apply charge transfer inefficiency (CTI) to detector frames using the optional tool provided in emccd\_detect, then the Python version should be >=3.6 and <=3.9.
|
37
|
-
|
38
|
-
To install emccd\_detect, navigate to the emccd\_detect directory where setup.py is located and use
|
39
|
-
|
40
|
-
pip install .
|
41
|
-
|
42
|
-
This will install emccd\_detect and its dependencies, which are as follows:
|
43
|
-
|
44
|
-
* astropy
|
45
|
-
* matplotlib
|
46
|
-
* numpy
|
47
|
-
* scipy
|
48
|
-
* pynufft==2020.0.0
|
49
|
-
* pyyaml
|
50
|
-
|
51
|
-
To optionally implement CTI capabilities, navigate to the arcticpy directory (<https://github.com/roman-corgi/emccd_detect/tree/master/arcticpy_folder>), and there will be a file called setup.py in that directory. Use
|
52
|
-
|
53
|
-
pip install .
|
54
|
-
|
55
|
-
This will install arcticpy version 1.0, which is an older version of arcticpy which runs purely on Python (<https://github.com/jkeger/arcticpy/tree/row_wise/arcticpy>). If
|
56
|
-
you have Python>=3.10, the CTI functionality will not work if you are using the arcticpy installation that was included with this emccd_detect package, but everything else will work fine.
|
57
|
-
|
58
|
-
|
59
|
-
### Usage
|
60
|
-
|
61
|
-
For an example of how to use emccd\_detect, see example_script.py.
|
62
|
-
|
63
|
-
|
64
|
-
## Authors
|
65
|
-
|
66
|
-
* Bijan Nemati (<bijan.nemati@tellus1.com>)
|
67
|
-
* Sam Miller (<sam.miller@uah.edu>)
|
68
|
-
* Kevin Ludwick (<kevin.ludwick@uah.edu>)
|
69
|
-
|
File without changes
|