Opened 8 years ago

Closed 7 years ago

#457 closed enhancement (fixed)

Introduce wave optics propagator tool (WOPT)

Reported by: cburrows Owned by: cburrows
Priority: major Milestone: 9.0
Component: ropp_pp Version: 8.0
Keywords: Cc: Ian Culverwell, sti, cburrows

Description

This branch includes the developments of a wave optics propagator that is intended to become part of the ropp_pp module. This takes a vertical refractivity profile as input and simulates the phase and amplitude values that such an atmosphere would produce for a fixed GNSS and a LEO in a circular orbit.

Attachments (21)

CASE_07_excess_phase.png (20.7 KB ) - added by Ian Culverwell 8 years ago.
CASE_07_excess_phase.png
CASE_07_SNR.png (22.3 KB ) - added by Ian Culverwell 8 years ago.
CASE_07_SNR.png
CASE_07_excess_phase_diff.png (20.4 KB ) - added by Ian Culverwell 8 years ago.
CASE_07_excess_phase_diff.png
CASE_07_SNR_diff.png (20.8 KB ) - added by Ian Culverwell 8 years ago.
CASE_07_SNR_diff.png
CASE_07_refrac_diff.png (23.0 KB ) - added by Ian Culverwell 8 years ago.
CASE_07_refrac_diff.png
CASE_07_bangle_diff.png (22.9 KB ) - added by Ian Culverwell 8 years ago.
CASE_07_bangle_diff.png
CASE_12_excess_phase_diff.png (21.1 KB ) - added by Ian Culverwell 8 years ago.
CASE_12_excess_phase_diff.png
CASE_12_SNR_diff.png (20.8 KB ) - added by Ian Culverwell 8 years ago.
CASE_12_SNR_diff.png
it_wopt_02_CASE_07_nsmooth=8.jpg (55.2 KB ) - added by Ian Culverwell 8 years ago.
it_wopt_02_CASE_07_nsmooth=8.jpg
CASE_07_excess_phase_diff_nsmooth=8.png (21.0 KB ) - added by Ian Culverwell 8 years ago.
CASE_07_excess_phase_diff_nsmooth=8.png
CASE_07_SNR_diff_nsmooth=8.png (20.8 KB ) - added by Ian Culverwell 8 years ago.
CASE_07_SNR_diff_nsmooth=8.png
ropp_pp_comp_CASE_12_idc_1.0E-5.jpg (52.5 KB ) - added by Ian Culverwell 8 years ago.
ropp_pp_comp_CASE_12_idc_1.0E-5.jpg
ropp_pp_comp_CASE_12_idc_1.0E-6.jpg (52.9 KB ) - added by Ian Culverwell 8 years ago.
ropp_pp_comp_CASE_12_idc_1.0E-6.jpg
ropp_pp_comp_CASE_12_sbh.jpg (52.9 KB ) - added by Ian Culverwell 8 years ago.
ropp_pp_comp_CASE_12_sbh.jpg
ropp_pp_wopt_tool_out_CASE_12_occ_idc.out-ropp_pp_wopt_tool_out_CASE_12_occ_sbh.out.png (240.4 KB ) - added by Ian Culverwell 8 years ago.
ropp_pp_wopt_tool_out_CASE_12_occ_idc.out-ropp_pp_wopt_tool_out_CASE_12_occ_sbh.out.png
ropp_pp_comp_CASE_12_idc_1.0E-5_SBH_params.jpg (51.1 KB ) - added by Ian Culverwell 8 years ago.
ropp_pp_comp_CASE_12_idc_1.0E-5_SBH_params.jpg
ropp_pp_wopt_tool_out_CASE_12_occ_idc_SBH_params.out-ropp_pp_wopt_tool_out_CASE_12_occ_sbh.out.png (184.3 KB ) - added by Ian Culverwell 8 years ago.
ropp_pp_wopt_tool_out_CASE_12_occ_idc_SBH_params.out-ropp_pp_wopt_tool_out_CASE_12_occ_sbh.out.png
wop_studyv5.pdf (5.1 MB ) - added by Ian Culverwell 8 years ago.
wop_studyv5.pdf
wopt55.pdf (3.5 MB ) - added by Ian Culverwell 8 years ago.
wopt55.pdf
ropp_pp_wopt_propagate_to_leo.f90 (22.9 KB ) - added by Ian Culverwell 7 years ago.
ropp_pp_wopt_propagate_to_leo.f90
Continuous_LSQfit.pdf (300.2 KB ) - added by Ian Culverwell 7 years ago.
Continuous_LSQfit.pdf

Change history (47)

comment:1 by Ian Culverwell, 8 years ago

This has been ROPPified. In doing so, I noticed a crazy sensitivity, which is worth recording before things are overwritten.

The command

ropp_pp_wopt_tool CASE_07_ref1d.nc -o ../data/CASE_07_ref1d_out2.nc

generates this excess phase

CASE_07_excess_phase.png

and this SNR:

CASE_07_SNR.png

Both of these look reasonably sensible.

But simply changing

r_gps(:,2) = - SQRT(2.66E7**2-r_gps(:,1)**2)     ! radius of GPS = 26600 km

to

r_gps(:,2) = - SQRT(2.66E7_wp**2-r_gps(:,1)**2)     ! radius of GPS = 26600 km

in ropp_pp_wopt_tool.f90 (ie just promoting the GNSS altitude 2.66e7 m from single precision to double precision) generates excess phases that differ from the above by this much:

CASE_07_excess_phase_diff.png

This is crazy: about 500 m difference when the phase is 10 000 m, ie about 5% difference in excess phase.

The SNRs differ from the single precision result by this much:

CASE_07_SNR_diff.png

At the end of the (setting) occultation, this is around 0.001 in 0.01, ie ~ 10%.

This seems a very large 'structural uncertainty'. The differences grow rapidly until dim_lev1a ~ 14500, towards the end of the (setting) occultation, so perhaps it occurs when s_geom = |r_GPS - r_LEO| exceeds some threshold.

by Ian Culverwell, 8 years ago

Attachment: CASE_07_excess_phase.png added

CASE_07_excess_phase.png

by Ian Culverwell, 8 years ago

Attachment: CASE_07_SNR.png added

CASE_07_SNR.png

by Ian Culverwell, 8 years ago

CASE_07_excess_phase_diff.png

by Ian Culverwell, 8 years ago

Attachment: CASE_07_SNR_diff.png added

CASE_07_SNR_diff.png

comment:2 by Ian Culverwell, 8 years ago

Fortunately the differences in refractivity

CASE_07_refrac_diff.png

and bending angle

CASE_07_bangle_diff.png

resulting from this change, are pretty small.

(These are obtained by running, for example,

../tools/ropp_pp_occ_tool -w CASE_07_ref1d_out.nc -o occ_out.nc -c ../config/wopt_pp.cf -d

)

by Ian Culverwell, 8 years ago

Attachment: CASE_07_refrac_diff.png added

CASE_07_refrac_diff.png

by Ian Culverwell, 8 years ago

Attachment: CASE_07_bangle_diff.png added

CASE_07_bangle_diff.png

comment:3 by Ian Culverwell, 8 years ago

I meant the differences grow rapidly after dim_lev1a ~ 14500. They're very small (1e-5 m in phase, 1e-7 V/V in SMR) until then.

comment:4 by Ian Culverwell, 8 years ago

Oddly, for CASE 12 (a more difficult one), we don't see anything like the same difference in excess phase

No image "CASE_12_excess_phase.png" attached to Ticket #457

although the difference in SNR is similar to CASE_07:

No image "CASE_12_SNR.png" attached to Ticket #457

by Ian Culverwell, 8 years ago

CASE_12_excess_phase_diff.png

by Ian Culverwell, 8 years ago

Attachment: CASE_12_SNR_diff.png added

CASE_12_SNR_diff.png

comment:5 by Ian Culverwell, 8 years ago

I mean CASE_12_excess_phase_diff.png and CASE_12_SNR_diff.png

Weirder and weirder.

comment:6 by Ian Culverwell, 8 years ago

Increasing nsmooth (phase modelling window in ropp_wopt_phase_and_amplitude_LEO) from 4 to 8 reduces the difference in excess phase to ~15 m, and with negligible impact on retrieved refractivities.

CASE_07_excess_phase_diff_nsmooth=8.png

CASE_07_SNR_diff_nsmooth=8.png

it_wopt_02_CASE_07_nsmooth=8.jpg

by Ian Culverwell, 8 years ago

it_wopt_02_CASE_07_nsmooth=8.jpg

by Ian Culverwell, 8 years ago

CASE_07_excess_phase_diff_nsmooth=8.png

by Ian Culverwell, 8 years ago

CASE_07_SNR_diff_nsmooth=8.png

comment:7 by Ian Culverwell, 8 years ago

A bit more sensitivity came to light when testing CASE12 (a difficult one). When I use

IF (ABS(U(i)) > 1.0E-5*Amp_max)

in ropp_pp_wopt_propagate_to_leo.f90 and propagate through WOPT and then OCC, the resulting refracs look bas cf: the input ones: ropp_pp_comp_CASE_12_idc_1.0E-5.jpg When I reduce this threshold, which allows more points to contribute to the signal at the LEO, to

IF (ABS(U(i)) > 1.0E-6*Amp_max)

then the fit is closer: ropp_pp_comp_CASE_12_idc_1.0E-6.jpg This looks better, and is closer to wnat I got with Sean's original code (with 1.e-5, however): ropp_pp_comp_CASE_12_sbh.jpg

by Ian Culverwell, 8 years ago

ropp_pp_comp_CASE_12_idc_1.0E-5.jpg

by Ian Culverwell, 8 years ago

ropp_pp_comp_CASE_12_idc_1.0E-6.jpg

by Ian Culverwell, 8 years ago

ropp_pp_comp_CASE_12_sbh.jpg

by Ian Culverwell, 8 years ago

ropp_pp_wopt_tool_out_CASE_12_occ_idc.out-ropp_pp_wopt_tool_out_CASE_12_occ_sbh.out.png

comment:8 by Ian Culverwell, 8 years ago

I think the reduction in threshold is justifiable, but I don't understand the different behaviour of both codes with 1e-5. What have I done to change this? One clue: the output from the OCC processing is very different: ropp_pp_wopt_tool_out_CASE_12_occ_idc.out-ropp_pp_wopt_tool_out_CASE_12_occ_sbh.out.png

comment:9 by Ian Culverwell, 8 years ago

Note in particular the failure of the Global MSIS search for Sean's data. (Of course, iono corrn should have no effect as there's no ionosphere in this problem: phase_L1 = phase_L2.)

comment:10 by Ian Culverwell, 8 years ago

Note that if I revert my code to use Sean's parameters, namely:

real(wp) :: f_L1, c_light, pi1, radius_earth
f_L1 = 1.57542e9_wp
c_light = 3.0e8_wp
pi1 =  3.141592653589793238_wp
radius_earth = 6.378135e6_wp  
radius_gps = 2.66e7
theta_min = 0.451953697_wp 
theta_dot = 1.036e-3_wp 
  REAL(wp), PARAMETER      :: amplitude_cutoff = 1.0E-5_wp 

then I get very similar results to Sean: ropp_pp_comp_CASE_12_idc_1.0E-5_SBH_params.jpg

And the occ processing is also very similar: ropp_pp_wopt_tool_out_CASE_12_occ_idc_SBH_params.out-ropp_pp_wopt_tool_out_CASE_12_occ_sbh.out.png

So I evidently haven't introduced any errors in my translation of the code: the differences in these parameters are deliberate (mainly done to match the values used in the ROPP OCC code).

The difference in the OCC processing probably accounts for the difference in the retrieved refracs, and I think we can just say that in this case Sean's happened to give a closer fit to the input refracs than mine.

by Ian Culverwell, 8 years ago

ropp_pp_comp_CASE_12_idc_1.0E-5_SBH_params.jpg

by Ian Culverwell, 8 years ago

ropp_pp_wopt_tool_out_CASE_12_occ_idc_SBH_params.out-ropp_pp_wopt_tool_out_CASE_12_occ_sbh.out.png

comment:11 by Ian Culverwell, 8 years ago

Summary

  • The new code matches the original pretty closely - no apparent errors
  • This is true even on very challenging cases such as CASE 12
  • There are good grounds for setting amplitude_cutoff = 1.0E-6_wp

comment:12 by Ian Culverwell, 8 years ago

Commit various aspects of these changes (to https://trac.romsaf.org/ropp/browser/ropp_src/branches/dev/Share/cb_wopt_test):

  • Tool and man page at r4975.
  • Support routines at r4976 and r4981.
  • Test routines at r4977.
  • Test datasets at r4978 and r4984.
  • Configuration namelists at r4979.
  • Reference manual routines at r4980.
  • Top level ropp_pp routines at r4982.
  • Change to datum_hmsl in coordinates/earth.f90 at r4983.

comment:13 by Ian Culverwell, 8 years ago

The tolerance on |difference in phase_L2_1| in ropp_io_fields_compare.f90 has been loosened (to match that of phase_L1) at r4990.

A fix to prevent calculation of ATAN2(0, 0) in ropp_pp_wopt_phase_and_amplitude.f90 has been made at r4991.

A cosmetic change ymax --> ylimit has been made to the WOPT tool at r4992.

comment:14 by Ian Culverwell, 8 years ago

Another bug in ropp_io_fields_compare.f90 has been fixed at r4995.

comment:15 by Ian Culverwell, 8 years ago

Remove ymax-dependency, and add extra diagnostics, at r4996.

comment:16 by Ian Culverwell, 8 years ago

Chris and Sean squashed some of the bugs in this while I was away.

  • Update ropp_io/data/eum_test_l.bfr_ref (as a result of IP precision (r4987) and software_version changes (r4997) at r5023.
  • Include higher precision Fresnel integral estimates at r5024.
  • Zero the 'edge' contribution to the 'linear' part of the integral giving the signal at the LEO at r5026 and r5028. (Not doing so is equivalent to assuming a linear variation in phase and amplitude out to 'infinity' (1E20 in practice). Omitting the edge contribution is equivalent to using a flat extrapolation. Keeping it in reveals a strange and nasty compiler sensitivity.)

comment:17 by Ian Culverwell, 8 years ago

ROPP9.0_beta, which contains these latest changes, has been tagged at r5039.

comment:18 by Ian Culverwell, 8 years ago

Thought for future developments.

  • Why not do a cubic spline fit over each of the mini-screens in ropp_pp_wopt_propagate_to_leo.f90? The relevant integrals involve exponentials and Fresnel integrals, so the hard work has already been done. This might reduce the sensitivity to nsample (and the compiler!) because the 1st and 2nd derivatives of phase and amplitude would then be guaranteed to be continuous across the 'sample' boundaries.

comment:19 by Ian Culverwell, 8 years ago

Actually a cubic spline might be a step too far: we would end up with integrals involving exp(i(1+x+x2+x3)), which is a bit involved. But quadratic splines (C1 piecewise quadratics) might be possible. They would involve integrals of quadratic*exp(i*quadratic), and they're not too hard.

But in fact a better method might be some sort of least squares fit which was nonetheless cts across the 'sample' boundaries. Can we do some sort of constrained least squares optimisation?

comment:20 by Ian Culverwell, 8 years ago

CASE_05_ref1d.nc and CASE_51_ref1d.nc have been added to the repository at r5055. ROPP now includes the following examples:

CASE_51 = cat 1
CASE_07 = cat 2
CASE_12 = cat 3
CASE_05 = cat 4

For the definitions of the various categories, see the attached wop_studyv5.pdf. Basically, the higher the cat, the higher the maximum refractivity gradient.

Sean has passed all 55 profiles through his version of the WOPT; the results are plotted in the attached wopt55.pdf.

by Ian Culverwell, 8 years ago

Attachment: wop_studyv5.pdf added

wop_studyv5.pdf

by Ian Culverwell, 8 years ago

Attachment: wopt55.pdf added

wopt55.pdf

comment:21 by Ian Culverwell, 8 years ago

Sean's 'quick FSI' code has been plumbed in to ROPP at r5057. It is invoked by calling ropp_pp_wopt_tool with the -f option.

comment:22 by Ian Culverwell, 8 years ago

The ROPP PP UG has been updated to describe this option at r5058 and r5059.

comment:23 by cburrows, 7 years ago

Resolution: fixed
Status: newclosed

A new test has been produced in the Test Folder for this new functionality: IT-PP-06 (note that the previous test 'IT-PP-06' has been renamed 'IT-APPS-01' to reflect the addition of the new 'ropp_apps' module).

The test runs the WOPT on a series of 1D refractivity profiles from the 55-profile dataset to produce simulated phases/amplitudes. The new FSI tool then retrieves bending angles from these, and the existing 'invert' tool produces refractivities which are compared against the original profiles. The comparisons are within acceptable bounds.

Closing ticket.

comment:24 by Ian Culverwell, 7 years ago

Resolution: fixed
Status: closedreopened

comment:25 by Ian Culverwell, 7 years ago

I wondered if a continuous piecewise linear fit of the signal on the final screen might generate better results. It doesn't. See the attached Continuous_LSQfit.pdf for details. So abandon.

For the record, in case the idea proves useful elsewhere, the code to do this is contained within the attached ropp_pp/wopt/ropp_pp_wopt_propagate_to_leo.f90.

by Ian Culverwell, 7 years ago

ropp_pp_wopt_propagate_to_leo.f90

by Ian Culverwell, 7 years ago

Attachment: Continuous_LSQfit.pdf added

Continuous_LSQfit.pdf

comment:26 by Ian Culverwell, 7 years ago

Resolution: fixed
Status: reopenedclosed

Reclosing ticket.

Note: See TracTickets for help on using tickets.