Describe the bug
User would like to plot the mean of a subset of time of a variable using the command line.
There are three related issues.
the tile plot of the mean of the Ozone variable from the command line of all of the timesteps available in the file does not match the mean of Ozone variable generated using the STATS pull down option then select mean.
It is possible to subset the time using the GUI and then use the pull down STATS menu to select mean of the variable, but it is not possible to do this using the command line.
the documentation states that -tinit should start at 0, which fails
To Reproduce
Steps to reproduce the behavior:
Comparison between tile plot generated by script taking mean of variable and tile plot generated interactively using STATS Menu option: Mean
Command line script to generate mean of O3 variable using syntax:
Java HotSpot(TM) 64-Bit Server VM warning: Ignoring option --illegal-access=permit; support was removed in 17.0
2022.06.13 16:41:32.954 [Thread-2] ERROR anl.verdi.plot.gui.FastTilePlot - Error rendering FastTilePlot
java.lang.ArrayIndexOutOfBoundsException: null
at ucar.ma2.Index4D.set0(Index4D.java:123) ~[netcdfAll-4.5.5-SNAPSHOT.jar:?]
at ucar.ma2.Index4D.set(Index4D.java:160) ~[netcdfAll-4.5.5-SNAPSHOT.jar:?]
at anl.verdi.data.DataFrameIndex.setTime(DataFrameIndex.java:79) ~[core.jar:?]
at anl.verdi.data.DataFrameIndex.set(DataFrameIndex.java:149) ~[core.jar:?]
at anl.verdi.plot.gui.FastTilePlot.copySubsetLayerData(FastTilePlot.java:1926) ~[core.jar:?]
at anl.verdi.plot.gui.FastTilePlot.access$16(FastTilePlot.java:1888) ~[core.jar:?]
at anl.verdi.plot.gui.FastTilePlot$5.run(FastTilePlot.java:574) [core.jar:?]
at java.lang.Thread.run(Thread.java:833) [?:?]
Expected behavior
Expect to be able to subset the time range from 1 hour to 10 hours out of the 24 hours of data in the file, and then take the mean of the Ozone variable.
Screenshots
Another syntax option that would be helpful to support to subset the time range is to bracket the time range in the formula as follows:
The above command does not give an error, but it does generate a plot of the mean of Ozone for all timesteps, eequivalent to that produced using the command line for the mean.
OpenJDK 64-Bit Server VM warning: Option --illegal-access is deprecated and will be removed in a future release.
2022.06.13 17:14:13.503 [main] ERROR anl.verdi.plot.gui.FastTilePlot - Exception setting time step. Time step = -1. Is this 1-based?
java.lang.NullPointerException: Cannot invoke "java.util.GregorianCalendar.getTime()" because "date" is null
at anl.verdi.util.Utilities.formatShortDate(Utilities.java:47) ~[core.jar:?]
at anl.verdi.plot.gui.TimeLayerPanel$SpinnerListener.stateChanged(TimeLayerPanel.java:42) ~[core.jar:?]
Expected behavior
Expect to be able to follow the user manual and specify the -tinit to start at zero.
Describe the bug User would like to plot the mean of a subset of time of a variable using the command line.
There are three related issues.
the tile plot of the mean of the Ozone variable from the command line of all of the timesteps available in the file does not match the mean of Ozone variable generated using the STATS pull down option then select mean.
It is possible to subset the time using the GUI and then use the pull down STATS menu to select mean of the variable, but it is not possible to do this using the command line.
the documentation states that -tinit should start at 0, which fails
To Reproduce Steps to reproduce the behavior:
Command line script to generate mean of O3 variable using syntax:
./verdi.sh -f $cwd/data/model/CCTM46_P16.baseO2a.36k.O3MAX -s "mean(O3[1])" -g tile -saveImage "png" $cwd/data/plots/CCTM46_P16.baseO2a.36k.O3.mean.png -quit
Plot generated by script:
Plot generated through gui after starting up verdi and creating a tile plot, then selecting the STATS pull-down menu option and selecting mean
./verdi.sh -f $cwd/data/model/CCTM46_P16.baseO2a.36k.O3MAX -s "O3[1]" -g tile
Output from GUI STATS > MEAN
./verdi.sh -f $cwd/data/model/CCTM46_P16.baseO2a.36k.O3MAX -tinit 1 -tfinal 10 -s"mean(O3[1])"
Expected behavior Expect to be able to subset the time range from 1 hour to 10 hours out of the 24 hours of data in the file, and then take the mean of the Ozone variable.
Screenshots
Another syntax option that would be helpful to support to subset the time range is to bracket the time range in the formula as follows:
./verdi.sh -f $cwd/data/model/CCTM46_P16.baseO2a.36k.O3MAX -s"mean(O3[1]:1-10)" -g tile
The above command does not give an error, but it does generate a plot of the mean of Ozone for all timesteps, eequivalent to that produced using the command line for the mean.
./verdi.sh -f $cwd/data/model/CCTM46_P16.baseO2a.36k.O3MAX -s"mean(O3[1])" -g tile
./verdi.sh -f $cwd/data/model/CCTM46_P16.baseO2a.36k.O3MAX -tinit 0 -tfinal 10 -s "mean(O3[1])" -g tile
Output:
Expected behavior Expect to be able to follow the user manual and specify the -tinit to start at zero.
Recommended Fix for sub-issue #3 (this has been fixed in the documentation by pull request https://github.com/CEMPD/VERDI/pull/302/files The user manual needs to be corrected to state that the timestep should start at 1 rather than zero. https://github.com/CEMPD/VERDI/blob/master/doc/User_Manual/VERDI_ch18.md
Desktop (please complete the following information):
Additional context Also obtained the same behavior with 2.1.3