Skip to content

df_functions.py coordinate conversion error in AtmosphericModel function. #3

Description

@Obsywobsy

I noticed that the curent version of the master branch (13/09/2025) doesn't work because wind data position coordinates are converted from ECEF to LLH and then from ECEF to LLH again. (l. 76 - 79)

 #   Pos_LLH = ECEF2LLH(Pos_ECI) # There is a max of +-40m height error here
    Pos_ECEF = ECEF2LLH(Pos_ECI)
    Pos_LLH = ECEF2LLH(Pos_ECEF)
    h = float(Pos_LLH[2]) # (m)

The correct procedure is to convert only once using ECEF2LLH:

    Pos_LLH = ECEF2LLH(Pos_ECI) # There is a max of +-40m height error here
    h = float(Pos_LLH[2]) # (m)

The confusion arises because apparently there is a need to change the ECI vector into the ECEF frame before assigning LLH coordinates. This would have to be done instead by using:

    Pos_ECEF = ECI2ECEF_pos(Pos_ECI, t_jd)

This step is erroneous, as in this part of the code all coordinates remain in ECI, presumably to avoid coriolis forces in the calculations. The Lat, Long, Height are therefore relative to the ECI frame, the "longitude" is not terrestrial longitude, but measured from the first point of Aries. There is no ECI2LLH function available, but ECEF2LLH works the same for this purpose since no time input is required in a non rotating frame.

The branch for the Winchcombe event has the correct form of this code.

For a couple of events I have tried, the effect is to place the heights well outside the wind profile height envelope, causing all values to default to the lowest height values. The modelled particles drop through sea surface density air and are very quickly arrested, falling close to the release point.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions