How *Not* to Generate Prescriptions for Landscape Analysis Projects

28
How *Not* to Generate Prescriptions for Landscape Analysis Projects Jeff D. Hamann Western Forest Mensurationist Conference June 26, 2001

description

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 “Model i ” Runs, Do Ya… Punk?. - PowerPoint PPT Presentation

Transcript of How *Not* to Generate Prescriptions for Landscape Analysis Projects

Page 1: 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

Page 2: How *Not* to Generate Prescriptions for Landscape Analysis Projects

Topics

• Historical prescription processing

• Current tools

• Problems & solutions

Page 3: How *Not* to Generate Prescriptions for Landscape Analysis Projects

...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?

Page 4: How *Not* to Generate Prescriptions for Landscape Analysis Projects

Step 1. How to Play Nice with Others.

• Learn each application’s interface

• Put them all together– Run static batch mode

Page 5: How *Not* to Generate Prescriptions for Landscape Analysis Projects

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 )

Page 6: How *Not* to Generate Prescriptions for Landscape Analysis Projects

Step 1. How to Play Nice with Others.

• Learn each application’s interface

• Put them all together– Run static batch mode– Reformat outputs

Page 7: How *Not* to Generate Prescriptions for Landscape Analysis Projects

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" ); }}

Page 8: How *Not* to Generate Prescriptions for Landscape Analysis Projects

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

Page 9: How *Not* to Generate Prescriptions for Landscape Analysis Projects

Check Results

• Yeah, right….

Page 10: How *Not* to Generate Prescriptions for Landscape Analysis Projects

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)

Page 11: How *Not* to Generate Prescriptions for Landscape Analysis Projects

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.

Page 12: How *Not* to Generate Prescriptions for Landscape Analysis Projects

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

Page 13: How *Not* to Generate Prescriptions for Landscape Analysis Projects

On with the Show…

• Contestant number one

• Contestant number two

• Contestant number n...

Page 14: How *Not* to Generate Prescriptions for Landscape Analysis Projects

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

Page 15: How *Not* to Generate Prescriptions for Landscape Analysis Projects

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 )

Page 16: How *Not* to Generate Prescriptions for Landscape Analysis Projects

Problems So Far

• Application limitations

• Database limitations

• Portability issues

• Operating system limitations

Page 17: How *Not* to Generate Prescriptions for Landscape Analysis Projects

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

Page 18: How *Not* to Generate Prescriptions for Landscape Analysis Projects

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!

Page 19: How *Not* to Generate Prescriptions for Landscape Analysis Projects

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?

Page 20: How *Not* to Generate Prescriptions for Landscape Analysis Projects

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

Page 21: How *Not* to Generate Prescriptions for Landscape Analysis Projects

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)

Page 22: How *Not* to Generate Prescriptions for Landscape Analysis Projects

The Second Database

• Uses Access97/VBA

• Uses MySQL ODBC as backend for data

• 50/50 VB and C for data generation and exporting

Page 23: How *Not* to Generate Prescriptions for Landscape Analysis Projects

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

Page 24: How *Not* to Generate Prescriptions for Landscape Analysis Projects

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…

Page 25: How *Not* to Generate Prescriptions for Landscape Analysis Projects

Web Interface Chart

Page 26: How *Not* to Generate Prescriptions for Landscape Analysis Projects

Hints/Tricks/Traps

• Use a scalable database backend

• Use portable methodologies and tools

Page 27: How *Not* to Generate Prescriptions for Landscape Analysis Projects

Questions/Answers?

Page 28: How *Not* to Generate Prescriptions for Landscape Analysis Projects