Legacy Notebook Traceability

This page preserves provenance from legacy notebook narrative content to the new guides documentation.

Coverage Inventory

Legacy markdown cells inventoried:

  • 00_data-prep.ipynb: 51 markdown cells

  • 01a_run-tsa.ipynb: 25 markdown cells

  • 01b_run-tsa.ipynb: 2 markdown cells

  • Total mapped records: 77

Notebook archive location: reference/legacy_notebooks/

Each record is classified as one of:

  • assumptions

  • step intent

  • interpretation guidance

  • failure mode

  • operator action

Coverage Matrix Fields

  • notebook and cell_index: source notebook provenance

  • classification: intent class for the source note

  • status: mapped or retired

  • target_doc: destination guide page

  • pre_phase5_location: where the content lived before this phase (mostly gap)

  • preview: truncated source markdown text

  • notes: rationale for retired/exception cases

Coverage matrix CSV: docs/guides/legacy_notebook_coverage.csv

notebook,cell_index,classification,status,target_doc,pre_phase5_location,preview,notes
00_data-prep.ipynb,0,interpretation guidance,mapped,guides/diagnostics-playbook,gap,# Forest estate modelling input data prep (BC RIA landbase) This notebook (and everything else in this project) was designed and implemented by Gregory Paradis (gregory.paradis@ubc,
00_data-prep.ipynb,1,step intent,mapped,guides/stage-00-data-prep,gap,"Clone the correct branch of the ArcRasterRescue repository from GitHub, and compile the executable.",
00_data-prep.ipynb,2,step intent,mapped,guides/stage-00-data-prep,gap,Import required packages.,
00_data-prep.ipynb,4,step intent,mapped,guides/stage-00-data-prep,gap,Set global notebook parameters.,
00_data-prep.ipynb,6,step intent,mapped,guides/stage-00-data-prep,gap,Launch and set up `ipyparallel` cluster on the VM. We will deploy parallel processing jobs to this cluster at various stages in the process to speed up processing (take advantage o,
00_data-prep.ipynb,8,step intent,mapped,guides/stage-00-data-prep,gap,Define path strings and such.,
00_data-prep.ipynb,10,step intent,mapped,guides/stage-00-data-prep,gap,Define lists grouping species codes by genus.,
00_data-prep.ipynb,12,step intent,mapped,guides/stage-00-data-prep,gap,Download and compile ArcRasterRescue package. We will use this later to extract raster data from proprietary ESRI File Geodatabase.,
00_data-prep.ipynb,14,step intent,mapped,guides/stage-00-data-prep,gap,"Load TSA boundary data for the 5 TSAs in the RIA landbase (TSAs 08, 16, 24, 40, 41) and compile a single polygon defining RIA landbase extent. We simplify the boundary geometry for",
00_data-prep.ipynb,16,step intent,mapped,guides/stage-00-data-prep,gap,"Load VRI features (_vegetation composite layer and R1 polygon_ dataset), masked to RIA landbase extent. Cache a copy of result to a feather file (can later be imported to speed up ",
00_data-prep.ipynb,18,step intent,mapped,guides/stage-00-data-prep,gap,"Extract site productivity raster data from proprietary ESRI File Geodatabase, and export it to species-wise GeoTIFF layers, patch the missing CRS metadata, and stack everything int",
00_data-prep.ipynb,20,step intent,mapped,guides/stage-00-data-prep,gap,Define a species code lookup dict to map VRI species codes to one of the 22 siteprod species codes. We built the key list for this dict by compiling unique values from the `SPECIES,
00_data-prep.ipynb,22,step intent,mapped,guides/stage-00-data-prep,gap,"Clean and filter VRI feature dataset. This includes replacing null data values in certain columns with specific non-null values ('X' or 0, depending on field type) to ensure that d",
00_data-prep.ipynb,23,step intent,mapped,guides/stage-00-data-prep,gap,"Then, for each feature in the VRI dataaset, extract mean SI data from the pixels in the siteprod raster layer corresponding the leading species. This step is computationally intens",
00_data-prep.ipynb,25,step intent,mapped,guides/stage-00-data-prep,gap,VRI data includes merchantable growing stock (per ha) and species codes for the top 7 species in each stand. We recompile the volume data into species-wise columns (using species c,
00_data-prep.ipynb,28,step intent,mapped,guides/stage-00-data-prep,gap,Define some utility functions that we will use later to classify VRI records.,
00_data-prep.ipynb,30,step intent,mapped,guides/stage-00-data-prep,gap,"Next we define a function to generate stratum codes for a given VRI record `r`. In standard (not lexmatch) mode, this function will generate a stratum code string including BEC zon",
00_data-prep.ipynb,32,assumptions,mapped,guides/stage-00-data-prep,gap,"Compile enhanced lexmatch fields as described above, and use the `stratify_stands` function to compile `stratum` and `stratum_lexmatch` columns. We use the `swifter` version of the",
00_data-prep.ipynb,35,step intent,mapped,guides/stage-00-data-prep,gap,"Compile `forest_type` column (1: softwood, 2: softwood mix, 3: hardwood mix, 4: hardwood).",
00_data-prep.ipynb,37,step intent,mapped,guides/diagnostics-playbook,gap,Save checkpoint 4 stand dataframe to feather file.,
00_data-prep.ipynb,40,step intent,mapped,guides/stage-00-data-prep,gap,"We are done with inventory data pre-processing now. In the next part of the procedure, we define strata and analysis units (AUs) within each TSA, and generate VDYP and TIPSY yield ",
00_data-prep.ipynb,41,step intent,mapped,guides/stage-00-data-prep,gap,"# Compile strata, AUs, and yield curves for each TSA",
00_data-prep.ipynb,43,step intent,mapped,guides/stage-00-data-prep,gap,Define some empty dicts to store various outputs from the following steps.,
00_data-prep.ipynb,46,step intent,mapped,guides/stage-00-data-prep,gap,"Define some keyword argument override values, to fine-tune curve generation for a few difficult AUs. Most AUs get processed without problems using default parameters. We found thes",
00_data-prep.ipynb,51,step intent,mapped,guides/pipeline-overview,gap,Loop over TSAs and run notebook `01a_run-tsa`.,
00_data-prep.ipynb,53,step intent,mapped,guides/pipeline-overview,gap,"Loop over TSAs and run the child notebook. This will compile strata and AUs, run VDYP on each AU and compile yield curves, and generate TIPSY input files. VDYP runs individually on",
00_data-prep.ipynb,56,operator action,mapped,guides/limitations-and-boundaries,gap,"Pause running notebook and head to a Windows machine to run `02_input-tsa*.dat` files through BatchTIPSY, then copy `04_output-tsa*.out` files to `./data/`. We tried to get TIPSY t",
00_data-prep.ipynb,57,interpretation guidance,mapped,guides/pipeline-overview,gap,"Loop over TSAs and run notebook `01b_run-tsa`. This compiles output data from TIPSY, and plots results on top of smoothed VDYP output (for visual inspection of AU-wise unmanaged+ma",
00_data-prep.ipynb,60,step intent,mapped,guides/model-input-bundle-and-export,gap,# Export curves to CSV data tables (for soft-link to `spadesCBM`),
00_data-prep.ipynb,61,failure mode,mapped,guides/model-input-bundle-and-export,gap,"Failed attempt to automate translating VRI species codes to CANFI species codes. Could potentially work later, if the `LandR_sppEquivalencies.csv` data table was set up correctly t",
00_data-prep.ipynb,63,step intent,mapped,guides/model-input-bundle-and-export,gap,"Define a dict mapping VRI species codes to CANFI species codes (`spadesCBM` uses CANFI species codes), and a function that returns CANFI code for leading species given a stratum co",
00_data-prep.ipynb,66,step intent,mapped,guides/model-input-bundle-and-export,gap,"Define some empty data structures to store output, and compile three data tables that will be used to import yield curve data into `spadesCBM`.",
00_data-prep.ipynb,68,interpretation guidance,mapped,guides/model-input-bundle-and-export,gap,Display the first few lines of each table (quick sanity check).,
00_data-prep.ipynb,72,step intent,mapped,guides/model-input-bundle-and-export,gap,Export tables to CSV for soft-link with `spadesCBM`.,
00_data-prep.ipynb,74,step intent,mapped,guides/stage-00-data-prep,gap,# Impute THLB status to VRI stands,
00_data-prep.ipynb,75,failure mode,mapped,guides/stage-00-data-prep,gap,"In this next section we impute timber harvesting landbase (THLB) status to the VRI stands. The process may seem very complex (because it is), however this is to _only_ (therefore s",
00_data-prep.ipynb,76,step intent,mapped,guides/diagnostics-playbook,gap,"Restore the VRI dataset from checkpoint 1, and filter records to include only the forested features to which we want to impute an AU and managment status.",
00_data-prep.ipynb,78,interpretation guidance,mapped,guides/stage-00-data-prep,gap,We found a [THLB raster data layer]:(https://www.hectaresbc.org/app/habc/HaBC.html?type=raster&query=misc.thlb) on the [Hectares BC]:(https://hectaresbc.ca/app/habc/HaBC.html) web ,
00_data-prep.ipynb,80,failure mode,retired,guides/limitations-and-boundaries,gap,"This is from an earlier (failed) attempt to impute a binary THLB attribute to VRI data directly from a data layer from a previous (PICS BC forest carbon) project. No dice (runs, bu","Legacy experimental path retained for historical context, not active workflow."

Retired Guidance

Rows marked retired capture legacy exploratory notes (for example explicitly failed historical attempts) that are preserved for context but not recommended as active workflow.

Notebook Output Cleanup Policy

Legacy notebooks can embed host-local absolute paths (for example user home paths captured in traceback/output cells). To keep the repository portable and avoid stale machine-specific leakage:

  • Treat notebook outputs as ephemeral by default.

  • Before committing notebook edits, clear outputs and execution counts unless an output snapshot is intentionally required for provenance.

  • If a provenance snapshot is intentionally retained, sanitize host-local path fragments when practical and document the reason in CHANGE_LOG.md.

  • Keep legacy slug/path history in audit-trail documents only (for example ROADMAP.md and CHANGE_LOG.md), not in active runtime config or user-facing workflow instructions.

Recommended cleanup command:

jupyter nbconvert --clear-output --inplace \
  reference/legacy_notebooks/00_data-prep.ipynb \
  reference/legacy_notebooks/01a_run-tsa.ipynb \
  reference/legacy_notebooks/01b_run-tsa.ipynb