Skip to main content

Calculating opacities

Project description

Readme file

Implementations and versions

  • Implementations in the current version (Beta 0.1):
    • Grain shapes: Implemented CDE grains

    • Grain sizes: single grain size

    • Optical constants in database: olivine (amorph and crystalline), carbon, ices

    • Benchmarked with Michiels code (Min et al 2009)

  • Next version (Beta 1.0)
    • Grain shapes: implement MIE and CDE grains

    • Grain sizes: single grain size

    • Optical constants in database:
      • silicates (olivine and pyroxene, amorph and crystalline)

      • oxides

      • carbon

      • ices

      • Able to use your own optical constants

  • Future versions:
    • Grain shapes: implement MIE, DHS, GRF and CDE grains

    • Grain sizes: single grain size and grain size distributions

    • Optical constants in database:
      • Full JENA database avaliable in the SQLite database

      • Able to use your own optical constants

    • Other functions:
      • Enable saving of the opacities in a local SQLite DB

Installation:

  • PyPi:

    run: pip install opacity_calculator

  • Github
    • Download the files from github. Inside the opacity_calculator directory type (if you need permissions, with sudo): python setup.py install

    • To test if it works type python to go into python and then “import opacity_calculator”

Introduction

Coming…

Getting started: an example

If you have the opacity_calculator installed and want to test how it works and plot a spectrum with the matplotlib package. Go into python and type:
  • import opacity_calculator as oc

  • opacitiesForsterite = oc.getOpacity(“fo050”, 1.0, print_console_output = True)

  • import matplotlib.pyplot as plt

  • plt.plot(opac.getX(), opac.getY())

  • plt.show)

If you want to try another mineral, check the content of the database in the following way:
  • import opacity_calculator as oc

  • oc.printDatabase()

  • You can use the labels in the label column to generate opacities with the getOpacity function.

General code structure and classes

Classes & Files

  • Package and python scripts
    • __init__.py

    • main.py

  • DataClasses:
    • DataClass_SQLData.py

    • DataClass_OpticalConstants.py

    • DataClass_Opacity.py

  • Calculators
    • Calculator_CDE.py

    • Calculator_MIE.py

    • Calculator_DHS.py

  • Database files:
    • SQLITE_DATABASE.db

Databases and table structure

  • Filename: SQLITE_DATABASE.db

  • Table: OpticalConstantsTable

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

opacity_calculator-0.1.tar.gz (6.2 MB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for opacity_calculator-0.1.tar.gz
Algorithm Hash digest
SHA256 34c02cc3a69cf8d82ce44bfa22dff95509e4f14907ab431ba14d92fb955e8c21
MD5 10caaa3d4eacc6e0627911588cb15b59
BLAKE2b-256 b1fd984f5ac0bb9bcbf6624eb9fb3d37a7ca0a0cfd0ef4e7a034e7eacaa4acac

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