## Data and Scripts Documentation

This document describes the data files, scripts, and output files contained in the `data and scripts` directory. It is intended to support data inspection, result reproduction, and subsequent research use.

---

## 1. Directory Structure

The current directory is organized as follows:

```text
data and scripts/
├─ Summary_Table.csv
├─ calculate_accessibility.py
├─ generate_accessibility_analysis_tables.py
├─ README.txt
├─ Demand Side/
│  ├─ landscan2024.tif
│  └─ Community_Polygon.*
├─ Road/
│  ├─ OD.csv
│  ├─ Road.*
│  ├─ Community_Point.*
│  └─ Park_Point.*
├─ Social Media Reviews/
│  ├─ Processing_Result.csv
│  └─ Raw comment data/
├─ Supply Side/
│  ├─ Objective_Indicators_Normalization.csv
│  ├─ infrastructure.csv
│  ├─ NDVI2024.TIF
│  ├─ Park_Polygon.*
│  └─ transportation.*
├─ results/
│  ├─ accessibility_result.csv
│  ├─ Fig.3...
│  ├─ Fig.5...
│  ├─ Fig.10...
│  ├─ Fig.11...
│  └─ Table 3-6...
└─ __pycache__/
```

The functions of the top-level files and folders are summarized below:

- `Summary_Table.csv`: core input table for the accessibility model.
- `calculate_accessibility.py`: main script for community park accessibility calculation.
- `generate_accessibility_analysis_tables.py`: script for generating analytical tables.
- `README.txt`: documentation for the current directory.
- `Demand Side/`: base spatial data for the demand side.
- `Road/`: road network data and OD cost matrix data.
- `Social Media Reviews/`: processed social media review data and raw review text.
- `Supply Side/`: objective supply-side indicator data.
- `results/`: output directory for model results and analytical tables.
- `__pycache__/`: Python cache directory.

---

## 2. General Description of the Data

This directory contains the principal data and scripts required for the analysis of community park accessibility, including:

- demand-side population and community spatial data;
- road network and travel cost data;
- objective supply-side indicators for parks;
- social media reviews and sentiment processing results;
- scripts implementing the enhanced two-step floating catchment area method;
- output files corresponding to the tables and figures used in the study.

The core computation is based on the integrated `Summary_Table.csv`. The remaining subdirectories primarily preserve source data, support indicator construction, and facilitate interpretation of the results.

---

## 3. Core Input Data

### 3.1 Summary_Table.csv

`Summary_Table.csv` is the primary input table for the accessibility analysis. Based on the OD travel cost between communities and parks, it integrates community population, objective supply-side indicators, and perception-related indicators, and can be used directly for model computation.

The current header is:

`OID, OriginID, DestinationID, cost, population, area, transportation, infrastructure, ndvi, pos_ratio, neg_ratio, review_count`

The main fields are defined as follows:

- `OID`: record identifier;
- `OriginID`: community identifier;
- `DestinationID`: park identifier;
- `cost`: travel time from a community to a park, in minutes;
- `population`: community population size;
- `area`: park area indicator;
- `transportation`: indicator of transport accessibility around the park;
- `infrastructure`: park infrastructure indicator;
- `ndvi`: park vegetation coverage indicator;
- `pos_ratio`: proportion of positive reviews;
- `neg_ratio`: proportion of negative reviews;
- `review_count`: number of reviews, used to characterize usage popularity.

In actual script execution, all fields except `OID` are directly involved in the accessibility calculation.

---

## 4. Description of Subdirectories

### 4.1 Demand Side

The `Demand Side/` folder stores the basic spatial data for the demand side, mainly including:

- `landscan2024.tif`: population raster data;
- `Community_Polygon.*`: community polygon data and associated files.

These data are used for population extraction, representation of community boundaries, and construction of baseline demand-side information.

### 4.2 Road

The `Road/` folder stores road network and OD cost-related data, mainly including:

- `Road.*`: road network spatial data;
- `Community_Point.*`: community centroid point data;
- `Park_Point.*`: park point data;
- `OD.csv`: OD cost matrix from communities to parks.

These data are used to establish travel-time relationships between communities and parks and serve as an important source for the `cost` field in `Summary_Table.csv`.

### 4.3 Social Media Reviews

The `Social Media Reviews/` folder stores social media review data and their processed outputs, mainly including:

- `Processing_Result.csv`: sentiment processing results for the reviews;
- `Raw comment data/`: raw review text for each park.

These data support the construction of perception-related and usage-related indicators, such as the proportions of positive and negative reviews and the number of reviews.

### 4.4 Supply Side

The `Supply Side/` folder stores the objective indicator data for the supply side, mainly including:

- `Park_Polygon.*`: park boundary polygon data;
- `transportation.*`: spatial data related to transport stops;
- `infrastructure.csv`: infrastructure statistics;
- `NDVI2024.TIF`: NDVI raster data;
- `Objective_Indicators_Normalization.csv`: normalized objective indicators.

These data are used to characterize the objective attributes of park service capacity and provide the basis for comprehensive supply evaluation.

### 4.5 results

The `results/` folder stores the output files generated by the scripts, including the main accessibility results and the analytical tables used in the study.

---

## 5. Script Description

### 5.1 calculate_accessibility.py

This script calculates community park accessibility under the enhanced two-step floating catchment area framework.

The main workflow includes:

1. reading `Summary_Table.csv`;
2. validating the fields required for model computation;
3. normalizing the objective supply-side indicators;
4. constructing the perception indicator `emotion = pos_ratio - neg_ratio`;
5. calculating indicator weights using the CRITIC method;
6. computing community accessibility for four models under different time thresholds;
7. exporting the community-level accessibility results.

The script includes four models:

- `M0`: baseline model;
- `M1`: supply-side perception-corrected model;
- `M2`: demand-side usage-popularity-corrected model;
- `M3`: integrated bilateral supply-demand correction model.

The time thresholds are set to:

- 15 minutes;
- 30 minutes;
- 45 minutes;
- 60 minutes.

Input file:

- `Summary_Table.csv`

Output file:

- `results/accessibility_result.csv`

Dependencies:

- Python 3.7 or above;
- `pandas`;
- `numpy`.

### 5.2 generate_accessibility_analysis_tables.py

This script generates statistical and analytical tables based on the main accessibility results, supporting model comparison, difference analysis, and preparation of study tables and figures.

The main workflow includes:

1. reading `Summary_Table.csv`;
2. reading `results/accessibility_result.csv`;
3. recalculating selected park-level supply and supply-demand ratio indicators;
4. exporting statistical and analytical tables for model comparison.

Input files:

- `Summary_Table.csv`
- `results/accessibility_result.csv`

Dependencies:

- Python 3.7 or above;
- `pandas`;
- `numpy`;
- `scipy`.

---

## 6. Description of Output Files

### 6.1 Main Result File

`results/accessibility_result.csv` is the complete community-level accessibility output. It mainly contains the following fields:

- `OriginID`;
- `A_M0_15`, `A_M0_30`, `A_M0_45`, `A_M0_60`;
- `A_M1_15`, `A_M1_30`, `A_M1_45`, `A_M1_60`;
- `A_M2_15`, `A_M2_30`, `A_M2_45`, `A_M2_60`;
- `A_M3_15`, `A_M3_30`, `A_M3_45`, `A_M3_60`.

The output values are reported in scaled format and can be used for cross-model and cross-threshold comparison.

### 6.2 Analytical Tables

The `results/` directory currently also contains the following analytical output files:

- `Fig.3. Comparison of statistical characteristics of accessibility across four models _15 min.csv`
- `Fig.5.Comparison of quantitative difference indicators between each correction model and baseline model_15 min.csv`
- `Fig.10.Trends of statistical metrics for each model under different time thresholds.csv`
- `Fig.11.Effect sizes and Spearman rank correlation coefficients for each model under different time thresholds.csv`
- `Table 3 Changes in comprehensive park service capacity after perception feedback correction_15 min.csv`
- `Table 4 Changes in park supply–demand ratio after usage popularity correction_15 min.csv`
- `Table 5 Decomposition of comprehensive effects of bilateral supply–demand correction_15 min.csv`
- `Table 6 Grade transition matrix between baseline model (M0) and behavioral perception model (M3).csv`

These files are mainly used to describe statistical characteristics, model differences, changes in supply, changes in supply-demand ratios, and grade transition patterns across models.

---

## 7. Reproduction Procedure

To regenerate the main results in the current directory, the recommended procedure is as follows:

1. confirm that `Summary_Table.csv` is present and that its fields are complete;
2. run `calculate_accessibility.py` to generate the main output file `results/accessibility_result.csv`;
3. run `generate_accessibility_analysis_tables.py` to generate the statistical and analytical tables.

---

## 8. Notes for Use

- This directory contains both integrated analysis-ready data and supporting source or intermediate data.
- For accessibility reproduction, the core required files are `Summary_Table.csv` and the two Python scripts.
- The raw review text is stored in `Social Media Reviews/Raw comment data/` and is mainly retained for reference to review sources.
- The `results/` directory is populated automatically when the scripts are executed.
- For details on data sources, indicator construction, or model parameter settings, please consult the main manuscript.
