---
title: ASRS Database Scraping
status: draft
tags: [ASRS, incident reports, scraping, narratives]
summary: A working module for collecting and structuring ASRS incident-report data so controller narratives can be analyzed for evidence of airspace structure, workload, coordination, and recurring operational hotspots.
---

## Purpose

This is the **current workstream** in the larger AI project plan. ASRS reports are being used as a narrated evidence stream into the goal block: **cognitive structure and how it manifests**.

Identifying structural elements that come out of the narratives, extracting these elements (examples are waypoints or fixes, airport names, airway names, altitudes, sector names, anything) so that I can map them onto the airspace (a separate task!) And also getting associated "soft" information on them. Are the identified structural elements helpful? Difficult to manage? Relied upon? Unnecessary?

To do this, we first need to gather information from the ASRS database.

## Current plan

The initial task workflow is documented in `asrs_scraping/README.md`.

For the first version, we are **not** scraping the live ASRS site. We started from manually saved printable HTML, first with a 10-report parser sample and now with a capped 100-report controller-focused demo sample:

```text
files/asrs_reports/QueryWizard_DisplayPrintable_100.htm
```

The initial processing workflow is:

```text
saved ASRS printable HTML
        ↓
parser
        ↓
wide dataframe
        ↓
CSV / Parquet outputs
```

The main processed 100-report output is:

```text
asrs_scraping/data/processed/asrs_reports_controller_recent_100.csv
```

A structural-element review table is also exported to:

```text
asrs_scraping/data/processed/structural_element_matches_controller_recent_100.csv
```

The primary dataframe design is one row per ASRS report / ACN, with all discovered report information preserved as columns. Repeated duplicate fields within the same section will be combined into a single cell using ` | ` as the delimiter.

Live scraping may be added later, but the current demo can already scale the offline parse/inspection workflow to 100 saved ASRS reports. This also raises a useful question for the project: if ASRS lets us manually export all relevant results, the main value of scraping may be reproducible or continuous pulling rather than one-time access.

## Data fields

The first-version rule is to preserve all report fields as columns, without deciding yet which fields are important or unimportant.

Column naming convention:

```text
<section>_<section_number_if_repeated>__<field_name>
```

Examples:

```text
acn
time_day__date
time_day__local_time_of_day
place__locale_reference
place__state_reference
aircraft_1__reference
aircraft_1__make_model_name
aircraft_2__reference
person_1__function_air_traffic_control
person_1__human_factors
events__anomaly_atc_issue
assessments__contributing_factors_situations
assessments__primary_problem
narrative_1
narrative_2
synopsis
```

Repeated duplicate field example:

```text
person_1__human_factors = "Communication Breakdown | Workload | Situational Awareness"
```

`Place` locale reference variants are combined into `place__locale_reference` rather than separate airport/facility columns. The value itself preserves the type, for example `ZLC.ARTCC`, `PWM.Airport`, or `P50.TRACON`.

The stable search definition is saved in:

```text
asrs_scraping/config/searches/controller_reports_recent.yaml
```

## Notes / results

Initial task setup created:

```text
asrs_scraping/
  README.md
  config/searches/controller_reports_recent.yaml
  scripts/
  src/asrs_scraping/
  notebooks/01_inspect_asrs_wide_dataframe.ipynb
  notebooks/02_structural_element_highlighting_demo.ipynb
  tests/
  data/raw_html/sample_10/
  data/processed/
```

The inspection notebook now defaults to the 100-report dataset and includes basic summary-statistics cells for dates, facilities/states, reporter functions, primary problems, contributing factors, human factors, and simple keyword/inferred-pattern scans for airspace-structure concepts. First-pass bar charts are included for reporter ATC function, primary problem, contributing factors/situations, and human factors. Anomaly summaries are preserved in the raw wide dataframe but intentionally skipped in the notebook for now.

The structural-element highlighting demo is kept in a separate notebook, `02_structural_element_highlighting_demo.ipynb`, so the main inspection notebook stays focused on parser/dataframe validation and summary statistics. It now uses the exported 100-report structural-element match table when available.

A new map-oriented mini-analysis has been started in `03_structural_elements_human_factors_map_demo.ipynb`. It joins structural-element matches back to ASRS human-factors fields and exports review tables for inspecting which human-factors themes are associated with each structural element. This keeps the semantic association step separate from the geocoding/map-display step. The summary output separates compact visualization-ready fields (`short_display_blurb`, top human-factors/contributing-factor labels, and example context) from the longer review blurb so future maps/popups do not have to display dense paragraphs. It also distinguishes generic structural concepts from mappable named elements so that terms like altitude/sector/airspace can remain useful in summaries without being forced onto a point map. A map-candidate export now creates `asrs_scraping/data/reference/navigation_points.csv` as the editable lookup layer for point coordinates and route sources. Waypoint/fix coordinates can be filled from FAA NASR FIX CSV data, and a first-pass static point map is exported to `asrs_scraping/data/processed/structural_element_point_map_controller_recent_100.html`. Route geometry is deferred, with FAA ATS Online / ATS data identified as the likely source for route definitions/geometry.

### Interactive structural-element point map

The embedded first-pass map below shows geocoded waypoint/fix candidates from the 100-report ASRS sample. Hover or click a point to show the associated human-factors card. Generic structural concepts are intentionally kept out of this point map.

<iframe class="module-map-frame" src="files/asrs_structural_element_point_map_controller_recent_100.html" title="Interactive ASRS structural element point map"></iframe>

<p><a class="button" href="files/asrs_structural_element_point_map_controller_recent_100.html">open map in a new page</a></p>

A reusable validation script checks row counts, ACN uniqueness, duplicate ACNs, and narrative/synopsis completeness:

```bash
python3 asrs_scraping/scripts/validate_processed_csv.py \
  asrs_scraping/data/processed/asrs_reports_controller_recent_100.csv
```

### Sample summary charts

These first-pass charts summarize the capped 100-report offline sample. They are still exploratory, but they are now large enough to be more useful than the original 10-report parser sanity check.

<div class="module-results-grid">
<div class="module-chart-card">
<h5>Reporter ATC function</h5>
<dl class="mini-bar-chart">
<div><dt>Approach</dt><dd><span style="width: 100%">37</span></dd></div>
<div><dt>Enroute</dt><dd><span style="width: 89.2%">33</span></dd></div>
<div><dt>Local</dt><dd><span style="width: 67.6%">25</span></dd></div>
<div><dt>Supervisor / CIC</dt><dd><span style="width: 27.0%">10</span></dd></div>
<div><dt>Departure</dt><dd><span style="width: 10.8%">4</span></dd></div>
</dl>
</div>
<div class="module-chart-card">
<h5>Primary problem</h5>
<dl class="mini-bar-chart">
<div><dt>Human Factors</dt><dd><span style="width: 100%">39</span></dd></div>
<div><dt>Procedure</dt><dd><span style="width: 53.8%">21</span></dd></div>
<div><dt>ATC Equipment / Nav Facility / Buildings</dt><dd><span style="width: 46.2%">18</span></dd></div>
<div><dt>Airspace Structure</dt><dd class="accent"><span style="width: 20.5%">8</span></dd></div>
<div><dt>Airport</dt><dd><span style="width: 7.7%">3</span></dd></div>
</dl>
</div>
<div class="module-chart-card">
<h5>Contributing factors / situations</h5>
<dl class="mini-bar-chart">
<div><dt>Human Factors</dt><dd><span style="width: 100%">69</span></dd></div>
<div><dt>Procedure</dt><dd><span style="width: 76.8%">53</span></dd></div>
<div><dt>Airspace Structure</dt><dd class="accent"><span style="width: 44.9%">31</span></dd></div>
<div><dt>ATC Equipment / Nav Facility / Buildings</dt><dd><span style="width: 33.3%">23</span></dd></div>
<div><dt>Chart Or Publication</dt><dd><span style="width: 21.7%">15</span></dd></div>
<div><dt>Company Policy</dt><dd><span style="width: 17.4%">12</span></dd></div>
<div><dt>Environment - Non Weather Related</dt><dd><span style="width: 17.4%">12</span></dd></div>
</dl>
</div>
<div class="module-chart-card">
<h5>Human factors</h5>
<dl class="mini-bar-chart">
<div><dt>Communication Breakdown</dt><dd><span style="width: 100%">61</span></dd></div>
<div><dt>Situational Awareness</dt><dd><span style="width: 77.0%">47</span></dd></div>
<div><dt>Workload</dt><dd><span style="width: 63.9%">39</span></dd></div>
<div><dt>Time Pressure</dt><dd><span style="width: 32.8%">20</span></dd></div>
<div><dt>Training / Qualification</dt><dd><span style="width: 24.6%">15</span></dd></div>
<div><dt>Distraction</dt><dd><span style="width: 23.0%">14</span></dd></div>
<div><dt>Troubleshooting</dt><dd><span style="width: 16.4%">10</span></dd></div>
</dl>
</div>
</div>

### Structural-element highlighting demo

The demo below uses a narrative-style excerpt with both exact keyword matches and inferred structural elements. Exact matches are words or phrases like `airspace`, `point out`, and `waypoint`; inferred matches are text patterns that look like named fixes/waypoints or route identifiers, such as `KILNS`, `AUDII`, `QUART`, `DURST`, and `T33`. The highlighting is intended to show how narrative text can point to structural airspace concepts before any map-based extraction happens.

<div class="module-results-grid">
<div class="highlight-demo-card">
<h5>Highlight color by keyword group</h5>
<ul class="legend-row" aria-label="Keyword group color legend">
<li><span class="legend-swatch" style="background:#b388ff"></span>airspace</li>
<li><span class="legend-swatch" style="background:#ffcc80"></span>coordination</li>
<li><span class="legend-swatch" style="background:#ce93d8"></span>waypoint keyword</li>
<li><span class="legend-swatch" style="background:#ffd54f"></span>inferred waypoint</li>
<li><span class="legend-swatch" style="background:#a5d6a7"></span>inferred route</li>
</ul>
<p class="highlight-text-sample">After the <mark style="background:#ffd54f">KILNS</mark> SID, <mark style="background:#ffd54f">AUDII</mark> transition, the aircraft turned north to <mark style="background:#ffd54f">QUART</mark>, skipping <mark style="background:#ffd54f">DURST</mark>. The controller described this as a missed <mark style="background:#ce93d8">waypoint</mark> sequence that put the aircraft near <mark style="background:#a5d6a7">T33</mark> <mark style="background:#b388ff">airspace</mark> before there was time to <mark style="background:#ffcc80">point out</mark> the traffic.</p>
</div>
<div class="highlight-demo-card">
<h5>Highlight color by match type</h5>
<ul class="legend-row" aria-label="Match type color legend">
<li><span class="legend-swatch" style="background:#b3e5fc"></span>exact keyword</li>
<li><span class="legend-swatch" style="background:#ffe082"></span>inferred pattern</li>
</ul>
<p class="highlight-text-sample">After the <mark style="background:#ffe082">KILNS</mark> SID, <mark style="background:#ffe082">AUDII</mark> transition, the aircraft turned north to <mark style="background:#ffe082">QUART</mark>, skipping <mark style="background:#ffe082">DURST</mark>. The controller described this as a missed <mark style="background:#b3e5fc">waypoint</mark> sequence that put the aircraft near <mark style="background:#ffe082">T33</mark> <mark style="background:#b3e5fc">airspace</mark> before there was time to <mark style="background:#b3e5fc">point out</mark> the traffic.</p>
</div>
</div>

### Data observations

- The capped 100-report sample parses to 100 rows and 148 columns.
- All 100 reports have unique nonblank ACNs.
- `narrative_1` and `synopsis` are populated for all 100 reports.
- `place__locale_reference` combines ASRS locale-reference types that previously appeared as separate columns, such as ATC facility and airport references. The coded values still preserve the reference type, e.g. `ZLC.ARTCC`, `PWM.Airport`, `ZZZ.ARTCC`, or `ZZZ.Airport`.
- `place__altitude_agl_single_value` is sparsely populated in the controller-focused sample and may be more useful for aircrew reports than for ATC-function-filtered reports.
- `person_2__*` fields are often empty because many reports have only one reporter/person section.
- In the 100-report sample, `Airspace Structure` appears 8 times as a primary problem and 31 times as a contributing factor/situation.
- The first structural-element export produced 955 matches across 98 of 100 reports after conservative false-positive tuning.
- The most common structural-element match groups are `procedure` (314), `altitude` (219), `airspace` (117), `sector` (101), and `inferred_waypoint` (56).

### Preliminary notes

The ASRS database is here: https://akama.arc.nasa.gov/ASRSDBOnline/QueryWizard_Filter.aspx 

The search parameters I am using:

- Reporter Function was Approach or Coordinator or Departure or Enroute or Flight Data / Clearance Delivery or Flight Service or Ground or Handoff / Assist or Instructor or Local or Oceanic or Other / Unknown or Supervisor / CIC or Traffic Management or Trainee
    - As of 6/26/26 at 5:42 PM EDT, this search returns 25,696 ACNs

The first 10 most recent results were saved first for parser development. A 100-report printable HTML export is now saved for the scaled offline demo.

An example ASRS entry looks like the following:

![Example ASRS report entry](files/asrs_reports/example_report.png)