Replies: 2 comments
-
The arguments blockThe arguments block is very useful, but it has one problem. The metadata on the arguments is not visible. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Would be nice to build a tool capable of finding a "most suitable" stellar spectrum from the AstroPack's library for a given pair of T_eff and log(g) values. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Speed performances
The following suggestions are required in order to improve MATLAB performences:
Binary operators with results stored in the input
When MATLAB performs binary operations (e.g., A+B), it always keep the original inputs and allocate memory for the output. However, BLAS and LINPACK write the result in the input. Therefore, a version of selected binary operators that stores the output in the input variable without allocating memory may be useful in some cases and save run time.
Example:
I suggest a new package 'overinput':
A = overinput.plus(A,B);
A = overinput.times(A,B);
etc.
__ This is already implelemted in MATLAB__
non-complex output functions
Many matlab functions that are defined in the complex plane may return a complex output:
For some applications, I prefer that the output will be real or NaN if imaginary.
I suggest a new package named 'nonimaginary' that will include such functions
For example:
nonimaginary.asin(-2) will return NaN
Additional functions in this package:
asin, acos, ..., log, log10,...
sincos function
A sincos function that return both the sin and cos of a number maybe useful (e.g., using the C builtin sincos function)
operations with flags
Operations on subarray selected by logicals (instead of indices) are not efficient - e.g.,
B = FUN(A(A>1)) is relatively expensive.
I guess this is related to memory allocation, but I guess you can expedite such operations.
Another related operation that can be expedited:
F = A>1
A(F) = FUN(A(F))
filter2 on 3-D arrays
It will be nice to have a function similar to filter2 (i.e., C=filter2(B,X,'same')) in which the filter (B) is a cube
and the output C is a cube in which each layer of B (e.g., B(:,:,i)) is cross-correlated with X).
I guess that a good design of such function will make it much faster than calling filter2 in a loop.
count values
A function that counts the number of appearances of some value in an array like sum(A>1) or sum(~isnan(A)), but more efficiently.
Beta Was this translation helpful? Give feedback.
All reactions