NOAA-PMEL / Ferret

The Ferret program from NOAA/PMEL
https://ferret.pmel.noaa.gov/Ferret/
The Unlicense
55 stars 21 forks source link

FMRC - problem with lead view plots #1773

Closed karlmsmith closed 6 years ago

karlmsmith commented 6 years ago

Reported by @karlmsmith on 23 Jan 2017 20:20 UTC Used the attached synthdata2 script to synthesize 2-year monthly forecasts every 3 months. Then used the test2 script to make the various forecast plots. Using various versions of Ferret, including the latest, produces a "lead view" plot (or the error or std error plots) with the spikes at the end (see attached plot). The data does exists and is in the color bar range (see attached snapshot of the data).

This does not seem to appear with using forecasts for every month; maybe a clue to the problem.

Migrated-From: http://dunkel.pmel.noaa.gov/trac/ferret/ticket/2501

karlmsmith commented 6 years ago

Comment by @karlmsmith on 23 Jan 2017 20:26 UTC Just realized it was printing out only some of the data columns. The data is missing in the regions where there is nothing plotted on the ends.

karlmsmith commented 6 years ago

Comment by @AnsleyManke on 24 Jan 2017 01:22 UTC Just reading comments in the source code, I think this is an expected behavior. A comment in the routine, do_aux_var_regrid_2d_tf.F, describing the logic of the looping structure:

...
* this IF allows i) user N limits to exclude low n values
*           and ii) copying the ragged high end of the FMRC block

That raggedness would I think come from the size of the verification-time axis for the 2-D regridding, here of length 145, not necessarily being a multiple of the shorter axis. Or something along those lines.

karlmsmith commented 6 years ago

Comment by @karlmsmith on 27 Jan 2017 20:01 UTC (email response that didn't get into Trac) Starting to make some sense. When I (or whomever) gets the code modified to plot (regrid?) the lag axis in units of the forecasted time axis (in this case, months instead of 3-months) then this will look less weird. With this data each 3x3 block will become a diagonal of three little blocks with off-diagonal blocks missing. Then the final extra column will be one little block wide with the bottom block of what would have been a 3x3 block filled in.

karlmsmith commented 6 years ago

Comment by @karlmsmith on 27 Jan 2017 20:04 UTC (email response that didn't get into Trac) This change of the lead (lag) axis to units of forecasted time axis is what is needed to fix the mistake that @AndrewWittenberg pointed out to Steve. In this example, we know initial conditions of the first month because that was the month that we made the forecast. The next month has a space of one month because we did not make a new forecast that month - all we have is the forecast from a month ago. Similar for the month after that - a two month gap. The month after that one we have a new forecast and once again have zero lag. It also has the values from the previous quarterly forecast, so a space of three months and that forecast's value for the month.

Once this is done properly, as an option we could interpolate (fill) between the blocks. These interpolated values could then be used as estimates of initial conditions on the two unforecasted months when doing the error plots. Otherwise there will be stripes of missing values across the error plots.

It would be nice if the error plots upper bound was where the all-missing starts (or soon thereafter). [Once we no longer have initial conditions - actual or estimated - to compare to, can't do a error so goes all-missing.]
I assume the PyFerret plot of this could find the top-most row with values and set the Y-axis limit to that row or one or two above it. But if Ferret already has something to do this automatically (reduce plot axis limits to near that of defined data - sort of like what LAS does), I would want to make use of it.

karlmsmith commented 6 years ago

Comment by @karlmsmith on 4 Feb 2017 01:37 UTC The extra column now does make since, but making a plot of a 'perfect' forecast is not showing perfect lead view for the problematic dataset from #2502.

The ferret test err700_fmrcdiag.jnl added with four quarterly forecasts of 2 years of monthly data. The plot of the variable 'actual' should show a perfect forecast (it does in the diag view). The lead/skill view used to choke; now it does show a plot of the correct form, but there are offset problems. So still showing a problem.

karlmsmith commented 6 years ago

Attachment from @karlmsmith on 23 Jan 2017 20:21 UTC lead view plot

lead40
karlmsmith commented 6 years ago

Attachment from @karlmsmith on 23 Jan 2017 20:21 UTC lead view data

lead40_data
karlmsmith commented 6 years ago

Attachment from @karlmsmith on 23 Jan 2017 20:23 UTC script to synthesize the data synthdata2.jnl.txt

karlmsmith commented 6 years ago

Attachment from @karlmsmith on 23 Jan 2017 20:23 UTC script to create the various forecast plots test2.jnl.txt

karlmsmith commented 6 years ago

Attachment from @karlmsmith on 23 Jan 2017 20:29 UTC lead view data subset showing every column in this subset

lead40_data_subset
karlmsmith commented 6 years ago

Fixed in Ferret https://github.com/NOAA-PMEL/Ferret/commit/ea0d1ee7f53974b8b4408b98ba3c2b7c8e855aa0 and PyFerret https://github.com/NOAA-PMEL/PyFerret/commit/561b770d3cfc5b44243db71077b768d1a06f7f22