Skip to content

Commit

Permalink
Change new funcs names to improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
jeipollack committed Mar 27, 2024
1 parent faea59a commit 8e3dc09
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/wf_psf/psf_models/psf_model_semiparametric.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from tensorflow.python.keras.engine import data_adapter
from wf_psf.psf_models import psf_models as psfm
from wf_psf.psf_models import tf_layers as tfl
from wf_psf.utils.utils import tf_decompose_obscured_opd_basis
from wf_psf.utils.utils import decompose_tf_obscured_opd_basis
from wf_psf.psf_models.tf_layers import (
TFBatchPolychromaticPSF,
TFBatchMonochromaticPSF,
Expand Down Expand Up @@ -358,7 +358,7 @@ def project_DD_features(self, tf_zernike_cube=None):
np.transpose(
np.array(
[
tf_decompose_obscured_opd_basis(
decompose_tf_obscured_opd_basis(
tf_opd=inter_res_v2[j, :, :],
tf_obscurations=self.obscurations,
tf_zk_basis=tf_zernike_cube,
Expand Down
16 changes: 9 additions & 7 deletions src/wf_psf/tests/test_utils/utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@
import pytest
import tensorflow as tf
import numpy as np
from wf_psf.utils.utils import zernike_generator
from wf_psf.utils.utils import (
zernike_generator,
compute_unobscured_zernike_projection,
decompose_tf_obscured_opd_basis
)
from wf_psf.sims.psf_simulator import PSFSimulator


def test_unobscured_zernike_projection():
from wf_psf.utils.utils import unobscured_zernike_projection

n_zernikes = 20
wfe_dim = 256
Expand All @@ -41,14 +44,14 @@ def test_unobscured_zernike_projection():
)

# Compute normalisation factor
norm_factor = unobscured_zernike_projection(
norm_factor = compute_unobscured_zernike_projection(
tf_zernike_cube[0, :, :], tf_zernike_cube[0, :, :]
)

# Compute projections for each zernike
estimated_zk_array = np.array(
[
unobscured_zernike_projection(
compute_unobscured_zernike_projection(
tf_unobscured_opd, tf_zernike_cube[j, :, :], norm_factor=norm_factor
)
for j in range(n_zernikes)
Expand All @@ -61,8 +64,7 @@ def test_unobscured_zernike_projection():


def test_tf_decompose_obscured_opd_basis():
from wf_psf.utils.utils import tf_decompose_obscured_opd_basis


n_zernikes = 20
wfe_dim = 256
tol = 1e-5
Expand Down Expand Up @@ -95,7 +97,7 @@ def test_tf_decompose_obscured_opd_basis():
)

# Compute zernike array from OPD
obsc_coeffs = tf_decompose_obscured_opd_basis(
obsc_coeffs = decompose_tf_obscured_opd_basis(
tf_opd=tf_obscured_opd,
tf_obscurations=tf_obscurations,
tf_zk_basis=tf_zernike_cube,
Expand Down

0 comments on commit 8e3dc09

Please sign in to comment.