HydrologicEngineeringCenter / Vortex

data processing utilities
MIT License
26 stars 7 forks source link

Normalizer Broken in versions > 0.9.3-rc.2 #15

Closed danhamill closed 3 years ago

danhamill commented 3 years ago

normalizer fails to execute on versions > 0.9.3-rc.2

java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at normalizer.controller.WizardController$1.call(WizardController.java:162)
        at normalizer.controller.WizardController$1.call(WizardController.java:156)
        at javafx.graphics/javafx.concurrent.Task$TaskCallable.call(Task.java:1425)
        at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
        at mil.army.usace.hec.vortex.math.Normalizer.normalize(Normalizer.java:152)
        at normalizer.controller.Step4Controller.submit(Step4Controller.java:217)
        ... 9 more

Do normalizer peform a cell-by-cell or grid-by-grid normalization?

danhamill commented 3 years ago

Or it could be I am using it wrong.

danhamill commented 3 years ago

Is the procedure described in the technical details section for Mountain Mapper what this tool does?

tombrauer commented 3 years ago

@danhamill I don't know that the vortex normalizer exactly reproduces the Mountain Mapper procedure, but it is similar in concept. The normalizer was built out of necessity on Mike's Truckee River study when we noticed the MRMS volumes were low in the mountainous regions. The PRISM volumes over the same area looked more realistic. So, I built the normalizer to normalize the QPE hourly volumes to the PRISM daily volumes. The tool does a grid-cell-by-grid cell, time-step-by-time step normalization. I consider it high-resolution compared to scaling a set of grids for full-domain, full-time. It was shortly after I built the normalizer, that I read about Mountain Mapper. I found it reassuring that NSSL was doing something similar with MRMS Mountain Mapper. At the time no one was archiving Mountain Mapper, so I asked IA state Mesonet if they could add it. I think the Mountain Mapper archive begins around Sep-2019.

tombrauer commented 3 years ago

One trick is that the normalizer looks up grid cell values by array index. This makes the normalizer performant, but also requires the user to do some pre-processing, e.g. source grids must be the same dimensions. I'm not sure if this is the issue you're running into or not. If you continue to have problems, send me your data and I'll take a look.

danhamill commented 3 years ago

Thanks for the details.

How does the grid selection work? If you select a specified time period from the initial MRMS dss file, do you need to select the same dates from the PRISM file?

tombrauer commented 3 years ago

I was able to get the normalizer up and running again but had to remove the DatePickers. It looked like they were failing to respond to events in newer versions of the JavaFx libraries.

https://github.com/HydrologicEngineeringCenter/Vortex/releases/tag/v0.10.5

tombrauer commented 3 years ago

Yes, the grids should be coincident. The algorithm goes based on the normalization interval that is selected. If the normalization starts on 1/1/2020 12:00 and the normalization period is 1 day, the algorithm will find all "source" grids, and "normals" grids during the period 1/1/2020 12:00 to 1/2/2020 12:00, then calculate the total volume over that interval on a grid cell by grid cell basis. A ratio is computed for "source" grids volume : "normals" grids volume for each grid cell. The ratio for each grid cell is then applied to each of the "source" grids to normalize.