SAC_TO_CSV PIPELINE USAGE
=========================

PURPOSE
-------
Convert SAC seismic waveform files into CSV format
for ΔA ladder generation and UNNS structural analysis.

============================================================
MODE 1 — CURRENT DIRECTORY MODE
============================================================

Use this when:
- sac_to_csv.py is sitting directly beside the .SAC files

Example folder:

nk_explosion_sac_dataset/
│
├── sac_to_csv.py
├── IC.BJT.00.BHZ.M.2013...
├── IC.MDJ.00.BHZ.M.2013...
├── IU.MAJO.00.BHZ.M.2013...
└── ...

COMMAND
-------

python sac_to_csv.py .

IMPORTANT
---------
The dot "." means:

CURRENT DIRECTORY

The script will:
- scan current folder
- find all .SAC files
- convert each to CSV automatically

OUTPUT
------

IC.BJT.00.BHZ.M.2013....csv
IC.MDJ.00.BHZ.M.2013....csv
IU.MAJO.00.BHZ.M.2013....csv
...

============================================================
MODE 2 — SUBFOLDER MODE
============================================================

Use this when:
- SAC files are inside a separate folder

Example structure:

project/
│
├── sac_to_csv.py
│
├── sac_raw/
│   ├── IC.BJT.00.BHZ.M.2013...
│   ├── IC.MDJ.00.BHZ.M.2013...
│   └── ...
│
└── results/

COMMAND
-------

python sac_to_csv.py sac_raw

The script will:
- enter sac_raw/
- find all .SAC files
- convert them automatically

============================================================
MODE 3 — SINGLE FILE MODE
============================================================

Use this when:
- testing one waveform only

COMMAND
-------

python sac_to_csv.py IC.MDJ.00.BHZ.M.2013...

OR

python sac_to_csv.py sac_raw/IC.MDJ.00.BHZ.M.2013...

============================================================
OUTPUT FORMAT
============================================================

Generated CSV format:

time,amplitude
0.000,-0.00012
0.010,-0.00015
0.020,-0.00011
...

============================================================
NEXT STEP
============================================================

After CSV generation:

python delta_ladder.py .

OR

python delta_ladder.py csv_waveforms

depending on your folder structure.

============================================================
FULL UNNS PIPELINE
============================================================

SAC
→ CSV waveform
→ ΔA ladder
→ STRUC_PERC
→ admissibility trajectory
→ regime analysis

============================================================
END
============================================================