Skip to main content

A python module for handling OPAT files

Project description

opatIO python module

This module defines a set of tools to build, write, and read OPAT files. The OPAT fileformat is a custom file format designed to efficiently store opacity information for a variety of compositions.

Installation

You can install this module with pip

git clone <repo>
cd 4DSSE/utils/opat
pip install .

General Usage

The general way that this module is mean to be used is to first build a schema for the opacity table and then save that to disk. The module will handle all the byte aligment and lookup table construction for you.

A simple example might look like the following

from opatio import OpatIO

opacityFile = OpatIO()
opacityFile.set_comment("This is a sample opacity file")
opaticyFile.set_source("OPLIB")

# some code to get a logR, logT, and logKappa table
# where logKappa is of size (n,m) if logR is size n and
# logT is size m

opacityFile.add_table((X, Z), logR, logT, logKappa)
opacityFile.save("opacity.opat")
opaticyFile.save_as_ascii("opacity.txt")

You can also read opat files which have been generated with the loadOpat function

from opatio import loadOpat

opacityFile = loadOpat("opacity.opat")

print(opacityFile.header)
print(opaticyFile.tables[0])

Problems

If you have problems feel free to either submit an issue to the root github repo (tagged as utils/opatio) or email Emily Boudreaux at emily.boudreaux@dartmouth.edu

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opatio-0.1.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opatio-0.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file opatio-0.1.tar.gz.

File metadata

  • Download URL: opatio-0.1.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for opatio-0.1.tar.gz
Algorithm Hash digest
SHA256 4bd6ad511fa4b1a3049df5f7c22741b4b3d73f780b9767141a37172d6abf4f16
MD5 2d52ee5ed6b54ff6b0b40326343a43fb
BLAKE2b-256 2d1c081b4fc5f5d13b34a684e246810278c5bdb7c1750c69f33c5ba92e19cc6a

See more details on using hashes here.

File details

Details for the file opatio-0.1-py3-none-any.whl.

File metadata

  • Download URL: opatio-0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for opatio-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c7853bb013b9f3a43b46c453ae5e78b1e00177f6c4c8353d6ecbb20b67c07bf5
MD5 8b043903d80bf75965adfe6b9f18f08a
BLAKE2b-256 e979b4edb2604adbc7bfdc4757f5018b9358fe20fa90c1e7fa75aba6ad0fbca5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page