brandondube / prysm

physical optics: integrated modeling, phase retrieval, segmented systems, polynomials and fitting, sequential raytracing...
https://prysm.readthedocs.io/en/stable/
MIT License
269 stars 46 forks source link

use asarray instead of array #67

Closed brandondube closed 3 years ago

brandondube commented 3 years ago

Profiling for Roman-CGI found a surprising amount of time occupied by np.array, which is in places like sum_of_2d_modes to make lists and arrays both work on GPU. array will always copy data, while asarray will not if something is already an array. We should use asarray instead.