# MATSCI-NASU DFT Extractor v0.1

Prototype for automatic FAIR-oriented metadata extraction from one Quantum ESPRESSO `pw.x` calculation.

## Expected package

```text
calculation/
├── sic.scf.in
├── sic.scf.out
├── Si_*.UPF
├── C_*.UPF
└── sic.save/
    └── data-file-schema.xml
```

Any subset can be processed. Completeness is highest when all sources are present.

## Run

```bash
python matsci_dft_extractor.py path/to/calculation
```

Outputs are written to `calculation/metadata/` unless `-o` is supplied.

## Outputs

- `matsci_dft_metadata.json` — canonical MATSCI master record
- `matcore_dft.json` — MatCore-oriented projection
- `calculation_results.json` — parsed numerical results
- `file_manifest.csv` — package file inventory
- `checksums.sha256` — SHA-256 checksums
- `extraction_report.json` — QA and warnings

## Source logic

- input: requested settings and initial structure
- XML/output: effective/final values and results
- UPF: intrinsic pseudopotential metadata
- package: hashes, sizes
- curator: title, creators/ORCID, licence, scientific purpose, publication/project relation

## v0.1 limitations

- processes the first discovered input/output/XML set in a directory;
- XML reader is conservative and namespace-agnostic, not yet a full `qeschema` mapping;
- MatCore file is a projection, not an official MatCore serialization;
- no full `relax`/`vc-relax` trajectory reconstruction yet;
- XC and k-point vocabularies are not yet fully normalized;
- pseudopotential repository/version/DOI still requires library metadata or curation.

## Next validation

Run v0.1 on one real MATSCI-NASU SiC `pw.x` package, compare the output with the raw QE files, then freeze the v0.1 field mapping.
