How *Not* to Generate Prescriptions for Landscape Analysis Projects
description
Transcript of How *Not* to Generate Prescriptions for Landscape Analysis Projects
How *Not* to Generate Prescriptions for Landscape
Analysis Projects
Jeff D. Hamann
Western Forest Mensurationist Conference
June 26, 2001
Topics
• Historical prescription processing
• Current tools
• Problems & solutions
...So you Want to Produce Some “Modeli” Runs, Do Ya… Punk?
• What do you need?
• Are the tools appropriate for the objective?
• What’s the time frame?
• What’s the cost?
Step 1. How to Play Nice with Others.
• Learn each application’s interface
• Put them all together– Run static batch mode
Aka - Batch File Hell(into the belly of ORGANON)
rr ( residual table and plots )st ( stand table )ah ( all hardwoods )fo ( for something )mo ( mortiality table )
mt ( management thin )di ( stand density index thin )p ( proportional? )338 ( target stand density index? )
pm ( perform management )
cr ( produce reports )sk ( generate stocking report )
Step 1. How to Play Nice with Others.
• Learn each application’s interface
• Put them all together– Run static batch mode– Reformat outputs
Aka Scripting Helleval 'exec c:\perl\5.00502\bin\MSWin32-x86/perl -S $0 ${1+"$@"}' if $running_under_some_shell;eval '$'.$1.'$2;' while $ARGV[0] =~ /^([A-Za-z_0-9]+=)(.*)/ && shift;
$, = ' '; # set output field separator$\ = "\n"; # set output record separator
# strip out all the lines that contain the words "Mortality"while (<>){ chop; # strip record separator
# if the line has a sub or function, # then strip out the lines that follow # until you reach the ) at the end of the # definition if( /MORTALITY:/ )
{ printf ( "$_\n" ); }}
Step 1. How to Play Nice with Others.
• Learn each application’s interface
• Put them all together– Run static batch mode– Reformat outputs– Check Results
Check Results
• Yeah, right….
Step 1. How to Play Nice with Others.
• Learn each application’s interface
• Put them all together– Run static batch mode– Reformat outputs– Check Results– Check Sanity (your own)
The Eighth Amendment to US Constitution
• Excessive bail shall not be required, nor excessive fines imposed, nor cruel and unusual punishments inflicted.
• It shouldn't take an incredible amount of time, cost a horrific amount of money, and be unbelievably painful to produce yield files.
Step 2. How to Forget Step One.
• Use a database system… of *any* kind
• Use libraries instead of stand alone software
• Use scripting tools like VB, PHP, and Perl
• Use web interfaces to support collaboration
On with the Show…
• Contestant number one
• Contestant number two
• Contestant number n...
Generating the First Database
• Microsoft Access 97
• About 50 fields (before, after, removed)– 50 floats (@ 4 bytes) * 30 periods * 50 Rxs *
500 strata * 3 states 500MB
Prescription Dregs, again.
• Be able to swap tables (or use a subset) and still have the code function.
• Use combinatorial algorithms to generate thinning events
• N-ary tree algorithm will generate (n_thins^n_levels) prescriptions (3 thins and 4 thinning levels = 81 prescriptions )
Problems So Far
• Application limitations
• Database limitations
• Portability issues
• Operating system limitations
Application Limitations
• ORGANON DLL– Has a unique API, multiple site indices
• SYSTUM-1 DLL– Has a unique API, single site index
• Supporting library API– Taper functions, crown functions, silvicultural
functions
Database Limitations
• “Upgrading” Access 97 to Access2000– 400 Strata fit fine in Access97– <100 Strata fit in Access2000– What about stand tables, log tables?
• Going back to Access97 from Access2000 • Access threading model?• Conclusions?
– Access is a resource hog!
Portability Issues
• VB code wouldn’t convert from one version to another. – Moving Access95->97->2000->XP = :-(
• Will it (VB) run in another database like Oracle?
Operating System Limitations
• Remote access to retrieve data and observe progress
• WindowsNT/2000/Linux kernel 2.2.x has 2GB file limitations
• Linux 2.4.x kernel has >2GB limitations
Is This Trip Really Necessary?
• All 150 files took almost 8-10 hours to export
• 3 CDs for each database
• New runs were produced twice a week
• For a total of 200 CDs for each project
• For three projects = 600 CDs (minus a few for Napster downloads)
The Second Database
• Uses Access97/VBA
• Uses MySQL ODBC as backend for data
• 50/50 VB and C for data generation and exporting
Performance Results*
Time, hoursOperation Version 1 Version 2 Version 3**
Generate Basic Data 38.0 38.0 19.0Compute Removed Values 3.0 0.3 0.3Post-processing 4.0 0.5 0.5Export Data 8.0 0.5 0.5
Total 53 39.3 20.3
*These results are NO WAY statistically valid, defensible, or repeatable as the sample size is very, very small!
**multiple threading version - estimated processing time
Visualizing Results
• Export results into MS Excel
• 400 strata * 50 data items = 20000 spreadsheets!
• generated PHP scripts with charts to allow the user to query the runs…
Web Interface Chart
Hints/Tricks/Traps
• Use a scalable database backend
• Use portable methodologies and tools
Questions/Answers?