Skip to main content

pyTOPSScrape

Liscence DOI

A tool for scraping OPLIB opacities from the TOPS web form and converting them into a format more similar to that used by OPAL

Documentation

This README provides a basic overview; however, more in depth documentation, including detailed descriptions of command line arguments and file formats may be found in the following links

Official Documentation (mirror)

PDF Documentation

Overview

The TOPS webform provides access to some of the most up to date high temperature radiative opacities. However, entering compositions manually into a webpage can be a chore. Especially when one needs opacities for a variety of rescaled compositions as is often the case when working stellar evolution programs.

pyTOPSScrape aims to address this by providing a simple interface to query the TOPS webform for n tables rescaled from a base composition. Moreover, pyTOPSScrape can transform the parameterization of opacities from mass density and temperature to R and temperature. Additionally, pyTOPSScrape will automatically merge tables from rescaled compositions into a single table mimicking the form of high temperature opacity tables already used by the Dartmouth Stellar Evolution Program (DSEP).

The primary interface for pyTOPSScrape is a bash script included with the package an example use of which follows

generateTOPStables GS98.abun rescalings.dat -d ./rawOutput -o GS98.opac -j 20

Further examples and the data files needed to run them may be found in the examples directory of this repository.

In addition to this bash script pyTOPSScrape provides a programmatic interface made up of primarily the pyTOPSScrape.api.call and pyTOPSScrape.api.TOPS_2_OPAL functions. These can be called individually if you wish to implement your own custom converter function (In that case you would use call and then some custom function in place of TOPS_2_OPAL)

Install

Prerequisites

  • python >= 3.8
  • mechanize >= 0.4.5
  • scipy >= 1.5.2
  • tqdm >= 4.50.2
  • beautifulsoup4 >= 4.8.2
  • importlib_resources >= 5.2.0

pip

If you install with pip all the dependencies should be automatically installed.

pip install pyTOPSScrape

Source

git clone https://github.com/tboudreaux/pytopsscrape.git
cd pytopsscrape
python setup.py install

Current Potential Issues

There seem to be small variations in the results I get from the web form for the same inputs between queries. I have yet to track down if this is on my end of on there end but be aware of this. (This also makes some of the tests fail as I am doing a character to character check and not a numeric similarity within threshold check)

Examples

There are examples of the command line interface and the python interface in the examples directory of this repository. It is recommended you look at those before querying your own opacity files. The command line examples are all shell scripts with names that describe that they are examples of while the python interface example is in the form of a Jupyter notebook in the examples/Notebooks directory. If you do not have jupyter installed on your computer you should be able to view the .ipynb file on Github.

Metadata

Release files for pyTOPSScrape 1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyTOPSScrape 1.1
File Size Uploaded Provenance
pytopsscrape-1.1.tar.gz 56.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pyTOPSScrape 1.1
File Interpreter ABI Platform
pytopsscrape-1.1-py3-none-any.whl Python 3 none any Details

Total release size: 114.6 kB

Release files / pytopsscrape-1.1.tar.gz

Download URL pytopsscrape-1.1.tar.gz
Size 56.2 kB
Tags Source
SHA-256 checksum
How to use checksums
af0109517a8d557619ab74f41b462db5251e8094f92457df2bf17292a6b0d4ea
BLAKE2b-256 checksum
How to use checksums
bf27607453d305f41de86a79430b3687cc808163857c11edef985a90259e1ea8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / pytopsscrape-1.1-py3-none-any.whl

Download URL pytopsscrape-1.1-py3-none-any.whl
Size 58.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b7eb56c2c79c28b7e846608c4b8bd3a05115eb003d98d63845cb88d07e45fb6d
BLAKE2b-256 checksum
How to use checksums
a4ab061a4f7eefd431d74bd415c30cfcc3c81549c4c3dd286bc31e6faac1e035
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Security for pyTOPSScrape 1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page