Skip to content

Conversions Module arithmetic operator precedence issue #21

@cbowers1020

Description

@cbowers1020

In the conversions module file conversions.py, there are many examples of using multiple division operators to achieve the final form of an equation (e.g., freespace loss).

In the case of the free_space_loss calculation (method: _free_space_loss), (C_VALUE / 4. / np.pi / f / d) ** 2 != (4 * np.pi * f * d) / C_VALUE) ** 2 (a more human readable format. Though the pycraf implementation ((C_VALUE / 4. / np.pi / f / d) ** 2) is mathematically correct, python does NOT evaluate the operators correctly. I have remedied this error locally, but I suspect (though have not verified) that the following methods in conversions.py are additionally affected by this mathematical implementation:

  • iso_eff_area
  • gamma_from_eff_area
  • eff_area_from_gain
  • antfactor_from_gain
  • efield_from_ptx
  • powerflux_from_ptx
  • powerflux_from_prx
  • prx_from_powerflux
  • t_a_from_prx_nu
  • t_a_from_powerflux_nu
  • prx_from_ptx
  • ptx_from_prx

This error does not affect any pyprop implementations and free space loss using that method reflects the actual calculation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions