PSU-CSAR / vb-bagis-p

VB .NET source code for ArcMap BAGIS Parameters add-in
1 stars 1 forks source link

Export - set basin_tsta_hru value #31

Open jdduh opened 8 years ago

jdduh commented 8 years ago

basin_tsta_hru is a scalar in the OMS-PRMS parameter file. Its value indicates the ID of the HRU that has the closest elevation as the station that provides solar radiation value. Please assign the value to this parameter when exporting the eWSF-PRMS parameter files.

lbross commented 8 years ago

Extract z-value (meters) of selected observation station and store in xml file. Display this value on the form with units (meters) Select HRU with mean elev closest to z-value. HRU elevation values should be in hru_elev field. Check for its presence. Assume it is in meters. Pop warning message telling user to use elev model for meters.

lbross commented 8 years ago

Attached is the proposed UI including the station id and station elevation. I added the id in case the analyst wants to be able to located the selected station in the SR data layer. I decided against popping a warning message because I thought that could get annoying but I did add a warning message to the form. Thoughts? pe_sr_obs

jdduh commented 8 years ago

Thanks! Look good.

lbross commented 8 years ago

Does it make sense to calculate this parameter only when the box is checked on the export parameters form to include observed PE and SR? Otherwise I don't know that we can assume that the PE and SR tool has been run and we have a z-value to match.

lbross commented 8 years ago

Ping. This is done if @jdduh agrees that we only calculate basin_tsta_hru if the box is checked on the export parameters form to include observed PE and SR. I can then post a new release of BAGIS-P.

jdduh commented 8 years ago

Please write the basin_tsta_hru to the output regardless if users checked the PE and SR export option. Is it true that the station ID can only be determined after the PE and SR values are calculated? In PRMS, basin_tsta_hru parameter is used in model calibration, whereas, PE and SR values are used only for model validation (i.e., after the model is calibrated). Hope this makes sense.

lbross commented 8 years ago

Getting the station ID for basin_tsta_hru requires identifying the station closest to the centroid of the AOI. This is a prerequisite for calculating the SR values. If the SR values have not been calculated prior to a parameter export being requested, we could run the code separately to identify the correct station before calculating basin_tsta_hru. We would also save the station id to disk so that it could be re-used in the future. Is this what you'd like to do @jdduh ?

lbross commented 7 years ago

If PE and SR values haven't been calculated, set this to the missing data value configured by the user.

lbross commented 7 years ago

After reviewing the algorithm, this is how it currently works:

  1. The id of the station located closest to the centroid is only calculated when the SR tool runs and this value is cached on disk
  2. When the parameters are exported, BAGIS-P looks for the cached centroid hru id. If it finds it, it is written to basin_tsta_hru. If not, there is a user warning message and the missing value for that AOI is written to the field
  3. The code to populate basin_tsta_hru runs regardless of whether the box is checked on the export parameters form to include observed PE and SR.

Does this work @jdduh? If so, I will post a new version of BAGIS-P for you.

jdduh commented 7 years ago

This works. Thanks for providing the clear description.