Skip to content

Commit

Permalink
clarified variable name in excitation function, and corrected bug in …
Browse files Browse the repository at this point in the history
…discrete_transmit_power which strips out polarization vector.
  • Loading branch information
LyceanEM committed Oct 11, 2024
1 parent 06d3bcd commit 7b67d10
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lyceanem/base_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,10 +474,10 @@ def excitation_function(
areas = np.zeros((aperture_points.points.shape[0]))
areas[:] = (wavelength * 0.5) ** 2

calibrated_amplitude_density = discrete_transmit_power(
calibrated_amplitude_weights = discrete_transmit_power(
aperture_weights, areas, transmit_power
)
return calibrated_amplitude_density
return calibrated_amplitude_weights

def export_all_structures(self):
objects = copy.deepcopy(self.structures.solids)
Expand Down
6 changes: 5 additions & 1 deletion lyceanem/utility/math_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,12 @@ def discrete_transmit_power(
) / element_area.reshape(-1, 1)
# calculate amplitude (V/m)
transmit_amplitude = ((transmit_power_density * impedance) ** 0.5)*element_area.reshape(-1,1)

polarized_amplitudes=(weights/np.linalg.norm(weights, axis=1).reshape(
-1, 1
))*transmit_amplitude
# transmit_excitation=transmit_amplitude_density.reshape(-1,1)*element_area.reshape(-1,1)
return transmit_amplitude
return polarized_amplitudes


@guvectorize(
Expand Down

0 comments on commit 7b67d10

Please sign in to comment.