Skip to content

[GSoC] Add programmatic parser for Seaton opacity tables#474

Open
Manivenkat3612 wants to merge 1 commit intotardis-sn:masterfrom
Manivenkat3612:first-objective
Open

[GSoC] Add programmatic parser for Seaton opacity tables#474
Manivenkat3612 wants to merge 1 commit intotardis-sn:masterfrom
Manivenkat3612:first-objective

Conversation

@Manivenkat3612
Copy link

@Manivenkat3612 Manivenkat3612 commented Feb 1, 2026

📝 Description

Type: 🚀 feature

This pull request implements the GSOC 2026 First Objective for the
project idea (Continuum Opacity Source Reader): a programmatic reader for the Seaton continuum opacity data tables from the CDS archive (VI/80).

What was implemented:

  • get_seaton_opacity_df(file_name): A simple, reusable function that downloads and parses Seaton opacity data files (gzip-compressed) from the CDS FTP archive
  • Parses the Seaton format where block headers define temperature: logT = INDEX/40
  • Returns a clean pandas DataFrame with columns: logT, logNe, kappa_planck, kappa_rosseland
  • Handles network requests with proper error handling

Key features:

  • Downloads directly from CDS archive: https://cdsarc.cds.unistra.fr/ftp/VI/80/{file_name}
  • Works with gzip-compressed files (e.g., s92.201.gz)
  • Returns data in a standardized format ready for use in TARDIS atomic data workflows
  • Minimal, focused implementation suitable for extension to similar Seaton files

Files added:

  • carsus/io/literature/seaton.py - Reader function implementation
  • carsus/io/literature/__init__.py - Module initialization and exports
  • carsus/io/literature/tests/test_seaton.py - Test suite

📌 Resources

🚦 Testing

All changes have been tested using pytest.

  • Testing pipeline (pytest carsus/io/literature/tests/test_seaton.py -v returns 1 passed)
  • Other method
  • My changes can't be tested

Test coverage:

  • Validates DataFrame structure and columns
  • Verifies data types and column names
  • Confirms opacity values are positive
  • Uses mock.patch to avoid external network dependencies during testing

☑️ Checklist

  • I requested two reviewers for this pull request
  • I updated the documentation according to my changes
  • I built the documentation by applying the build_docs label

AI Usage Statement
Tool used: GitHub Copilot
How used: Refining code changes and improving PR wording.

Tool used: Gemini
How used: to research on (Opacities from the Opacity Project : VI/80) archive and to know about its formatting.

Confirmation: I confirm that I have read the PR Checklist and the AI and LLM Usage Policy. I fully understand all AI-assisted changes and can explain every modification in this PR.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2026

*beep* *bop*
Hi human,
I ran ruff on the latest commit (a3195eb).
Here are the outputs produced.
Results can also be downloaded as artifacts here.
Summarised output:

Details
1	F401	[*] unused-import
Found 1 error.
[*] 1 fixable with the `--fix` option.

Complete output(might be large):

Details
carsus/io/literature/tests/test_seaton.py:10:8: F401 [*] `pytest` imported but unused
Found 1 error.
[*] 1 fixable with the `--fix` option.

@Manivenkat3612
Copy link
Author

@andrewfullard @jvshields , please take a look when you have a moment. Thanks!

@Manivenkat3612
Copy link
Author

Hello @andrewfullard, @afloers, and @jvshields,

I would greatly appreciate your review of my implementation for the GSoC 2026 First Objective under the Continuum Opacity Source Reader project idea.

Your feedback would be very valuable to ensure I am aligned with the project’s expectations and coding standards.

@andrewfullard
Copy link
Contributor

This seems sensible. Does the tardisbase environment have gzip already, or would that need to be installed?

@Manivenkat3612
Copy link
Author

@andrewfullard Thanks for checking! It uses Python’s built-in gzip module (import gzip), so no extra package installation is needed in [tardisbase]. I also verified this in tardis-dev environment with: python3 -c 'import gzip; print("Gzip is ready!")'
which runs successfully.
image

@Manivenkat3612 Manivenkat3612 changed the title Add programmatic parser for Seaton opacity tables [GSoC] Add programmatic parser for Seaton opacity tables Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants