Skip to content

Commit

Permalink
adding further ideas for optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasValentin committed Nov 17, 2023
1 parent 5908f55 commit a3e47f5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rtm_inv/core/inversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def inv_img(
elif cost_function == 'mae':
delta[idx] = np.sum(np.abs(image_ref - lut[idx, :]))
elif cost_function == 'contrast_function':
# TODO: use np.diff
delta[idx] = np.sum(
-np.log10(lut[idx, :] / image_ref) + lut[idx, :] /
image_ref
Expand Down Expand Up @@ -162,6 +163,7 @@ def _retrieve_traits(
q05_img[:, row, col] = np.nan
q95_img[:, row, col] = np.nan
continue
# TODO: cast to Fortran-styled array to speed up operations?
trait_vals_n_solutions = trait_values[lut_idxs[:, row, col], :]
for trait_idx in range(trait_values.shape[1]):
if measure == 'MEDIAN':
Expand Down

0 comments on commit a3e47f5

Please sign in to comment.