PSU-CSAR / vb-bagis-p

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

How to export nradpl table? #15

Closed lbross closed 8 years ago

lbross commented 8 years ago

The parameter file supplied with 'animas_AOI_prms_for_George' contains an nradpl table. There has been much discussion of this table and I need the current status. It looks like we have code to extract the radpl_slope, radpl_aspect, and radpl_lat values from the BAGIS-P spatial parameters table (if they are calculated). The current 'Profile_eWSF_PRMS' does not include the models to generate these values. I think we had models to generate this values in the past, but the only one I can find is radpl_lat.

If we don't need this table, I can add code to the exporter to drop it from the export. If we do need it, we need to be generating the values. The current state is that the exporter creates a table with 3 columns all set to the 'no data' value and a row for each HRU.

If we don't export this table, these columns also need to be removed from bagis_parameters.txt which currently indicates that they should be calculated by BAGIS-P.

jdduh commented 8 years ago

I have added these models back to the profiles. But, could you put -99 (missing value) if the if the parameter table to be exported doesn't contain these values?

jdduh commented 8 years ago

It seems that if we exclude the radpl parameters in the bagis_parameters.txt, then, when the template has an nradpl table, the output file will has an empty nradpl table (i.e., has only the table definition tags, but not the table values). Is this correct? Please add some logic in the code to handle the situations.

The ideal behavior is:

If the parameter table has nradpl values (at least one), then create the nradpl table in the output file.

else, if bagis_parameters.txt indicates that nradpl parameters are required: then create an nradpl table with -99 values.

else, (i.e., bagis_parameters.txt indicates that nradpl parameters are not required): then don't write nradpl table to the output.

lbross commented 8 years ago

One other decision point is whether or not the input template contains the radpl table. Currently, if the template doesn't contain the radpl table, the export excludes it as well. The table headers are printed when the template has the radpl table but the radpl parameters are missing in the bagis_parameters.txt file.

So ... should we take into account if the radpl table is in the parameter template? Or just use the contents of bagis_parameters.txt?

Also, please advise where I can download the updated profiles and models (if applicable) so I can test the code.

jdduh commented 8 years ago

My original logic does consider if the template has the nradpl table, but after I wrote it out I realized that we don't need that additional condition. The nradpl table is simply well-defined. We can create that table without relying on the template. Correct?

lbross commented 8 years ago

The nradpl table can be defined using bagis_parameters.txt. If we take this approach, we can create that table without relying on the template. The code I just wrote does this.

Above you stated that "If the parameter table has nradpl values (at least one), then create the nradpl table in the output file". How do we determine if the parameter table has nradpl values without hard-coding the column names in the application? My preference is to let bagis_parameters.txt determine the nradpl column names.

Alternatively we could check for column names in the nradpl table, if it's present on the template, but this adds a degree of complexity that may be unnecessary as George and NWCC indicate they no longer use nradpl in parameter calculations.

jdduh commented 8 years ago

Ok, that makes sense. Let's use bagis_parameters.txt to determine the export of nradpl table. Could you add a "View/Edit Parameter List" button on the export parameters dialog window so that users could view/edit the list more easily (I'm not sure if this is good, but I think it's necessary).

lbross commented 8 years ago

Opened issue #16 for enhancement to add editor for bagis_parameters.txt. Committed code to update nradpl table export according to logic outlined in this issue. Posted new version of add-in under v1.8.0.