-
Notifications
You must be signed in to change notification settings - Fork 5
Code Modules
The Code/ directory contains processing scripts, QA tools, and one-time utilities. Scripts are organised into prefixed subdirectories.
Code/
├── DS02_DatasetQA/ # Dataset quality assurance scripts
│ ├── QA00_ELMvaliditation.py
│ └── README.md
├── DS03_PlotExtractionCode/ # Plot-level data extraction
│ └── PE00_LIDAR_extraction.py
├── functions/ # Shared utility functions
│ └── core_functions/
│ ├── parse_APPN_dataset_path.py
│ └── tests/
│ └── test_parse_APPN_dataset_path.py
└── OT00_OneTimeScripts/ # One-time migration/maintenance scripts
├── OT00_RenameTiertoT.py
└── OT01_MoveGrawToRaw.py
Scripts use a prefix system:
| Prefix | Meaning | Example |
|---|---|---|
DS |
Dataset processing step | DS02_DatasetQA |
QA |
Quality assurance | QA00_ELMvaliditation.py |
PE |
Plot extraction | PE00_LIDAR_extraction.py |
OT |
One-time script |
OT00_RenameTiertoT.py, OT01_MoveGrawToRaw.py
|
File: Code/DS02_DatasetQA/QA00_ELMvaliditation.py
Full documentation: Code/DS02_DatasetQA/README.md
Author: Arden Burrell
Version: v1.0 (03.03.2026)
Automates the extraction and quality control of spectral data from ELM (Empirical Line Method) validation panels in hyperspectral imaging datasets. The summary below covers the essentials — see the linked README for tested package versions, full folder-structure assumptions, output schemas, troubleshooting, and future enhancements.
- Searches for QC panel shapefiles matching
*QC_*_Panel*.shp - Locates corresponding VNIR and SWIR orthomosaic rasters
- Extracts spectral reflectance values from pixels within panel geometries
- Saves extracted data as CSV or Parquet files
- Generates visualisation plots showing spectral curves across panels and dates
- Supports data sharing between nodes via save/load directories
| Argument | Description |
|---|---|
--path |
Path to search for QA shapefiles (default: git root) |
-f, --force
|
Force overwrite of existing output files |
--type |
Output format: csv or parquet
|
-s, --skipplot
|
Skip plot generation |
--skip-processing |
Skip raster processing; only load existing outputs |
--save-dir |
Save copies of extracted spectra for sharing |
--load-dir |
Load previously extracted spectra from another node |
-v, --verbose
|
Detailed output |
# Standard run
python QA00_ELMvaliditation.py
# Extract and save for sharing with other nodes
python QA00_ELMvaliditation.py --path /path/to/data --save-dir /shared/spectra
# Load external spectra and combine with local data
python QA00_ELMvaliditation.py --load-dir /shared/spectranumpy, pandas, xarray, rioxarray, geopandas, shapely, matplotlib, seaborn, tqdm, GitPython
See the DS02_DatasetQA README for tested package versions and conda environment setup.
File: Code/DS03_PlotExtractionCode/PE00_LIDAR_extraction.py
Full documentation: Code/DS03_PlotExtractionCode/README.md
Authors: Arden Burrell & Richard Harwood
Version: v1.0 (09.03.2026)
Extracts plot-level data from LIDAR point clouds (GOBI and CALVIS sensors) by clipping to plot shapefiles and attaching DSM/DTM elevations. The summary below covers the essentials — see the linked README for full folder-structure assumptions, output schemas, troubleshooting, and future enhancements.
- Discovers
FieldLog.csvfiles (or crawls the hierarchy) to build a table of GOBI/CALVIS acquisitions - Loads and validates plot-layout shapefiles under
Documentation/Plot_Layout/ - Locates matching
*LiDAR_CombinedPointCloud.las,*LiDAR_DSM_*.tif,*LiDAR_DTM_*.tiffiles - Spatial-joins the point cloud to plot polygons and extracts DSM/DTM values per point
- Computes canopy height (
Delta_z = z - DTM) - Writes CSV/Parquet tables plus a YAML metadata sidecar (runtime, system, git state)
- Optionally saves identifiable copies to a shared
--save-dir
| Argument | Description |
|---|---|
--path |
Root path to search (default: git root) |
--path-level |
Level that --path refers to: root, node, project, site, sensor, date, run (default: site) |
-f, --force
|
Force overwrite of existing output files |
--savetype |
Output format: csv or parquet (default: parquet) |
--save-dir |
Save identifiable copies of extracted data for sharing |
--load-dir |
Load previously extracted data from another node |
-v, --verbose
|
Detailed output |
# Standard run
python PE00_LIDAR_extraction.py
# Process a single site
python PE00_LIDAR_extraction.py --path /data/node/project/2026SiteA --path-level site
# Save shared copies for other nodes
python PE00_LIDAR_extraction.py --save-dir /shared/lidarnumpy, pandas, xarray, rioxarray, laspy, geopandas, shapely, pyyaml, tqdm, GitPython
File: Code/OT00_OneTimeScripts/OT00_RenameTiertoT.py
A one-time migration script that renames folders starting with Tier to start with T (e.g. Tier0_raw → T0_raw).
# Use git root as search path
python OT00_RenameTiertoT.py
# Specify a custom path
python OT00_RenameTiertoT.py --path /path/to/dataThe script searches recursively, lists all matching folders, asks for confirmation, then performs the rename.
File: Code/OT00_OneTimeScripts/OT01_MoveGrawToRaw.py
A one-time migration script that relocates *.graw folders from T1_proc into the adjacent T0_raw folder for GOBI and CALVIS sensors only.
- Walks the search root looking for directories named
T1_proc - Keeps only those whose ancestry includes a folder whose name contains
GOBIorCALVIS(case-insensitive) - Collects the direct child folders of
T1_procending in.graw - Lists every proposed move and asks for confirmation
- Moves each
.grawfolder into the siblingT0_raw/(created if missing), refusing to overwrite existing targets
.../<sensor>/<date>/run_XX/T1_proc/<name>.graw
->
.../<sensor>/<date>/run_XX/T0_raw/<name>.graw
| Argument | Description |
|---|---|
--path |
Optional root directory to search. When supplied, the git repository check is skipped. |
--dry-run |
List candidate moves without performing them. |
# Use git root as search path
python OT01_MoveGrawToRaw.py
# Preview moves only
python OT01_MoveGrawToRaw.py --dry-run
# Specify a custom path
python OT01_MoveGrawToRaw.py --path /path/to/datatqdm (and git on PATH when --path is not provided).
Repository · Issues · MIT License · See Contributing-to-the-Wiki to edit these pages.
Start here
APPN Folder Structure
Guides
Reference
Project