Instruction:
# Quantification of DMPO Spin Adducts from Overlapping Time-Resolved CW-EPR Spectra and Determination of Reactive Oxygen Species Pathways

A photoreaction system was measured by time-resolved DMPO spin-trapping CW-EPR after short-duration irradiation. The attachments contain independent DMPO-OH and DMPO-OOH concentration standards, triplicate reaction spectra from 20–480 s, and dark, SOD, catalase, and tert-butanol controls at 70 s. The receiver gain, microwave power, and magnetic-field drift differ among spectra, and the spectra contain nonzero baselines; the DMPO-OH and DMPO-OOH signals overlap within the scan range.

Correct the magnetic-field axis and instrumental response, construct unit-concentration reference spectra for both spin adducts, and quantify DMPO-OH, DMPO-OOH, and goodness of fit in each mixture spectrum. Summarize the time series as mean/SD, extract the initial adduct concentrations, decay rates, half-lives, and the contribution of OOH conversion to the secondary OH signal; use the four classes of controls to determine whether the reactive oxygen species pathway is supported, and explain how DMPO artifactual signals and adduct conversion affect the boundaries of the conclusions.

Generate analysis.py, epr_basis_spectra.csv, radical_concentrations.csv, radical_summary.csv, kinetic_parameters.csv, control_effects.csv, epr_qc.csv, spectral_deconvolution.png, radical_kinetics.png, scavenger_controls.png, and epr_spin_trapping_report.md under /app/output. All results must retain spectrum_id, condition, time, replicate, and units, and the figures, tables, and report must be verifiable from the CSV files; do not read data from outside /app/input or hard-code reference results.

## Deliverable Files

The following content defines only the submission format and does not prescribe the analytical method or expected results. All files listed below are required and must be written directly to `/app/output/`.

All CSV files must use UTF-8 encoding, be comma-delimited, and include headers. Numeric fields must contain plain numeric values, with units not concatenated within cells. Column order is unrestricted, and additional columns are permitted, but the required fields specified below must be retained; no field aliases are defined.

### `/app/output/analysis.py`

A UTF-8 plain-text source file used to reconstruct all other deliverables from `/app/input/` and write them to `/app/output/`.

### `/app/output/epr_basis_spectra.csv`

Each row corresponds to one point on the common magnetic-field axis, with `field_G` as the unique stable key.

| Field | Type | Unit | Meaning |
|---|---|---|---|
| `field_G` | number | G | Magnetic-field point |
| `DMPO_OH_signal_per_uM` | number | arbitrary response units/uM | Unit-concentration reference-spectrum signal for DMPO-OH |
| `DMPO_OOH_signal_per_uM` | number | arbitrary response units/uM | Unit-concentration reference-spectrum signal for DMPO-OOH |

### `/app/output/radical_concentrations.csv`

Each row corresponds to one input mixture spectrum, with the input `spectrum_id` as the unique stable key; `condition`, `time_s`, and `replicate` must correspond to that input spectrum.

| Field | Type | Unit | Meaning |
|---|---|---|---|
| `spectrum_id` | string | — | Mixture-spectrum identifier |
| `condition` | string | — | Experimental condition |
| `time_s` | number | s | Time |
| `replicate` | integer | — | Replicate number |
| `DMPO_OH_uM` | number | uM | DMPO-OH concentration |
| `DMPO_OOH_uM` | number | uM | DMPO-OOH concentration |
| `spectral_RMSE` | number | signal response units | Spectral-fit RMSE |
| `spectral_R2` | number | dimensionless | Spectral-fit R² |
| `field_shift_G` | number | G | Magnetic-field shift |
| `response_factor` | number | dimensionless | Instrumental response factor |

### `/app/output/radical_summary.csv`

Each row corresponds to one `condition`–`time_s` combination, with their combination serving as the stable key, and uses the same condition identifiers and time units as the per-spectrum table.

| Field | Type | Unit | Meaning |
|---|---|---|---|
| `condition` | string | — | Experimental condition |
| `time_s` | number | s | Time |
| `n_replicates` | integer | — | Number of replicates |
| `DMPO_OH_mean_uM` | number | uM | Mean DMPO-OH concentration |
| `DMPO_OH_sd_uM` | number | uM | Standard deviation of the DMPO-OH concentration |
| `DMPO_OOH_mean_uM` | number | uM | Mean DMPO-OOH concentration |
| `DMPO_OOH_sd_uM` | number | uM | Standard deviation of the DMPO-OOH concentration |
| `spectral_RMSE_mean` | number | signal response units | Mean spectral-fit RMSE |
| `spectral_RMSE_sd` | number | signal response units | Standard deviation of the spectral-fit RMSE |

### `/app/output/kinetic_parameters.csv`

Each row corresponds to one kinetic outcome quantity, with `parameter` as the unique stable key. For `parameter`, use `OOH_initial_uM`, `OOH_decay_rate_s_inv`, `OOH_half_life_s`, `OH_initial_uM`, `OH_decay_rate_s_inv`, `OH_half_life_s`, and `OOH_to_OH_yield`.

| Field | Type | Unit | Meaning |
|---|---|---|---|
| `parameter` | string | — | Outcome-quantity identifier |
| `estimate` | number | specified by `unit` | Estimated value of the outcome quantity |
| `sd` | number | specified by `unit` | Standard deviation across replicate fits |
| `unit` | string | — | Unit of `estimate` and `sd`; use `uM`, `s^-1`, `s`, or `dimensionless`, as applicable |
| `n_replicate_fits` | integer | — | Number of replicate fits |

### `/app/output/control_effects.csv`

Each row corresponds to one control condition, with `condition` as the unique stable key; the required key values are `dark`, `SOD`, `catalase`, and `tert_butanol`.

| Field | Type | Unit | Meaning |
|---|---|---|---|
| `condition` | string | — | Control condition |
| `time_s` | number | s | Control time |
| `DMPO_OH_mean_uM` | number | uM | Mean DMPO-OH concentration |
| `DMPO_OH_sd_uM` | number | uM | Standard deviation of the DMPO-OH concentration |
| `DMPO_OOH_mean_uM` | number | uM | Mean DMPO-OOH concentration |
| `DMPO_OOH_sd_uM` | number | uM | Standard deviation of the DMPO-OOH concentration |
| `OH_suppression_percent` | number | % | Percentage suppression of DMPO-OH relative to the primary condition |
| `OOH_suppression_percent` | number | % | Percentage suppression of DMPO-OOH relative to the primary condition |

### `/app/output/epr_qc.csv`

A single-row global summary table.

| Field | Type | Unit | Meaning |
|---|---|---|---|
| `n_standard_spectra` | integer | — | Number of standard spectra |
| `n_mixture_spectra` | integer | — | Number of mixture spectra |
| `n_field_points` | integer | — | Number of common magnetic-field points |
| `standard_recovery_RMSE_uM` | number | uM | RMSE of standard recovery |
| `standard_recovery_R2` | number | dimensionless | R² of standard recovery |
| `mean_mixture_spectral_RMSE` | number | signal response units | Mean mixture-spectrum RMSE |
| `minimum_mixture_spectral_R2` | number | dimensionless | Minimum mixture-spectrum R² |
| `OOH_kinetic_R2` | number | dimensionless | OOH kinetic R² |
| `OH_kinetic_R2` | number | dimensionless | OH kinetic R² |
| `SOD_OOH_suppression_percent` | number | % | Percentage OOH suppression under the SOD condition |
| `catalase_OH_suppression_percent` | number | % | Percentage OH suppression under the catalase condition |
| `tert_butanol_OH_suppression_percent` | number | % | Percentage OH suppression under the tert-butanol condition |
| `dark_total_adduct_uM` | number | uM | Total adduct concentration under the dark condition |
| `field_response_correction_status` | string | — | Status of magnetic-field and instrumental-response processing |
| `spectral_decomposition_status` | string | — | Status of spectral-component quantification |
| `kinetic_model_status` | string | — | Status of kinetic results |
| `ROS_pathway` | string | — | ROS pathway designation |
| `overall_status` | string | — | Overall status |
| `failure_reasons` | string | — | Text describing reasons for failure |

### Images

The following three images must all be PNG files:

- `/app/output/spectral_deconvolution.png`: A representative mixture spectrum and its component results.
- `/app/output/radical_kinetics.png`: Time series and kinetic results for DMPO-OH and DMPO-OOH.
- `/app/output/scavenger_controls.png`: Comparison of components between the primary condition and the four classes of controls.

The quantities, units, and component or condition categories shown in the images must be identifiable, and the images must be verifiable from the corresponding CSV files.

### `/app/output/epr_spin_trapping_report.md`

A UTF-8 Markdown report. The report must cover magnetic-field-axis, instrumental-response, and baseline processing; quantification and goodness of fit for both adducts; time-series and kinetic results; the four classes of controls and evidence for the ROS pathway; and DMPO artifactual signals, risks arising from adduct conversion, and the boundaries of the conclusions. No specific conclusion is predetermined.


Instruction:
# Separation of Spin States from Variable-Temperature 57Fe Mössbauer Spectra and Recoilless-Fraction Correction for Determining Spin-Crossover Thermodynamics

The research group performed variable-temperature 57Fe Mössbauer measurements on a batch of Fe(II) spin-crossover samples. The attachments contain three independently acquired transmission spectra at each of six temperatures, together with the α-Fe calibration peaks for each spectrum, independent hyperfine parameters for the three iron species, and recoilless fractions measured by species and temperature. The raw spectra remain in detector-channel units, and the samples also contain a small amount of Fe(III).

Complete the velocity calibration and three-component spectral fitting, and report the spectral area, area fraction, and corrected mole fraction for LS-Fe(II), HS-Fe(II), and Fe(III), respectively. Within the Fe(II) pool, summarize the mean/SD of the high-spin fraction at each temperature and use these values to determine the thermodynamic parameters of the spin transition. Retain the area results without recoilless-fraction correction as a bias comparison, provide assessments of spectral fitting, replicate consistency, and the final transition determination, and explain in the report how Fe(III) overlap, recoilless fractions, and temperature-range coverage affect the conclusions.

Generate analysis.py, velocity_calibration.csv, spectral_component_fits.csv, spin_state_summary.csv, thermodynamic_parameters.csv, mossbauer_qc.csv, calibration_and_fit_diagnostics.png, spin_transition.png, vant_hoff_plot.png, and mossbauer_spin_crossover_report.md under /app/output. All tables must retain spectrum_id, temperature, replicate, species, and units; numerical values in the figures and report must be verifiable from the CSV files. Do not read data from outside /app/input, and do not hard-code reference results.

## Delivery File Format Specifications

All 10 files listed above are required and must be written directly to `/app/output/`. CSV files must use UTF-8 encoding, be comma-delimited, and include headers. Column order is unrestricted, and auxiliary columns may be added provided that their names do not duplicate the specified fields; however, the following specified fields and stable keys must be present. Use the field names with the exact spellings given below, without aliases.

Type notation: `text` denotes a string, `int` denotes an integer, and `number` denotes a numeric value. In field names, `_K` denotes K, `_mm_s` denotes mm/s, and `_mm_s_per_channel` denotes mm·s⁻¹·channel⁻¹; fraction and R² fields are dimensionless. In `thermodynamic_parameters.csv`, `sd` and `estimate` use the same unit specified by the `unit` field in that row.

- `velocity_calibration.csv`: one row per spectrum containing its velocity-calibration result, with `spectrum_id` as the stable key. Fields: `spectrum_id` (`text`), `temperature_K` (`number`), `replicate` (`int`), `velocity_slope_mm_s_per_channel` (`number`), `velocity_intercept_mm_s` (`number`), `calibration_rmse_mm_s` (`number`), `n_calibration_peaks` (`int`).
- `spectral_component_fits.csv`: one row per species component in each spectrum, with (`spectrum_id`, `species`) as the stable key. Fields: `spectrum_id` (`text`), `temperature_K` (`number`), `replicate` (`int`), `species` (`text`), `fitted_area` (`number`), `spectral_area_fraction` (`number`), `recoilless_fraction` (`number`), `corrected_mole_fraction` (`number`), `isomer_shift_mm_s` (`number`), `quadrupole_splitting_mm_s` (`number`), `fwhm_mm_s` (`number`), `spectral_rmse` (`number`), `spectral_r_squared` (`number`).
- `spin_state_summary.csv`: one row per temperature containing the replicate summary, with `temperature_K` as the stable key. Fields: `temperature_K` (`number`), `n_replicates` (`int`), `high_spin_fraction_mean` (`number`), `high_spin_fraction_sd` (`number`), `raw_HS_area_fraction_mean` (`number`), `raw_HS_area_fraction_sd` (`number`), `FeIII_mole_fraction_mean` (`number`), `FeIII_mole_fraction_sd` (`number`), `spectral_rmse_mean` (`number`), `spectral_rmse_sd` (`number`).
- `thermodynamic_parameters.csv`: one row per thermodynamic or transition parameter, with `parameter` as the stable key. Fields: `parameter` (`text`), `estimate` (`number`), `sd` (`number`), `unit` (`text`), `n_replicate_fits` (`int`).
- `mossbauer_qc.csv`: a single-row summary of overall QC and the transition determination. Fields: `n_spectra` (`int`), `n_temperatures` (`int`), `n_channels_per_spectrum` (`int`), `maximum_velocity_calibration_rmse_mm_s` (`number`), `minimum_spectral_r_squared` (`number`), `mean_spectral_rmse` (`number`), `maximum_mole_fraction_closure_error` (`number`), `minimum_vant_hoff_r_squared` (`number`), `corrected_T_half_K` (`number`), `raw_area_T_half_K` (`number`), `raw_area_T_half_bias_K` (`number`), `velocity_status` (`text`), `decomposition_status` (`text`), `recoilless_correction_status` (`text`), `transition_status` (`text`), `overall_status` (`text`), `failure_reasons` (`text`).

For `species`, use `LS_FeII`, `HS_FeII`, or `FeIII`. In `thermodynamic_parameters.csv`, use the following specified `parameter`/`unit` combinations: `delta_H_kJ_mol`/`kJ/mol`, `delta_S_J_mol_K`/`J/(mol K)`, `T_half_K`/`K`, and `delta_G_298_kJ_mol`/`kJ/mol`. Use concise snake_case text for statuses and failure reasons; use `accepted`/`review` for `velocity_status`, `decomposition_status`, and `overall_status`, and write `none` in `failure_reasons` when there are no failure reasons.

`analysis.py` must be able to regenerate the CSV, PNG, and report files listed above using only the data in `/app/input/`. The three PNG files must respectively cover velocity-calibration/spectral-fitting diagnostics, the variation of spin state with temperature, and thermodynamic fitting, and must include readable axes, units, and component or series labels. `mossbauer_spin_crossover_report.md` must describe velocity calibration, component separation and recoilless-fraction correction, replicate consistency and QC, interpretation of the thermodynamic results, and Fe(III) overlap, temperature-range coverage, and other applicable limitations; statements in the report must be consistent with the CSV files and figures.


Instruction:
# Correction of Chromium Species Interconversion and Quantification of Cr(III)/Cr(VI) by Dual-Enriched-Isotope LC-ICP-MS

The laboratory measured Cr(III) and Cr(VI) in four food matrices using species-specific isotope-dilution LC-ICP-MS. Before extraction, each sample was spiked separately with a 50Cr-enriched Cr(III) spike and a 53Cr-enriched Cr(VI) spike. The attachments provide integrated counts at m/z 50, 52, 53, and 54 for two chromatographic windows; the 49Ti/56Fe monitoring channels; instrument blanks; bracketing natural-chromium standards; spike isotopic compositions; sample-weighing and spiking records; and independent total-chromium results. Both Cr(III) oxidation and Cr(VI) reduction may occur during sample preparation.

Correct for sequence-dependent mass discrimination, chromatographic-window blanks, and Ti/Fe isobaric interferences. Using the distributions of the two enriched labels in the Cr(III) and Cr(VI) peaks, determine the original Cr(III), original Cr(VI), bidirectional species-conversion fractions, and recovery across the two peaks for each preparation replicate. Summarize the mean/SD by sample, and use the independent total-chromium results and QC samples to assess mass closure and batch validity. The report must distinguish between “total-chromium closure” and “correct species allocation” and explain how unmodeled coelution or additional chromium species would affect the conclusions.

Generate analysis.py, mass_bias_correction.csv, corrected_peak_isotope_ratios.csv, chromium_speciation_results.csv, sample_summary.csv, batch_qc.csv, isotope_ratio_diagnostics.png, chromium_speciation.png, mass_balance_qc.png, and chromium_speciation_report.md under /app/output. The tables must retain prep_id, sample_id, replicate, peak_label, and units; the values in the figures and report must be verifiable from the CSV files. Do not read data from outside /app/input, and do not hard-code reference results.

## Deliverable Files

This section defines only the submission format and does not prescribe the analytical method or expected results. All files are required and must be written to `/app/output/`. CSV files must use UTF-8 encoding with a header row; column order is unrestricted and additional columns are permitted, but the canonical field names below must be used exactly and must not be replaced by aliases. Numeric fields must contain plain numeric values, with units given by the field name.

### `/app/output/mass_bias_correction.csv` — Required

Each row represents one preparation replicate; the stable key is `prep_id`.

| Canonical field | Type | Unit | Meaning |
|---|---|---|---|
| `prep_id` | string | — | Preparation identifier |
| `sample_id` | string | — | Sample identifier |
| `replicate` | integer | — | Replicate number |
| `sequence_order` | integer | — | Position of the preparation in the measurement sequence |
| `lower_standard_id` | string | — | Identifier of the bracketing standard measured before the preparation |
| `upper_standard_id` | string | — | Identifier of the bracketing standard measured after the preparation |
| `interpolation_fraction` | number | dimensionless | Interpolation weight between the two bracketing standards |
| `beta` | number | dimensionless | Mass-discrimination (mass-bias) coefficient applied to the preparation |
| `sensitivity_counts_per_ng` | number | counts/ng | Interpolated sensitivity for the preparation |
| `maximum_bracketing_standard_log_rmse` | number | dimensionless | Largest bracketing-standard ratio fit residual summary |

### `/app/output/corrected_peak_isotope_ratios.csv` — Required

Each row represents one chromatographic peak of one preparation; the stable key is the combination of `prep_id` and `peak_label`.

| Canonical field | Type | Unit | Meaning |
|---|---|---|---|
| `prep_id` | string | — | Preparation identifier |
| `sample_id` | string | — | Sample identifier |
| `replicate` | integer | — | Replicate number |
| `peak_label` | string | — | Chromatographic peak label, retained from the configuration |
| `corrected_count_50` | number | counts | m/z 50 counts after blank, interference and mass-bias correction |
| `corrected_count_52` | number | counts | m/z 52 counts after correction |
| `corrected_count_53` | number | counts | m/z 53 counts after correction |
| `corrected_count_54` | number | counts | m/z 54 counts after correction |
| `corrected_R50_52` | number | dimensionless | Corrected 50/52 isotope ratio |
| `corrected_R53_52` | number | dimensionless | Corrected 53/52 isotope ratio |
| `corrected_R54_52` | number | dimensionless | Corrected 54/52 isotope ratio |
| `predicted_R50_52` | number | dimensionless | 50/52 ratio predicted by the fitted isotope-mixture model |
| `predicted_R53_52` | number | dimensionless | 53/52 ratio predicted by the fitted isotope-mixture model |
| `predicted_R54_52` | number | dimensionless | 54/52 ratio predicted by the fitted isotope-mixture model |
| `maximum_interference_fraction_percent` | number | % | Largest isobaric-interference contribution among the monitored masses |
| `minimum_isotope_snr` | number | dimensionless | Smallest isotope signal-to-noise summary for the peak |
| `peak_ratio_fit_log_rmse` | number | dimensionless | Ratio fit residual summary for the peak |

### `/app/output/chromium_speciation_results.csv` — Required

Each row represents one preparation replicate; the stable key is `prep_id`.

| Canonical field | Type | Unit | Meaning |
|---|---|---|---|
| `prep_id` | string | — | Preparation identifier |
| `sample_id` | string | — | Sample identifier |
| `replicate` | integer | — | Replicate number |
| `CrIII_ug_kg` | number | µg/kg | Original Cr(III) mass fraction of the preparation |
| `CrVI_ug_kg` | number | µg/kg | Original Cr(VI) mass fraction of the preparation |
| `total_speciated_Cr_ug_kg` | number | µg/kg | Sum of the speciated chromium mass fractions |
| `CrVI_fraction_percent` | number | % | Cr(VI) share of the speciated chromium |
| `CrIII_to_CrVI_conversion_percent` | number | % | Fraction of Cr(III) oxidized during preparation |
| `CrVI_to_CrIII_conversion_percent` | number | % | Fraction of Cr(VI) reduced during preparation |
| `CrIII_peak_recovery_percent` | number | % | Recovery of the Cr(III) chromatographic peak |
| `CrVI_peak_recovery_percent` | number | % | Recovery of the Cr(VI) chromatographic peak |
| `isotope_ratio_fit_log_rmse` | number | dimensionless | Residual summary of the isotope-ratio solution for the preparation |
| `independent_total_Cr_ug_kg` | number | µg/kg | Independent total-chromium result for the preparation |
| `total_mass_closure_percent` | number | % | Closure of the speciated total against the independent total |

### `/app/output/sample_summary.csv` — Required

Each row represents one sample; the stable key is `sample_id`.

| Canonical field | Type | Unit | Meaning |
|---|---|---|---|
| `sample_id` | string | — | Sample identifier |
| `n_replicates` | integer | count | Number of preparation replicates summarized |
| `CrIII_mean_ug_kg` | number | µg/kg | Mean of `CrIII_ug_kg` across replicates |
| `CrIII_sd_ug_kg` | number | µg/kg | Standard deviation of `CrIII_ug_kg` across replicates |
| `CrVI_mean_ug_kg` | number | µg/kg | Mean of `CrVI_ug_kg` across replicates |
| `CrVI_sd_ug_kg` | number | µg/kg | Standard deviation of `CrVI_ug_kg` across replicates |
| `total_mean_ug_kg` | number | µg/kg | Mean of `total_speciated_Cr_ug_kg` across replicates |
| `total_sd_ug_kg` | number | µg/kg | Standard deviation of `total_speciated_Cr_ug_kg` across replicates |
| `CrVI_fraction_mean_percent` | number | % | Mean of `CrVI_fraction_percent` across replicates |
| `CrVI_fraction_sd_percent` | number | % | Standard deviation of `CrVI_fraction_percent` across replicates |
| `CrIII_to_CrVI_mean_percent` | number | % | Mean of `CrIII_to_CrVI_conversion_percent` across replicates |
| `CrIII_to_CrVI_sd_percent` | number | % | Standard deviation of `CrIII_to_CrVI_conversion_percent` across replicates |
| `CrVI_to_CrIII_mean_percent` | number | % | Mean of `CrVI_to_CrIII_conversion_percent` across replicates |
| `CrVI_to_CrIII_sd_percent` | number | % | Standard deviation of `CrVI_to_CrIII_conversion_percent` across replicates |
| `independent_total_mean_ug_kg` | number | µg/kg | Mean independent total-chromium result across replicates |
| `mass_closure_mean_percent` | number | % | Mean of `total_mass_closure_percent` across replicates |
| `mass_closure_sd_percent` | number | % | Standard deviation of `total_mass_closure_percent` across replicates |

### `/app/output/batch_qc.csv` — Required

A single-row batch summary; the row constitutes the stable row semantics of the file.

| Canonical field | Type | Unit | Meaning |
|---|---|---|---|
| `n_samples` | integer | count | Number of samples in the batch |
| `n_preparations` | integer | count | Number of preparation replicates in the batch |
| `n_chromatographic_peaks` | integer | count | Number of chromatographic peak records in the batch |
| `maximum_standard_ratio_log_rmse` | number | dimensionless | Batch maximum of the bracketing-standard ratio fit residual summary |
| `maximum_isotope_ratio_fit_log_rmse` | number | dimensionless | Batch maximum of `isotope_ratio_fit_log_rmse` |
| `maximum_blank_fraction_percent` | number | % | Batch maximum blank contribution |
| `maximum_interference_fraction_percent` | number | % | Batch maximum isobaric-interference contribution |
| `minimum_peak_recovery_percent` | number | % | Batch minimum chromatographic peak recovery |
| `maximum_peak_recovery_percent` | number | % | Batch maximum chromatographic peak recovery |
| `QC_CrIII_recovery_percent` | number | % | Cr(III) recovery of the QC sample against its assigned value |
| `QC_CrVI_recovery_percent` | number | % | Cr(VI) recovery of the QC sample against its assigned value |
| `minimum_total_mass_closure_percent` | number | % | Batch minimum of `total_mass_closure_percent` |
| `maximum_total_mass_closure_percent` | number | % | Batch maximum of `total_mass_closure_percent` |
| `mass_bias_status` | string | — | Mass-discrimination correction status label |
| `interference_status` | string | — | Interference correction status label |
| `interconversion_status` | string | — | Species interconversion assessment status label |
| `speciation_status` | string | — | Species allocation status label |
| `mass_balance_status` | string | — | Mass-closure status label |
| `overall_status` | string | — | Overall batch status label |
| `failure_reasons` | string | — | Text summary of items that did not pass |


Instruction:
# Correcting H2O2 Transport Losses Using Multi-Rotation-Rate RRDE Data and Determining the 2e/4e Oxygen-Reduction Pathway

The research group measured the oxygen reduction reaction of a carbon-supported, precious-metal-free catalyst using a rotating ring-disk electrode. The attachments contain O2/N2 disk and ring polarization curves at 400, 900, 1600, and 2500 rpm, with three independent catalyst films at each rotation rate; they also contain records of per-spectrum gain, reference-electrode offset, and uncompensated resistance, ferricyanide collection-efficiency calibrations, and H2O2 pulse transport-recovery calibrations under the same hydrodynamic conditions.

Convert the O2 and N2 curves to a comparable iR-corrected RHE scale, subtract the disk and ring backgrounds, and calculate the hydrogen peroxide selectivity and electron-transfer number using the measured collection efficiency and H2O2 transport recovery at each rotation rate. Summarize the mean/SD at the specified potentials, complete a multi-rotation-rate Koutecky–Levich analysis, and determine whether the observed rotation-rate differences arise from the reaction pathway or from disk-to-ring transport. The report must explain the limitations imposed on the conclusions by low-rotation-rate transport losses, ring response, and K-L assumptions.

Generate analysis.py, rrde_calibration_summary.csv, rrde_corrected_curves.csv, selectivity_summary.csv, kl_kinetics.csv, rrde_qc.csv, rrde_corrected_curves.png, peroxide_selectivity.png, kl_diagnostics.png, and rrde_orr_report.md under /app/output. The tables must retain spectrum_id, rotation_rpm, replicate, potential, and units, and the numerical values in the figures and report must be verifiable from the CSV files; do not read data from outside /app/input, and do not hard-code reference results.

## Deliverable Files

This section defines only the submission format and does not prescribe the analysis method or expected results. All files listed below are required and must be written directly to `/app/output/`. All CSV files must be UTF-8 text with headers; numeric fields must contain numeric values only, with units defined by the field names or the tables below. CSV column order and row order are not specified. Additional columns are permitted, but they must not replace the required fields listed below; each row is identified by the specified stable key.

### `/app/output/analysis.py`

A UTF-8 text script that reproduces the results.

### `/app/output/rrde_calibration_summary.csv`

Each row represents a calibration summary for one rotation rate; the stable key is `rotation_rpm`.

| Field | Type | Unit |
|---|---|---|
| `rotation_rpm` | integer | rpm |
| `n_collection_replicates` | integer | count |
| `collection_efficiency_mean` | number | dimensionless |
| `collection_efficiency_sd` | number | dimensionless |
| `n_peroxide_replicates` | integer | count |
| `peroxide_transit_recovery_mean` | number | dimensionless |
| `peroxide_transit_recovery_sd` | number | dimensionless |

### `/app/output/rrde_corrected_curves.csv`

Each row represents one sampled point on an O2 curve; the stable key is the combination of `spectrum_id` and `point_index`.

| Field | Type | Unit |
|---|---|---|
| `spectrum_id` | string | — |
| `rotation_rpm` | integer | rpm |
| `replicate` | integer | — |
| `point_index` | integer | — |
| `potential_RHE_iR_corrected_V` | number | V vs RHE |
| `disk_current_background_corrected_mA` | number | mA |
| `disk_current_density_mA_cm2` | number | mA/cm² |
| `ring_current_background_corrected_mA` | number | mA |
| `ring_current_transit_corrected_mA` | number | mA |
| `collection_efficiency` | number | dimensionless |
| `peroxide_transit_recovery` | number | dimensionless |
| `H2O2_percent` | number | % |
| `H2O2_percent_without_transit_correction` | number | % |
| `electron_transfer_number` | number | dimensionless |

### `/app/output/selectivity_summary.csv`

Each row represents a replicate statistical summary for one combination of rotation rate and target potential; the stable key is the combination of `rotation_rpm` and `potential_RHE_V`.

| Field | Type | Unit |
|---|---|---|
| `rotation_rpm` | integer | rpm |
| `potential_RHE_V` | number | V vs RHE |
| `n_replicates` | integer | count |
| `H2O2_percent_mean` | number | % |
| `H2O2_percent_sd` | number | % |
| `H2O2_without_transit_correction_mean` | number | % |
| `H2O2_without_transit_correction_sd` | number | % |
| `electron_transfer_number_mean` | number | dimensionless |
| `electron_transfer_number_sd` | number | dimensionless |
| `disk_current_density_mean_mA_cm2` | number | mA/cm² |
| `disk_current_density_sd_mA_cm2` | number | mA/cm² |

### `/app/output/kl_kinetics.csv`

Each row represents a summary of the kinetics and electron-transfer number at one target potential; the stable key is `potential_RHE_V`.

| Field | Type | Unit |
|---|---|---|
| `potential_RHE_V` | number | V vs RHE |
| `n_replicate_fits` | integer | count |
| `kinetic_current_density_mean_mA_cm2` | number | mA/cm² |
| `kinetic_current_density_sd_mA_cm2` | number | mA/cm² |
| `KL_electron_transfer_number_mean` | number | dimensionless |
| `KL_electron_transfer_number_sd` | number | dimensionless |
| `RRDE_electron_transfer_number_mean` | number | dimensionless |
| `RRDE_electron_transfer_number_sd` | number | dimensionless |
| `KL_r_squared_mean` | number | dimensionless |
| `KL_r_squared_minimum` | number | dimensionless |

### `/app/output/rrde_qc.csv`

A single-row global summary table with no row key.

| Field | Type | Unit |
|---|---|---|
| `n_raw_spectra` | integer | count |
| `n_corrected_O2_curves` | integer | count |
| `n_points_per_curve` | integer | count |
| `collection_efficiency_min` | number | dimensionless |
| `collection_efficiency_max` | number | dimensionless |
| `peroxide_transit_recovery_min` | number | dimensionless |
| `peroxide_transit_recovery_max` | number | dimensionless |
| `maximum_corrected_H2O2_rotation_spread_percent` | number | percentage points |
| `maximum_uncorrected_H2O2_rotation_spread_percent` | number | percentage points |
| `minimum_KL_r_squared` | number | dimensionless |
| `maximum_KL_RRDE_n_disagreement` | number | dimensionless |
| `collection_calibration_status` | string | — |
| `background_ir_status` | string | — |
| `peroxide_transit_status` | string | — |
| `kinetic_status` | string | — |
| `pathway_status` | string | — |
| `overall_status` | string | — |
| `failure_reasons` | string | — |

### Figures and Report

- `/app/output/rrde_corrected_curves.png`: A PNG image showing the corrected disk and ring curves.
- `/app/output/peroxide_selectivity.png`: A PNG image showing hydrogen peroxide selectivity and the result categories before and after correction.
- `/app/output/kl_diagnostics.png`: A PNG image showing the K-L kinetic cross-check.
- `/app/output/rrde_orr_report.md`: A UTF-8 Markdown report covering calibration and background treatment, hydrogen peroxide selectivity, the kinetic cross-check, QC, and limitations; its conclusions and numerical values must be supported by the submitted CSV files.


Instruction:
# Joint ATR-FTIR/FBRM Reconstruction of Supersaturation During Antisolvent Crystallization and Differentiation of Growth, Nucleation, and Agglomeration

The process team applied three antisolvent addition profiles—FAST, MEDIUM, and SLOW—to an API and evaluated both seeded and unseeded operation; each combination has two independent replicate batches. The attachments contain synchronized temperature, antisolvent volume, ATR-FTIR absorbance, and counts for six FBRM chord-length bins, together with ATR concentration calibration data, a solubility surface, FBRM solids-content calibration data, batch material records, and endpoint mother-liquor HPLC data.

Reconstruct the solution concentration, solubility, supersaturation, chord-length moments, and solids-content trajectories for each batch, and identify signatures of new nucleation, crystal growth, desupersaturation, and agglomeration. For seeded batches, first account for the initial seed-crystal counts and seed-crystal mass, and then evaluate newly formed particles. Summarize the mean/SD for the six process combinations, verify the endpoint HPLC results and material closure, and determine the recommended condition according to the process-selection criteria in the attachments. The report must explain the limitations of relating FBRM chord length to true particle size/mass.

Generate analysis.py, calibration_models.csv, process_trajectories.csv, run_metrics.csv, design_summary.csv, crystallization_qc.csv, supersaturation_and_solids.png, fbrm_population_diagnostics.png, process_window.png, and crystallization_PAT_report.md under /app/output. The tables must retain run_id, profile, seeded, replicate, time, and units; all numerical values in the figures and report must be verifiable from the CSV files. Do not read data from outside /app/input, and do not hard-code reference results.

## Deliverable Files

This section defines only the submission interface and does not prescribe the analytical methods or expected results. All 10 files listed below are required and must be written directly to `/app/output/`.

### General Table Conventions

- All CSV files must use UTF-8 encoding, with field names in the first row.
- Numeric fields must contain numeric values only; do not include unit strings in cells.
- The field names below are canonical field names; no alternative aliases are defined. Field order is not prescribed, and additional columns that do not duplicate canonical field names are permitted.
- Except for single-row summary tables, row order is not prescribed; records in each table must be uniquely identified by the listed stable key.
- `seeded` is a Boolean value and must be written canonically as `true` or `false`.

### `/app/output/analysis.py` — Required

A UTF-8 text source file used to reconstruct the remaining deliverables based solely on materials in `/app/input/`.

### `/app/output/calibration_models.csv` — Required

Each row represents one parameter of one calibration object, with (`model`, `parameter`) as the stable key.

| Field | Type | Unit | Meaning |
|---|---|---|---|
| `model` | string | — | Calibration object identifier |
| `parameter` | string | — | Parameter identifier |
| `estimate` | number | specified by `unit` | Parameter estimate |
| `unit` | string | — | Unit of `estimate` |
| `model_rmse` | number | response-variable unit of the corresponding calibration object | Summary of calibration error |

### `/app/output/process_trajectories.csv` — Required

Each row represents one sampling time point for one batch, with (`run_id`, `time_min`) as the stable key.

| Field | Type | Unit | Meaning |
|---|---|---|---|
| `run_id` | string | — | Batch identifier |
| `profile` | string | — | Antisolvent addition profile identifier |
| `seeded` | boolean | — | Whether seeding was performed |
| `replicate` | integer | — | Independent replicate identifier |
| `time_min` | number | min | Sampling time |
| `temperature_C` | number | °C | Temperature |
| `antisolvent_volume_L` | number | L | Antisolvent volume |
| `antisolvent_fraction` | number | dimensionless | Antisolvent fraction |
| `estimated_dissolved_concentration_g_L` | number | g/L | Estimated solution concentration |
| `estimated_solubility_g_L` | number | g/L | Estimated solubility |
| `supersaturation_ratio` | number | dimensionless | Supersaturation ratio |
| `FBRM_total_counts_per_s` | number | s⁻¹ | FBRM total chord count rate |
| `FBRM_M3_um3_per_s` | number | µm³/s | FBRM third-order chord-length moment |
| `number_weighted_mean_chord_um` | number | µm | Number-weighted mean chord length |
| `volume_weighted_mean_chord_um` | number | µm | Volume-weighted mean chord length |
| `estimated_solids_g_L` | number | g/L | Estimated total solids content |
| `seed_solids_g_L` | number | g/L | Seed-crystal solids content |
| `estimated_new_solids_g_L` | number | g/L | Estimated newly formed solids content |

### `/app/output/run_metrics.csv` — Required

Each row represents a result summary for one batch, with `run_id` as the stable key.

| Field | Type | Unit | Meaning |
|---|---|---|---|
| `run_id` | string | — | Batch identifier |
| `profile` | string | — | Antisolvent addition profile identifier |
| `seeded` | boolean | — | Whether seeding was performed |
| `replicate` | integer | — | Independent replicate identifier |
| `nucleation_onset_min` | number | min | Onset time of new nucleation |
| `maximum_supersaturation_ratio` | number | dimensionless | Maximum supersaturation ratio |
| `desupersaturation_time_min` | number | min | Desupersaturation time |
| `growth_rate_um_min` | number | µm/min | Chord-length growth rate |
| `nucleation_index_percent` | number | % | Nucleation index |
| `agglomeration_index_percent` | number | % | Agglomeration index |
| `endpoint_solids_g_L` | number | g/L | Endpoint solids content |
| `endpoint_mother_liquor_g_L` | number | g/L | Endpoint mother-liquor concentration |
| `ATR_minus_HPLC_endpoint_g_L` | number | g/L | Difference between endpoint ATR and HPLC concentrations |
| `crystallization_yield_percent` | number | % | Crystallization yield |
| `mass_closure_percent` | number | % | Material closure |
| `regime_classification` | string | — | Crystallization mechanism classification |

### `/app/output/design_summary.csv` — Required

Each row represents a replicate summary for one (`profile`, `seeded`) process combination, with (`profile`, `seeded`) as the stable key.

| Field | Type | Unit | Meaning |
|---|---|---|---|
| `profile` | string | — | Antisolvent addition profile identifier |
| `seeded` | boolean | — | Whether seeding was performed |
| `n_replicates` | integer | — | Number of independent replicates |
| `nucleation_onset_mean_min` | number | min | Mean onset time of new nucleation |
| `nucleation_onset_sd_min` | number | min | SD of the onset time of new nucleation |
| `maximum_supersaturation_mean` | number | dimensionless | Mean maximum supersaturation ratio |
| `maximum_supersaturation_sd` | number | dimensionless | SD of the maximum supersaturation ratio |
| `growth_rate_mean_um_min` | number | µm/min | Mean chord-length growth rate |
| `growth_rate_sd_um_min` | number | µm/min | SD of the chord-length growth rate |
| `nucleation_index_mean_percent` | number | % | Mean nucleation index |
| `nucleation_index_sd_percent` | number | % | SD of the nucleation index |
| `agglomeration_index_mean_percent` | number | % | Mean agglomeration index |
| `agglomeration_index_sd_percent` | number | % | SD of the agglomeration index |
| `yield_mean_percent` | number | % | Mean crystallization yield |
| `yield_sd_percent` | number | % | SD of the crystallization yield |
| `mass_closure_mean_percent` | number | % | Mean material closure |
| `mass_closure_sd_percent` | number | % | SD of the material closure |
| `dominant_regime` | string | — | Dominant crystallization mechanism classification |
| `recommendation` | string | — | Process-selection result |

### `/app/output/crystallization_qc.csv` — Required

A global results summary table containing only one summary record.

| Field | Type | Unit | Meaning |
|---|---|---|---|
| `n_runs` | integer | — | Number of batches |
| `n_time_points_per_run` | integer | — | Number of sampling points per batch |
| `ATR_absorbance_RMSE_AU` | number | AU | Summary of ATR calibration error |
| `solubility_RMSE_g_L` | number | g/L | Summary of solubility calibration error |
| `FBRM_solids_RMSE_g_L` | number | g/L | Summary of FBRM solids-content calibration error |
| `maximum_ATR_HPLC_endpoint_difference_g_L` | number | g/L | Summary of batch endpoint ATR/HPLC concentration differences |
| `minimum_mass_closure_percent` | number | % | Minimum batch material closure |
| `maximum_mass_closure_percent` | number | % | Maximum batch material closure |
| `recommended_profile` | string | — | Identifier of the recommended antisolvent addition profile |
| `recommended_seeded` | boolean | — | Whether the recommended condition is seeded |
| `recommended_regime` | string | — | Crystallization mechanism classification of the recommended condition |
| `ATR_status` | string | — | ATR calibration status |
| `solubility_status` | string | — | Solubility calibration status |
| `FBRM_moment_status` | string | — | FBRM chord-length moment calibration status |
| `seed_baseline_status` | string | — | Seed-crystal baseline treatment status |
| `mass_balance_status` | string | — | Material-balance status |
| `overall_status` | string | — | Overall status |
| `failure_reasons` | string | — | Explanation of failed criteria |

### Image Files — Required

- `/app/output/supersaturation_and_solids.png`: A PNG image showing the supersaturation and solids-content results.
- `/app/output/fbrm_population_diagnostics.png`: A PNG image showing the seed-crystal baseline and FBRM chord-length population results.
- `/app/output/process_window.png`: A PNG image showing the comparison of process combinations and the process-selection result.

### `/app/output/crystallization_PAT_report.md` — Required

A UTF-8 Markdown report. The report must cover calibration results and trajectory reconstruction, the seed-crystal baseline and newly formed particles, crystallization mechanisms and comparison of process combinations, endpoint HPLC verification and material closure, process selection, and the applicability limits of FBRM chord length relative to true particle size and mass; no conclusion is presupposed. Numerical values in the report must be verifiable from the CSV files above.


Instruction:
# Confirmation of the Structure, Absolute Configuration, and Purity of an Asymmetric Reduction Product by Combined Two-Dimensional NMR, Chiral HPLC Spiking, and qNMR

An asymmetric reduction experiment yielded a brominated methoxy aryl secondary alcohol. The attachments provide eight candidate structures with the same molecular formula, together with the product’s 1H/13C NMR peak tables, HSQC/COSY/HMBC correlations, three HRMS isotope clusters, and chiral HPLC peak tables for the racemate, the R reference standard, the sample, and the sample spiked with the R reference standard; three qNMR integration datasets with an internal standard, weighing records, and reference peaks for the starting ketone are also provided.

Determine the product’s constitutional structure and major absolute configuration, complete the spectroscopic assignments for C1–C9, and explain the level of structural information supported by HRMS, NMR, and chiral chromatography, respectively. Establish the R/S peak order from the reference standard and spiking results, and report the ee for each injection and the mean/SD; also report, for each spectrum, the product mass fraction, residual starting ketone, mass balance, and the mean/SD. The shared methoxy region and the U1 chromatographic peak must be treated according to their actual analytical scope. Ultimately retain only one candidate compatible with all evidence and provide an integrated QC assessment.

Generate analysis.py, identity_assignment.csv, nmr_assignments.csv, candidate_evidence.csv, chiral_hplc_results.csv, qnmr_results.csv, stereochemical_qc.csv, nmr_connectivity_map.png, chiral_hplc_overlay.png, qnmr_assay_diagnostics.png, and stereochemical_identity_report.md under /app/output. Numerical tables must retain candidate_id, peak_id, chromatogram_id, spectrum_id, replicate, and units; all numbers in the figures and report must be verifiable from the CSV files. Do not read data from outside /app/input, and do not hard-code reference results.

## Deliverable Files

This section defines only the submission interface and does not constrain the analytical methods or expected conclusions. All CSV files must use UTF-8 encoding and include headers; column order is unrestricted, and auxiliary columns that do not conflict with the specified columns may be added. `string` denotes text or an enumeration, `integer` denotes an integer, and `number` denotes a finite numerical value. The `_ppm`, `_min`, `_mAU_s`, and `_percent` suffixes in field names denote ppm, minutes, mAU·s, and percent, respectively.

### `/app/output/analysis.py` — Required

A Python script capable of independently generating all other deliverables from `/app/input`, supporting `python analysis.py --input /app/input --output /app/output`.

### `/app/output/identity_assignment.csv` — Required

One row representing the integrated identity and summary results for the sample. Required fields:

`sample_id:string`, `selected_candidate_id:string`, `compound_name:string`, `molecular_formula:string`, `isomeric_SMILES:string`, `constitution_code:string`, `major_absolute_configuration:string`, `enantiomeric_excess_mean_percent:number`, `enantiomeric_excess_sd_percent:number`, `qNMR_product_purity_mean_percent:number`, `qNMR_product_purity_sd_percent:number`, `residual_starting_ketone_mean_percent:number`, `residual_starting_ketone_sd_percent:number`, `identity_status:string`.

### `/app/output/nmr_assignments.csv` — Required

Each row corresponds to one C1–C9 atom label, with `atom_label` as the stable key. Required fields:

`atom_label:string`, `carbon_peak_id:string`, `carbon_shift_ppm:number`, `proton_peak_id:string`, `proton_shift_ppm:number`, `proton_multiplicity:string`, `assignment_basis:string`.

### `/app/output/candidate_evidence.csv` — Required

Each row corresponds to one input candidate, with `candidate_id` as the stable key. Required fields:

`candidate_id:string`, `molecular_formula:string`, `constitution_code:string`, `stereochemistry:string`, `formula_match:string`, `substitution_pattern_match:string`, `major_enantiomer_match:string`, `overall_match:string`.

### `/app/output/chiral_hplc_results.csv` — Required

Each row corresponds to one PRODUCT replicate chromatogram, with `chromatogram_id` as the stable key and `replicate` retained. Required fields:

`chromatogram_id:string`, `replicate:integer`, `R_peak_label:string`, `R_retention_time_min:number`, `R_area_mAU_s:number`, `S_peak_label:string`, `S_retention_time_min:number`, `S_area_mAU_s:number`, `R_fraction:number`, `S_fraction:number`, `enantiomeric_excess_percent:number`, `major_enantiomer:string`.

### `/app/output/qnmr_results.csv` — Required

Each row corresponds to one qNMR replicate spectrum, with `spectrum_id` as the stable key and `replicate` retained. Required fields:

`spectrum_id:string`, `replicate:integer`, `purity_from_benzylic_CH_percent:number`, `purity_from_product_CH3_percent:number`, `apparent_purity_from_shared_OMe_percent:number`, `reported_product_purity_percent:number`, `residual_starting_ketone_percent:number`, `accounted_mass_percent:number`, `shared_OMe_bias_percentage_points:number`, `shared_OMe_status:string`.

### `/app/output/stereochemical_qc.csv` — Required

One row containing the integrated QC assessment. Required fields:

`n_candidates:integer`, `n_formula_matches:integer`, `n_constitution_matches:integer`, `n_final_matches:integer`, `mean_observed_sodium_adduct_mz:number`, `mean_mass_error_ppm:number`, `mean_bromine_Mplus2_to_M_ratio:number`, `R_peak_label:string`, `S_peak_label:string`, `R_peak_retention_time_mean_min:number`, `S_peak_retention_time_mean_min:number`, `R_spike_area_increase_ratio:number`, `spike_selectivity_ratio:number`, `enantiomeric_excess_mean_percent:number`, `enantiomeric_excess_sd_percent:number`, `qNMR_product_purity_mean_percent:number`, `qNMR_product_purity_sd_percent:number`, `residual_starting_ketone_mean_percent:number`, `residual_starting_ketone_sd_percent:number`, `maximum_clean_qNMR_signal_disagreement_percent:number`, `mean_shared_OMe_bias_percentage_points:number`, `selected_candidate_id:string`, `HRMS_status:string`, `NMR_constitution_status:string`, `chiral_peak_mapping_status:string`, `qNMR_status:string`, `overall_status:string`, `failure_reasons:string`.

### `/app/output/nmr_connectivity_map.png` — Required

A readable PNG showing the identities of the NMR atoms/peaks and their correlations, consistent with the CSV files.

### `/app/output/chiral_hplc_overlay.png` — Required

A readable PNG showing the peak identities and relative relationships in the reference, sample, and spiked chromatograms, consistent with the CSV files.

### `/app/output/qnmr_assay_diagnostics.png` — Required

A readable PNG showing the diagnostic relationships among the qNMR signals, purity, and mass balance, consistent with the CSV files.

### `/app/output/stereochemical_identity_report.md` — Required

A UTF-8 Markdown report explaining the chain of structural evidence, the evidentiary boundaries of each technique, chiral peak mapping, ee, chemical purity, residual starting material, the treatment of shared signals and unassigned peaks, and the integrated QC assessment. Numerical values in the report must be verifiable from the CSV files.


Instruction:
# Evaluation of Steel-Sheet Lüders Bands, Plastic r-Values, and Pre-Necking Flow Curves Using Synchronized Full-Field DIC and Tensile-Testing-Machine Data

The sheet-material group completed uniaxial tensile tests in the 0°, 45°, and 90° rolling directions, with two replicate specimens in each direction. The attachments contain testing-machine load/crosshead displacement, DIC full-field axial/transverse/shear logarithmic strains, five shared synchronization pulses, and initial dimensions. The testing machine and DIC do not use the same clock, and the DIC grid covers both the gauge region and points affected by edge effects.

Perform specimen-by-specimen time synchronization and gauge-ROI aggregation, and provide engineering stress–strain curves, pre-necking true stress–plastic true strain curves, elastic modulus, 0.2% proof stress, UTS, and uniform elongation. Identify the onset and end, duration, and propagation velocity of the Lüders band, and distinguish it from subsequent necking; calculate the r-value over a common plastic-strain window. Summarize the mean/SD by 0°/45°/90° orientation, and provide r_bar, delta_r, and normalized Hill48 parameters. The report shall explain why crosshead displacement, r-values based on total strain, and conversion to uniform true stress after necking are not applicable to this task.

Generate analysis.py, sync_calibration.csv, field_kinematics.csv, test_metrics.csv, orientation_summary.csv, anisotropy_parameters.csv, tensile_dic_qc.csv, stress_strain_and_localization.png, luders_and_necking_fields.png, anisotropy_summary.png, and tensile_DIC_report.md under /app/output. All tables shall retain test_id, orientation, replicate, frame, and units; all numerical values in the figures and report shall be verifiable from the CSV files. Do not read data from outside /app/input, and do not hard-code reference results.

## Deliverable Files

The following specifies only the submission format and does not prescribe the analysis method, result values, or conclusions. All 11 files listed below are required and shall be written directly to `/app/output/`. Additional files are permitted. CSV files may contain additional columns, and column order is unrestricted, but the required fields listed below shall be included. CSV files shall use UTF-8 encoding, with a header in the first row; numerical columns shall contain plain numerical values without embedded unit strings.

### `/app/output/analysis.py` — Required

- Format/encoding: plain text, UTF-8.

### `/app/output/sync_calibration.csv` — Required

- Row semantics and stable key: one row per specimen, uniquely identified by `test_id`.

| Field | Type | Unit |
|---|---|---|
| `test_id` | string | — |
| `orientation_deg` | integer | ° |
| `replicate`, `n_sync_pulses` | integer | count |
| `machine_time_intercept_s`, `sync_RMSE_s` | numerical | s |
| `machine_per_DIC_time_slope` | numerical | s/s (dimensionless) |

### `/app/output/field_kinematics.csv` — Required

- Row semantics and stable key: one row for each DIC frame of each specimen, uniquely identified by the combination of `test_id` and `frame_id`.

| Field | Type | Unit |
|---|---|---|
| `test_id` | string | — |
| `orientation_deg` | integer | ° |
| `replicate`, `frame_id`, `ROI_point_count` | integer | count |
| `dic_time_s`, `synchronized_machine_time_s` | numerical | s |
| `load_N` | numerical | N |
| `crosshead_displacement_mm`, `strain_centroid_x_mm` | numerical | mm |
| `axial_log_strain_mean`, `axial_log_strain_median`, `axial_log_strain_p95`, `transverse_log_strain_mean`, `shear_log_strain_mean`, `localization_index`, `engineering_strain`, `axial_plastic_log_strain` | numerical | dimensionless |
| `engineering_stress_MPa`, `homogeneous_true_stress_MPa` | numerical | MPa |
| `flow_curve_validity` | string | — |

### `/app/output/test_metrics.csv` — Required

- Row semantics and stable key: one row per specimen, uniquely identified by `test_id`.

| Field | Type | Unit |
|---|---|---|
| `test_id` | string | — |
| `orientation_deg` | integer | ° |
| `replicate`, `n_valid_pre_necking_frames`, `n_invalid_post_necking_frames` | integer | count |
| `youngs_modulus_GPa` | numerical | GPa |
| `proof_stress_0p2_MPa`, `ultimate_tensile_strength_MPa` | numerical | MPa |
| `uniform_engineering_elongation_percent` | numerical | % |
| `UTS_time_s`, `luders_duration_s`, `necking_localization_onset_time_s` | numerical | s |
| `luders_band_velocity_mm_s` | numerical | mm/s |
| `elastic_fit_R_squared`, `proof_strain_engineering`, `uniform_true_strain`, `luders_onset_true_strain`, `luders_end_true_strain`, `plastic_strain_ratio_r`, `necking_localization_onset_true_strain` | numerical | dimensionless |

### `/app/output/orientation_summary.csv` — Required

- Row semantics and stable key: one row per orientation, uniquely identified by `orientation_deg`.

| Field | Type | Unit |
|---|---|---|
| `orientation_deg` | integer | ° |
| `n_replicates` | integer | count |
| `youngs_modulus_GPa_mean`, `youngs_modulus_GPa_sd` | numerical | GPa |
| `proof_stress_0p2_MPa_mean`, `proof_stress_0p2_MPa_sd`, `ultimate_tensile_strength_MPa_mean`, `ultimate_tensile_strength_MPa_sd` | numerical | MPa |
| `uniform_elongation_percent_mean`, `uniform_elongation_percent_sd` | numerical | % |
| `luders_duration_s_mean`, `luders_duration_s_sd` | numerical | s |
| `luders_band_velocity_mm_s_mean`, `luders_band_velocity_mm_s_sd` | numerical | mm/s |
| `plastic_strain_ratio_r_mean`, `plastic_strain_ratio_r_sd`, `necking_onset_true_strain_mean`, `necking_onset_true_strain_sd` | numerical | dimensionless |

### `/app/output/anisotropy_parameters.csv` — Required

- Row semantics: one row containing the global anisotropy summary.

| Field | Type | Unit |
|---|---|---|
| `normalization`, `drawing_assessment`, `earing_assessment` | string | — |
| `r0`, `r45`, `r90`, `r_bar`, `delta_r`, `Hill48_F`, `Hill48_G`, `Hill48_H`, `Hill48_N` | numerical | dimensionless |

### `/app/output/tensile_dic_qc.csv` — Required

- Row semantics: one row containing the global summary.

| Field | Type | Unit |
|---|---|---|
| `n_tests`, `n_orientations`, `n_DIC_frames_per_test`, `n_ROI_points_per_frame` | integer | count |
| `maximum_sync_RMSE_s` | numerical | s |
| `minimum_clock_slope`, `maximum_clock_slope`, `minimum_elastic_R_squared`, `r_bar`, `delta_r` | numerical | dimensionless |
| `minimum_proof_stress_MPa`, `maximum_proof_stress_MPa`, `minimum_UTS_MPa`, `maximum_UTS_MPa` | numerical | MPa |
| `Hill48_normalization`, `clock_sync_status`, `elastic_fit_status`, `luders_detection_status`, `plastic_r_status`, `post_necking_flow_status`, `replicate_statistics_status`, `overall_status`, `failure_reasons` | string | — |

### Image Files — Required

- `/app/output/stress_strain_and_localization.png`: PNG; stress–strain and localization-results figure.
- `/app/output/luders_and_necking_fields.png`: PNG; full-field Lüders and necking-results figure.
- `/app/output/anisotropy_summary.png`: PNG; orientation-specific statistics and anisotropy-results figure.

### `/app/output/tensile_DIC_report.md` — Required

- Format/encoding: Markdown, UTF-8.
- Content categories: clock synchronization, gauge ROI, yielding and Lüders band/necking, plastic r-values, anisotropy, interpretation of results, and applicability limits.


Instruction:
# Register LPBF Melt-Pool Monitoring Data, Scan Vectors, and XCT Three-Dimensional Porosity, and Trace Defect Mechanisms

An LPBF test coupon measuring 20 mm×20 mm×4 mm has completed 100 manufacturing layers. The attachments contain layer-by-layer segmented scan vectors, coaxial melt-pool samples, an XCT catalog of three-dimensional connected pores, and calibration points for CT→machine and camera→machine transformations. The scan direction alternates by layer, and some scan lines are divided into finite segments with different parameters; the XCT data contain both internal pores and pores near free surfaces.

Establish two coordinate transformations to unify all pores and melt-pool samples in machine coordinates. Assign layer numbers based on the true z-coordinate of each pore, and associate each pore with the nearest finite scan segment and local melt-pool sample. Calculate sphericity, elongation, flatness, distance to the surface, and local process metrics; classify pores as gas, keyhole, or lack_of_fusion while maintaining separate surface/bulk accounting. Generate defect statistics for layers 1–100, identify persistent anomalous layer intervals, spatial boundaries, and the most likely root causes, and provide an overall disposition for the entire build.

Generate analysis.py, registration_models.csv, aligned_pore_catalog.csv, layer_defect_summary.csv, anomaly_regions.csv, build_summary.csv, lpbf_xct_qc.csv, registered_defect_map.png, layer_anomaly_diagnostics.png, mechanism_evidence.png, and LPBF_XCT_report.md under /app/output. The pore-level catalog must retain pore_id, assigned_layer, nearest_vector_id, nearest_meltpool_sample_id, and numerical units; the layer-level table must retain layer_id. Numerical values in the figures and report must be verifiable from the CSV files. Do not read data from outside /app/input, and do not hard-code reference results.

## Deliverable Files

The following defines only the submission interface and does not prescribe implementation methods or expected results. All files listed below are required and must be located in `/app/output/`. CSV files must use UTF-8 encoding, be comma-delimited, and include headers. Column order is unrestricted, and additional columns are permitted, but the required fields specified below must not be omitted or replaced with alternative names. Numerical fields must contain numerical values only; units are specified by the field names or in the descriptions below. All other text files must use UTF-8 encoding.

### `/app/output/analysis.py`

UTF-8 source-code text file.

### `/app/output/registration_models.csv`

- Row semantics: Each row represents one output axis of one coordinate transformation.
- Stable key: Combination of `transform_id` and `output_axis`; `CT_TO_MACHINE` corresponds to the `x`, `y`, and `z` output axes, and `CAMERA_TO_MACHINE` corresponds to the `x` and `y` output axes.
- Fields:
  - String: `transform_id`, `output_axis`
  - Numeric (mm): `intercept`, `registration_RMSE_mm`
  - Numeric (machine-coordinate units/source-coordinate units): `source_x_coefficient`, `source_y_coefficient`, `source_z_coefficient`
  - Integer (count): `n_fiducials`

### `/app/output/aligned_pore_catalog.csv`

- Row semantics: Each row represents one XCT pore identified by `pore_id`.
- Stable key: `pore_id`.
- Fields:
  - String: `pore_id`, `surface_status`, `nearest_vector_id`, `nearest_meltpool_sample_id`, `defect_mechanism`
  - Integer (layer number): `assigned_layer`
  - Numeric (mm): `machine_x_mm`, `machine_y_mm`, `machine_z_mm`, `distance_to_surface_mm`, `distance_to_scan_segment_mm`, `distance_to_meltpool_sample_mm`
  - Numeric (mm³): `volume_mm3`
  - Numeric (mm²): `surface_area_mm2`
  - Numeric (degrees): `major_axis_to_build_z_deg`
  - Numeric (W): `local_laser_power_W`
  - Numeric (mm/s): `local_scan_speed_mm_s`
  - Numeric (J/mm): `local_line_energy_J_mm`
  - Dimensionless numeric: `sphericity`, `elongation`, `flatness`, `local_meltpool_area_ratio`, `local_intensity_ratio`

### `/app/output/layer_defect_summary.csv`

- Row semantics: Each row represents one manufacturing layer.
- Stable key: `layer_id`.
- Fields:
  - Integer (layer number): `layer_id`
  - Integer (count): `n_all_pores`, `n_bulk_pores`, `n_near_surface_pores`, `n_bulk_gas`, `n_bulk_keyhole`, `n_bulk_lack_of_fusion`
  - Numeric (mm³): `bulk_pore_volume_mm3`
  - Numeric (%): `bulk_porosity_percent`
  - Dimensionless numeric: `median_meltpool_area_ratio`, `median_intensity_ratio`, `p10_meltpool_area_ratio`, `p90_meltpool_area_ratio`

### `/app/output/anomaly_regions.csv`

- Row semantics: Each row represents one persistent anomalous region.
- Stable key: `anomaly_id`.
- Fields:
  - String: `anomaly_id`, `dominant_mechanism`, `root_cause`
  - Integer (layer number): `start_layer`, `end_layer`
  - Integer (layers): `n_layers`
  - Integer (count): `n_associated_bulk_pores`
  - Numeric (mm): `x_min_mm`, `x_max_mm`, `y_min_mm`, `y_max_mm`
  - Numeric (J/mm): `mean_line_energy_J_mm`
  - Dimensionless numeric: `mean_meltpool_area_ratio`

### `/app/output/build_summary.csv`

- Row semantics: Single-row summary of the entire build.
- Fields:
  - Integer (count): `n_total_pores`, `n_bulk_pores`, `n_near_surface_pores`, `n_bulk_gas`, `n_bulk_keyhole`, `n_bulk_lack_of_fusion`, `n_anomaly_regions`
  - Numeric (mm³): `bulk_gas_volume_mm3`, `bulk_keyhole_volume_mm3`, `bulk_LOF_volume_mm3`
  - Numeric (%): `bulk_porosity_percent`
  - String (layer-number interval or set): `keyhole_anomaly_layers`, `LOF_anomaly_layers`
  - String: `build_disposition`

### `/app/output/lpbf_xct_qc.csv`

- Row semantics: Single-row summary of data and result status for the entire build.
- Fields:
  - Integer (count): `n_scan_vectors`, `n_meltpool_samples`, `n_XCT_pores`, `n_layers`, `n_bulk_pores`, `n_near_surface_pores`, `n_classified_gas`, `n_classified_keyhole`, `n_classified_LOF`, `n_anomaly_regions`
  - Numeric (mm): `maximum_registration_RMSE_mm`
  - Dimensionless numeric: `inside_build_fraction`, `local_association_fraction`
  - String: `registration_status`, `coordinate_layer_status`, `surface_accounting_status`, `mechanism_classification_status`, `anomaly_detection_status`, `overall_status`, `failure_reasons`

### Images

- `/app/output/registered_defect_map.png`: PNG showing the registered spatial map of pores and defects.
- `/app/output/layer_anomaly_diagnostics.png`: PNG showing layer-by-layer anomaly diagnostics.
- `/app/output/mechanism_evidence.png`: PNG showing pore morphology and local process evidence.

### `/app/output/LPBF_XCT_report.md`

Markdown report covering coordinate unification and spatial association, surface/bulk accounting, evidence for defect mechanisms, persistent anomalous regions and their spatial root causes, overall build disposition, and applicability limits.

### `/app/output/analysis.py` — Execution interface

- The script must accept `--input` and `--output` path options and must be runnable as `python analysis.py --input <input directory> --output <output directory>`. It must read the task attachments only from the directory given by `--input` and write every deliverable only into the directory given by `--output`; these directories may be copies mounted at other paths, so `/app/input` and `/app/output` must not be hard-coded as the only usable locations.
- One such run must regenerate every other deliverable listed in this section — same filenames, same row counts, and the same required fields as the submitted tables — unattended, without network access, and within about three minutes of wall-clock time.
- The file must be a complete analysis script rather than a stub or a wrapper around stored results.


Instruction:
# Joint Refinement of Inversion Twinning, CF3 Disorder Occupancies, and Absolute Structure from Unmerged Single-Crystal XRD Intensities

Single-crystal diffraction was performed on a chiral small-molecule crystal containing bromine and sulfur using Cu Kα radiation. The attachments contain background-subtracted unmerged integrated intensities, a starting model of the non-hydrogen atoms, complex scattering factors at the experimental wavelength, and the unit cell, space group, symmetry operations, and constraints for two conformations of the terminal CF3 group. The intensity table retains complete Friedel pairs and also includes weak intensities and a small number of negative intensities.

Jointly evaluate inversion twinning and two-conformation disorder of the CF3 group to obtain the occupancies, inversion-domain fraction, scale, and uncertainties; compare the full model with models having no twinning, equal occupancies, a single conformation, and lost Friedel information. Output the observed and calculated Friedel differences for each reflection pair, update the atomic occupancies, and report the absolute structure of the major domain, chemical formula/density, model selection, and a complete set of QC conclusions.

Generate analysis.py, refined_parameters.csv, refined_model.csv, model_comparison.csv, friedel_pair_diagnostics.csv, structure_summary.csv, scxrd_qc.csv, observed_vs_calculated_intensity.png, friedel_twin_diagnostics.png, disorder_twin_profile.png, and SCXRD_refinement_report.md under /app/output. Numeric fields in the CSV files must not mix values with units; field names or a unit column must specify the units unambiguously. Retain atom_id, model_part, friedel_pair_id, and model_id. All numerical values in the figures and report must be verifiable against the CSV files. The analysis must be reproducible from the attachments in /app/input and must not substitute fixed constants for refinement.

## Deliverable Files

This section defines only the submission interface and does not prescribe the analytical method or expected results. All files listed below are required and must be written directly to `/app/output/`.

### General CSV Conventions

- Format and encoding: comma-separated CSV, UTF-8 encoded, with a header row.
- The fields listed below are required. Column order and row order are not prescribed. Additional columns are permitted, but they must not replace required fields.
- The stable keys specified for each table must be nonempty and unique within their respective files.
- Numeric cells must contain numeric values only, without units; units must be expressed by the field name or the `unit` field.

### `analysis.py`

- Type and encoding: UTF-8 text source file.
- Purpose: recompute the analysis from the attachments in `/app/input/` and generate the remaining deliverable files.

### `refined_parameters.csv`

- Row semantics and stable key: each row represents one refined scalar parameter, uniquely identified by `parameter`.
- String fields: `parameter`, `unit`.
- Numeric fields: `value`, `standard_uncertainty`, `lower_95_percent`, `upper_95_percent`; the unit is given by the `unit` field in the same row.

### `refined_model.csv`

- Row semantics and stable key: each row corresponds to one atom in the input starting model, uniquely identified by `atom_id`.
- String fields: `atom_id`, `element`, `model_part`, `chemical_role`, `occupancy_constraint`.
- Numeric fields: `x_frac`, `y_frac`, `z_frac` (dimensionless fractional coordinates), `B_iso_A2` (Å²), `starting_occupancy`, `refined_occupancy` (dimensionless occupancy fractions).

### `model_comparison.csv`

- Row semantics and stable key: each row corresponds to one model being compared, uniquely identified by `model_id`.
- Integer field: `n_parameters` (count).
- String fields: `model_id`, `recommendation`.
- Numeric fields: `occupancy_A`, `occupancy_B`, `inversion_twin_fraction`, `scale_factor`, `chi_square`, `reduced_chi_square`, `R1_observed`, `wR2_all`, `GOF`, `AIC`, `delta_AIC` (all dimensionless).

### `friedel_pair_diagnostics.csv`

- Row semantics and stable key: each row corresponds to one Friedel reflection pair, uniquely identified by `friedel_pair_id`.
- String field: `friedel_pair_id`.
- Integer fields: `h`, `k`, `l` (dimensionless Miller indices).
- Numeric fields: `I_plus`, `sigma_plus`, `I_minus`, `sigma_minus`, `observed_difference`, `calculated_difference`, `I_plus_calculated`, `I_minus_calculated` (counts), `difference_z_score`, `bijvoet_quotient` (dimensionless).

### `structure_summary.csv`

- Row semantics: a single-row structural summary.
- String fields: `chemical_formula`, `space_group`, `major_domain_hand`, `minor_domain_relation`, `absolute_structure_conclusion`, `selected_model`.
- Integer field: `Z` (count).
- Numeric fields: `formula_weight_g_mol` (g·mol⁻¹), `cell_volume_A3` (Å³), `calculated_density_g_cm3` (g·cm⁻³), `inversion_twin_fraction`, `disorder_occupancy_A`, `disorder_occupancy_B`, `occupancy_sum` (dimensionless).

### `scxrd_qc.csv`

- Row semantics: a single-row summary of data and refinement QC.
- Integer fields: `n_reflections`, `n_friedel_pairs`, `n_negative_intensities`, `n_significant_friedel_differences` (counts).
- Numeric fields: `d_min_A`, `d_max_A` (Å), `friedel_pair_completeness`, `R1_observed`, `wR2_all`, `GOF`, `inversion_twin_fraction`, `twin_fraction_su`, `disorder_occupancy_A`, `disorder_occupancy_A_su`, `occupancy_sum`, `no_twin_delta_AIC`, `single_conformer_delta_AIC` (dimensionless).
- String fields: `friedel_status`, `occupancy_constraint_status`, `fit_status`, `absolute_structure_status`, `disorder_model_status`, `overall_status`, `failure_reasons`.

### Figures

- `observed_vs_calculated_intensity.png`: a PNG image presenting observed and calculated intensities.
- `friedel_twin_diagnostics.png`: a PNG image presenting Friedel reflection pairs and twinning diagnostics.
- `disorder_twin_profile.png`: a PNG image presenting an overview of disorder occupancies and twinning results.

### `SCXRD_refinement_report.md`

- Format and encoding: UTF-8 Markdown.
- Report categories: reflection processing, occupancy constraints, twinning and absolute structure, model comparison, stoichiometry, QC conclusions, and limitations of the conclusions.

### `analysis.py` — Execution interface

- Command-line interface: the script must accept `--input` and `--output` path options and must be runnable as `python analysis.py --input <input directory> --output <output directory>`.
- Path handling: it must read the attachments only from the directory given by `--input` and write all deliverables only into the directory given by `--output`. The grader supplies copies of the input at a different location, so `/app/input` and `/app/output` must not be hard-coded as the only usable paths.
- Completeness: one such run must regenerate every other deliverable listed in this section, with the same filenames, row counts, and required fields as the submitted tables, unattended and within about four minutes of wall-clock time.
- The file must be a complete analysis script rather than a stub or a wrapper around stored results.


Instruction:
# Reconstruction of the Seawater Carbonate System by Integrating CRM Alkalinity Titration, DIC Coulometry, and Spectrophotometric pH

Closed-cell total alkalinity titration, DIC coulometric determination, and spectrophotometric pH measurement were performed at four seawater stations. The attachments include the CRM certificate, electrode calibration, point-by-point added acid mass and potential, coulometer blanks and raw charges, three-wavelength absorbance data, station temperature, salinity, pressure, and nutrient data, as well as separate sets of laboratory and in situ equilibrium constants.

Establish metrological traceability for the acid and coulometer, and determine TA, DIC, and laboratory total-scale pH for each replicate. Use spectrophotometric pH to validate the TA-DIC results, and reconstruct the in situ free-, total-, and seawater-scale pH, pCO2, major inorganic carbon species, and aragonite saturation state for each station. Also evaluate the biases caused by using the nominal acid concentration, a volume basis, neglecting nutrients, or applying laboratory constants under in situ conditions, and provide analytical QC and station status assessments.

Generate analysis.py, acid_standardization.csv, crm_validation.csv, replicate_measurements.csv, carbonate_system.csv, sensitivity_analysis.csv, carbonate_qc.csv, gran_titration_diagnostics.png, carbonate_state_and_ph_agreement.png, shortcut_sensitivity.png, and seawater_carbonate_report.md under /app/output. Do not mix units into numeric CSV fields; retain run_id, station_id, replicate, and variant. Numerical values in the figures and report must be verifiable from the CSV files, and the analysis must be independently reproducible using only the attachments in /app/input.

## Deliverable Files

The following content defines only the submission interface and does not prescribe the analytical method or expected results. All 11 files listed below are required and must be placed directly under `/app/output/`. Additional files may be submitted. CSV files may contain additional columns, and column order is unrestricted, but the canonical field names listed below must be retained and must not be replaced by aliases.

All CSV files must use UTF-8 encoding and include headers. Fields of type `string` must contain text, fields of type `integer` must contain integers, and fields of type `number` must contain numeric values without unit text; units are specified by the field names or below. The stable key for each table must be unique within that table.

### `/app/output/analysis.py`

Required source text file; the tables, figures, and report it produces must be independently reproducible using only the attachments in `/app/input/`.

### `/app/output/acid_standardization.csv`

Each row represents a summary of standardization and coulometer calibration for one acid batch; the stable key is `acid_batch`.

- `string` (identifier): `acid_batch`
- `number` (mol/L): `nominal_molarity_mol_L`, `standardized_molarity_mol_L`, `standardized_molarity_sd_mol_L`
- `number` (%): `relative_standard_deviation_percent`
- `integer` (count): `n_CRM_runs`, `n_gran_points`
- `number` (µC): `coulometer_blank_charge_uC`
- `number` (µC/µmol): `coulometer_response_uC_per_umol`, `coulometer_response_sd_uC_per_umol`

### `/app/output/crm_validation.csv`

Each row represents one CRM measurement result; the stable key is the combination of `method` and `run_id`. For `method`, use the structured label `closed_cell_TA` or `coulometric_DIC`.

- `string` (identifier/category): `method`, `run_id`, `crm_batch`
- `number` (µmol/kg): `certified_value_umol_kg`, `measured_value_umol_kg`
- `number` (%): `recovery_percent`

### `/app/output/replicate_measurements.csv`

Each row represents one replicate measurement at one station; the stable key is the combination of `station_id` and `replicate`.

- `string` (identifier): `station_id`, `ta_run_id`, `dic_run_id`, `spectro_run_id`
- `integer` (replicate number): `replicate`
- `number` (µmol/kg): `TA_umol_kg`, `TA_within_run_sd_umol_kg`, `DIC_umol_kg`
- `number` (dimensionless pH or pH difference): `spectro_pH_total_lab`, `calculated_pH_total_lab`, `pH_difference_spectro_minus_calculated`

### `/app/output/carbonate_system.csv`

Each row represents a carbonate-system summary for one station; the stable key is `station_id`.

- `string` (identifier): `station_id`
- `integer` (count): `n_replicates`
- `number` (µmol/kg): `TA_mean_umol_kg`, `TA_sd_umol_kg`, `DIC_mean_umol_kg`, `DIC_sd_umol_kg`, `CO2_umol_kg_mean`, `HCO3_umol_kg_mean`, `CO3_umol_kg_mean`, `max_abs_ta_closure_umol_kg`
- `number` (dimensionless pH or pH difference): `spectro_pH_total_lab_mean`, `spectro_pH_total_lab_sd`, `calculated_pH_total_lab_mean`, `pH_agreement_mean`, `pH_total_in_situ_mean`, `pH_total_in_situ_sd`, `pH_free_in_situ_mean`, `pH_sws_in_situ_mean`
- `number` (µatm): `pCO2_uatm_mean`, `pCO2_uatm_sd`
- `number` (dimensionless): `omega_aragonite_mean`, `omega_aragonite_sd`
- `string` (status category): `aragonite_status`, `CO2_status`

### `/app/output/sensitivity_analysis.csv`

Each row represents the result for one station under one analytical variant; the stable key is the combination of `station_id` and `variant`. For `variant`, use the following structured labels: `full_mass_free_scale_nutrients_pressure`, `nominal_acid_molarity`, `volume_basis_instead_of_mass`, `nutrients_omitted`, `laboratory_constants_at_in_situ`.

- `string` (identifier/category): `station_id`, `variant`
- `number` (dimensionless pH or pH difference): `pH_total`, `delta_pH_total_vs_full`
- `number` (µatm): `pCO2_uatm`
- `number` (dimensionless): `omega_aragonite`
- `number` (%): `relative_pCO2_difference_percent`, `relative_omega_difference_percent`

### `/app/output/carbonate_qc.csv`

This table contains one task-level QC summary row and has no row key.

- `integer` (count): `n_CRM_titrations`, `n_sample_titrations`, `n_DIC_sample_runs`, `n_spectro_pH_runs`, `n_aragonite_undersaturated_stations`, `n_elevated_CO2_stations`
- `number` (mol/L): `standardized_acid_molarity_mol_L`
- `number` (%): `acid_RSD_percent`, `CRM_max_recovery_deviation_percent`, `max_TA_replicate_RSD_percent`, `max_DIC_replicate_RSD_percent`
- `number` (µC): `coulometer_blank_charge_uC`
- `number` (µC/µmol): `coulometer_response_uC_per_umol`
- `number` (dimensionless pH difference): `max_spectro_calculated_pH_difference`
- `number` (µmol/kg): `max_abs_TA_closure_umol_kg`
- `string` (status or description): `acid_standardization_status`, `CRM_status`, `mass_basis_status`, `pH_scale_status`, `nutrient_alkalinity_status`, `pressure_correction_status`, `replicate_status`, `TA_closure_status`, `overall_status`, `failure_reasons`

### Figures

The following PNG images are all required:

- `/app/output/gran_titration_diagnostics.png`: titration diagnostics
- `/app/output/carbonate_state_and_ph_agreement.png`: carbonate state and pH agreement
- `/app/output/shortcut_sensitivity.png`: sensitivity to different analytical variants

### `/app/output/seawater_carbonate_report.md`

Required UTF-8 Markdown report. The report must cover CRM metrological traceability, mass basis, pH scales, nutrients and pressure, replicate measurements and pH validation, sensitivity, analytical QC, station status, and the scope and limitations of the conclusions; no conclusions are predetermined.

### `/app/output/analysis.py` — Execution interface

- The script must accept `--input` and `--output` path options and must be runnable as `python analysis.py --input <input directory> --output <output directory>`.
- It must read the attachments only from the directory given by `--input` and write all deliverables only into the directory given by `--output`. The directories supplied may be copies at other locations, so `/app/input` and `/app/output` must not be hard-coded as the only usable paths.
- One such run must regenerate every other deliverable listed in this section, with the same filenames, row counts, and canonical fields as the submitted tables, unattended and within about five minutes of wall-clock time.
- The file must be a complete analysis script rather than a stub or a wrapper around stored results.


Instruction:
Read the structure .xyz file for each molecule under /app/input, perform calculations using free, noncommercial quantum chemistry software, and extract the following from the output files:
1. Dipole moment (total vector and magnitude, in Debye)
2. Sum of Mulliken charges on the substituent moiety (excluding CH3)
3. HOMO/LUMO orbital energies
4. HOMO–LUMO gap (eV)
Then calculate the correlation between the substituent charge and the molecular dipole moment.

Write the output files to /app/output:
- molecular_properties.csv
- atomic_mulliken_charges.csv
- correlation_charge_vs_dipole.csv

## Input Description

The input folder contains .xyz molecular structures sufficient for first-principles quantum chemistry calculations. There are 9 molecules in total: CH3F/Cl/OH/SH/NH2/CN/CF3/NF2/NO2.

## Column Specifications for Deliverables

**Column order is irrelevant**; column names are case-insensitive and delimiter-insensitive, and additional columns will be ignored. However, the following columns must be present:

- `molecular_properties.csv`: `molecule`, `substituent_X`, `dipole_mag_Debye`, `dipole_x_au`, `dipole_y_au`, `dipole_z_au`, `C_charge`, `avg_CH3_H_charge`, `substituent_total_charge`, `homo_Ha`, `lumo_Ha`, `homo_lumo_gap_eV`
- `correlation_charge_vs_dipole.csv`: `property_1`, `property_2`, `pearson_r`, `pearson_p`, `spearman_rho`, `n_samples`, `interpretation`

- `atomic_mulliken_charges.csv`: wide format, one row per molecule, with `molecule` as the stable row key and all nine molecules present. For each atom of the molecule there are two columns, `atom<i>_element` and `atom<i>_charge`, where `<i>` is the zero-based atom index in the order the atoms appear in that molecule's input `.xyz` file. `atom<i>_element` is the element symbol and `atom<i>_charge` is that atom's Mulliken charge in e. The header must cover the largest molecule in the input set (indices `0` through one less than its atom count); for molecules with fewer atoms the trailing cells are left empty.
- In `correlation_charge_vs_dipole.csv` the file contains exactly one data row, whose label cells identify the correlated pair of quantities: `property_1` must be `substituent_total_charge` and `property_2` must be `dipole_moment_Debye` (this is the label used for the dipole magnitude in this file, whose column in `molecular_properties.csv` is `dipole_mag_Debye`).


Instruction:
# Construct an Initial Structure Suitable for Biomolecular Dynamics Simulations from a Protein Structure

Read the structure file 7M6J.pdb under /app/input, initialize it, and use free and open-source protein PDB repair software to process the structure computationally. Based on the resulting structure 7M6J_fixed.pdb, output a processed structural conformation snapshot, scene.bmp. Then use free and open-source molecular dynamics software to generate topology files for molecular dynamics simulations and output the following files to /app/output:
- Overall molecular force-field topology
- A structure file conforming to the input format of the molecular dynamics software
- Force-field topology files for each chain in the protein

## Deliverables

The following defines only the submission interface and does not prescribe the processing method or expected results. The delivery root directory is `/app/output`; the files listed below may either be placed directly in this directory or placed together as a single file set in the molecular subdirectory `/app/output/7M6J/`.

| Filename | Requirement | Format and Content Semantics |
|---|---|---|
| `7M6J_fixed.pdb` | Required | Plain-text PDB in fixed-column format; each atom record represents one atom, and the coordinate fields are in Å |
| `scene.bmp` | Required | A decodable binary BMP image representing a conformational snapshot of the processed structure; `vmdscene.bmp` is an unambiguous filename alias, and submission of either one is sufficient |
| `topol.top` | Required | Plain-text TOP representing the overall topology |
| `conf.gro` | Required | Plain-text GRO in fixed-column format; contains an atom-count record, per-atom records, and a box-vector record, with coordinate fields in nm |
| `topol_Protein_chain_<chain>.itp` | Required | Plain-text ITP representing the chain-level topology of the protein chain corresponding to `<chain>` |
| `posre_Protein_chain_<chain>.itp` | Required | Plain-text ITP representing the chain-level position-restraint definitions for the same `<chain>` |

`<chain>` is the stable chain key for the file set and takes the values `A`, `B`, `C`, `D`, `E`, and `F`; both types of ITP files specified above must be provided separately for every chain key. All required files must be nonempty; text files must use ASCII or UTF-8 encoding. The ordering of fields or sections within PDB, GRO, TOP, and ITP files must follow the respective file formats; therefore, there are no table columns that may be arbitrarily reordered. Additional records and comments permitted by the formats, as well as other files in the delivery directory, may be retained. Required files must be submitted as separate files and must not be provided solely within an archive.

## Processing Requirements

The following requirements are part of the submission interface.

- Heteroatom removal: `7M6J_fixed.pdb` must contain no `HETATM` records; ligands, waters, ions, and other non-polymer entities present in the input structure must be stripped before topology generation.
- Structure repair: repair must add the missing heavy atoms of the resolved residues and add all hydrogens, so that the prepared model contains substantially more atom records than the input structure.
- Residue identity: the repair must not add or delete residues. For every chain, the ordered sequence of residue names in `7M6J_fixed.pdb` must be identical to that of the input structure; terminal residues must not be extended.
- Force field: the submitted topology must declare one of the following protein force fields — AMBER99SB-ILDN or CHARMM27.


Instruction:
# Construct Initial Structures and Energy-Minimization Files Suitable for Coarse-Grained Molecular Dynamics Simulations from a Protein Structure

Read the structure file 7M6J_fixed.pdb under /app/input, perform coarse-grained structural modeling using the coarse-grained force-field method currently most widely used for biomolecular simulations, and, based on the resulting coarse-grained structure cg.pdb, generate force-field topology files suitable for calculations with open-source, freely available molecular dynamics simulation software, as well as a snapshot of the processed coarse-grained structural conformation, scene.bmp. Then, using this coarse-grained structure, write a run-control file with appropriate parameters for coarse-grained simulation, construct a simulation box containing three proteins dissolved in a physiological saline environment, generate the initial computational input file required for energy-minimization calculations, and perform energy minimization. Place all output files under /app/output.

## Deliverable Files

This section defines only the submission format and does not prescribe implementation methods or expected results. Except where aliases are specified, all files listed below are required and must be placed under `/app/output/`.

| Canonical Path | Format/Encoding | Content Category | Acceptable Alias |
|---|---|---|---|
| `/app/output/cg.pdb` | PDB text, ASCII or UTF-8 | Coarse-grained structure | — |
| `/app/output/martini.itp` | ITP text, ASCII or UTF-8 | Coarse-grained force-field topology | — |
| `/app/output/molecule_A.itp` | ITP text, ASCII or UTF-8 | Topology of chain `A` | — |
| `/app/output/molecule_B.itp` | ITP text, ASCII or UTF-8 | Topology of chain `B` | — |
| `/app/output/molecule_C.itp` | ITP text, ASCII or UTF-8 | Topology of chain `C` | — |
| `/app/output/molecule_D.itp` | ITP text, ASCII or UTF-8 | Topology of chain `D` | — |
| `/app/output/molecule_E.itp` | ITP text, ASCII or UTF-8 | Topology of chain `E` | — |
| `/app/output/molecule_F.itp` | ITP text, ASCII or UTF-8 | Topology of chain `F` | — |
| `/app/output/topol.top` | TOP text, ASCII or UTF-8 | System-level topology | — |
| `/app/output/scene.bmp` | BMP image | Snapshot of the coarse-grained structural conformation | `/app/output/vmdscene.bmp`; a PNG-format snapshot is also accepted |
| `/app/output/hexamer_3copies.pdb` | PDB text, ASCII or UTF-8 | Initial structure of the simulation box comprising three proteins | — |
| `/app/output/ions.itp` | ITP text, ASCII or UTF-8 | Ion topology | — |
| `/app/output/ions.mdp` | MDP text, ASCII or UTF-8 | Run-control file for the ionization-preparation stage | — |
| `/app/output/em.mdp` | MDP text, ASCII or UTF-8 | Simulation run-control file | — |
| `/app/output/ionized.gro` | GRO text, ASCII or UTF-8 | Simulation-box structure with counterions properly incorporated | `/app/output/ions.gro` |
| `/app/output/em.tpr` | TPR binary file | Energy-minimization computational input | — |
| `/app/output/em.gro` | GRO text, ASCII or UTF-8 | Energy-minimized structure | — |
| `/app/output/em.log` | Text, ASCII or UTF-8 | Run log corresponding to the submitted energy-minimization result | — |

- Chain identifiers `A`–`F` are stable identity keys for the chain topology files.
- In PDB files, each atom/coarse-grained-site record represents one structural site, and the coordinate unit must follow the PDB specification (Å); in GRO files, each site record represents one structural site, and the coordinate unit must follow the GRO specification (nm).
- `topol.top` must express the system topology relationships, including references to the submitted force-field, chain, and ion topologies, as well as the system composition; no restrictions are imposed on the order of sections or references. If relative paths are used to reference other local topology files, those referenced files are also required deliverables, and the reference paths must remain resolvable.
- `ions.mdp`, `em.mdp`, `em.tpr`, `em.gro`, and `em.log` must each retain their native format; no order is prescribed for keys or sections. `em.log` must correspond to the same run as the submitted energy-minimization input and result.
- Additional auxiliary files may be submitted, but they may not replace any of the required files listed above.

- Solvent and ion naming: the coarse-grained water molecule type must be named `W` and the counterion molecule types must be named `NA` and `CL`, both in `ionized.gro` and in the `[ molecules ]` inventory of `topol.top`; the counts listed in `topol.top` must equal the numbers of the corresponding molecules present in `ionized.gro`.
- Salt content: "physiological saline" means an isotonic NaCl solution, i.e. an ion-pair concentration of 0.15 mol/L computed from the ion counts and the box volume of `ionized.gro`.
- Minimization: the energy minimization must be run with the steepest-descents minimizer (`integrator = steep` in `em.mdp`, with a positive `nsteps`).
- `em.log` must be the unmodified run log of that minimization, retaining the steepest-descents header, the final potential-energy and maximum-force records, the "finished mdrun" line, and the termination record stating that the run converged to the requested force tolerance or reached the maximum number of steps; it must contain no fatal-error record.


Instruction:
# Predict the Density of Ethanol and the Diffusion Coefficient of Ethanol Molecules and Obtain MSD Data Using Classical Molecular Dynamics Simulations Based on the Provided Ethanol Structure

Read the ethanol.mol2 structure file under /app/input, use the GAFF force field, which is currently commonly used for simulating organic solvent molecules, to construct a molecular dynamics simulation box, and extract the density of ethanol, the MSD of ethanol molecules, and the diffusion coefficient information after the simulation. Place all output files under /app/output.

## Deliverables

The following requirements define only the submission format and do not prescribe the implementation method or expected results. All files must be placed under `/app/output/`.

### Molecular Topology and Structure Files — Required

- `/app/output/ethanol_GMX.itp`: A plain-text molecular topology file that must contain an `[ atoms ]` section. Each non-comment data line in this section represents one atom, and the first seven columns, in order, must be:

| Column | Field | Type | Unit/Description |
|---|---|---|---|
| 1 | `nr` | Integer | Stable row key for the atom |
| 2 | `type` | String | Atom-type identifier |
| 3 | `resnr` | Integer | Residue number |
| 4 | `residue` | String | Residue name |
| 5 | `atom` | String | Atom name |
| 6 | `cgnr` | Integer | Charge-group number |
| 7 | `charge` | Numeric | Elementary charge `e` |
| 8 (optional) | `mass` | Numeric | Atomic mass |

  Blank lines, comment lines beginning with `;`, the eighth column `mass`, and additional columns following it are permitted; the order of the first seven columns specified above is fixed.
- `/app/output/ethanol_GMX.gro`: A GRO coordinate file for a single ethanol molecule. The second line is the integer number of atoms; the subsequent atom records specify, in order, the residue number, residue name, atom name, atom number, and three-dimensional coordinates, with coordinates expressed in nm; the final line contains the box vectors.
- `/app/output/topol.top`: The system topology file. `/app/output/ethanol_GMX.top` may be used as an equivalent filename.
- `/app/output/ethanolbox.gro`: The GRO coordinate file for the bulk ethanol simulation box. A `.gro` file whose filename contains `box` is also accepted; the record format must comply with the GRO contract described above, and each atom record represents one atom in the box.

### Simulation-Stage Files — Required

For each of the following three stages, a set of files with the corresponding prefix must be delivered; each file set represents the input and output of the corresponding stage:

| Stage Prefix | Stage Meaning | Required Files |
|---|---|---|
| `em` | Energy minimization | `em.tpr`, `em.gro`, `em.log` |
| `eq` | Pre-equilibration | `eq.tpr`, `eq.gro`, `eq.log` |
| `prod` | Production | `prod.tpr`, `prod.gro`, `prod.log` |

- The `.tpr` file is the binary run-input file for the stage, the `.gro` file is the GRO coordinate file output by the stage, and the `.log` file is the run log for the stage.

### `/app/output/energy.xvg` — Required

- Format/encoding: XVG plain text, UTF-8.
- Line semantics: Lines beginning with `#` or `@` are metadata lines; all other nonempty lines are data lines, with each line corresponding to one sampling time.
- A `.xvg` file whose filename contains `density` is accepted as an equivalent filename.
- Data columns must be arranged in the following order:

| Column | Field | Type | Unit | Meaning |
|---|---|---|---|---|
| 1 | `time` | Numeric | ps | Sampling time |
| 2 | `density` | Numeric | kg/m³ | Ethanol density |

- The order of the first two columns is fixed; additional columns are permitted and do not alter the semantics of the first two columns.

### `/app/output/msd.xvg` — Required

- Format/encoding: XVG plain text, UTF-8.
- Line semantics: Lines beginning with `#` or `@` are metadata lines; all other nonempty lines are data lines, with each line corresponding to one time lag.
- Data columns must be arranged in the following order:

| Column | Field | Type | Unit | Meaning |
|---|---|---|---|---|
| 1 | `lag_time` | Numeric | ps | Time lag |
| 2 | `msd` | Numeric | nm² | Mean squared displacement of ethanol molecules |

- The order of the first two columns is fixed; additional columns are permitted and do not alter the semantics of the first two columns.
- The metadata must contain a diffusion-coefficient record serialized as `D[<label>] = <number>`, where `<label>` is the result-series identifier and `<number>` is a numeric value, with units of `10^-5 cm²/s`.

No field or column aliases other than the equivalent filenames specified above are declared. Additional files may be submitted.