Open JamesMCannon opened 5 months ago
This would be tricky to make consistent. The fields are only calculated at the distance
s defined by the GroundSampler
. The phase of each field component is then calculated and for convenience unwrapped along the distance trace. The unwrapping algorithm uses the previous phase to determine the current phase - the specific value depends upon the previous values. In order to guarantee consistent results when there are only a few phases calculated, I would need to calculate the fields and phases at higher resolution, unwrap, and then only return the phases at distances defined by the GroundSampler
. If it's necessary to compare phases calculated from different distance traces, I'd recommend either mod2pi
of the results or calculating phase directly from the fields.
You may have also noticed the mod2pi phases are not exactly equal at the same distances (different in the hundreths of a degree). This is actually due to the fields themselves being slightly different, which is a known issue that I think is traced to the mode solver and more specifically the Delaunay triangulation. I have been working on an update to the mode solver that uses a newer triangulation package that I'm hoping is more efficient and consistent.
Yeah on a bigger picture, this is one I've gone back and forth on whether this is an enhancement that would be useful or whether this is actually fine behavior that could maybe be documented and left to users to work with. From the perspective of someone working with data from receivers, certainly a lot of the time I have the same ambiguity, having a single measurement along the waveguide ground track. However, looking at the way phase changes over the course of a day, where I can directly track the previous phase measurement, I regularly see situations where phase climbs greater than pi or sometimes even greater than 2 or 3pi. In those cases, it's useful to have the 'true' phase from the LMP to compare to.
Regardless, an easy work-around that I've been using is to just define the GroundSampler
more finely (I'm using every 50km) and then only saving the data for the fields at the final point in the sampler.
On my side of things I've been comparing data to simulations for NLK to determine the transmit power of NLK, so I haven't looked at specifically comparing phase data to LMP simulations just yet. When I do (hopefully in the next week), I may form a different opinion about this (non)issue.
When setting up a GroundSampler, if a single (or set of few) distance(s) is provided (at range for a rx for instance), the phase returned by "propagate()" may be ambiguous by multiples of 2pi radians.![PhaseTestPlot](https://github.com/fgasdia/LongwaveModePropagator.jl/assets/87723939/23ba970c-1c6c-496c-9f8e-0552fe2515c5)
Code used to generate this figure: