Coder Social home page Coder Social logo

pytspec's Introduction

pytspec

Calculating spectroscopic temperature (Vikhlinin 2006).

Installation

Simply run "make" in the top-level directory after cloning, and it will install the pytspec package. If you encounter an error about linking, please edit the lib/Makefile to have "gcc -fPIC" rather than "gcc" as the C-compiler. Make sure that you "make clean" in the /lib directory before you try to "make" in the top-level directory again to avoid the error.

Usage

Once installed, you can import pytspec into any Python code. The code requires calibration files following Vikhlinin (2006), who provides the "mk_cal" software. See their paper for more info.

Here is an example script with fake data. The list could be simulation data of all of the gas within a cluster, for example. These must be converted to Python arrays in order to pass to the C code. emission_measures is \int \rho^2 dV.

import pytspec
import array

calibration = b'test.dat'                                       # b so we can pass to C
temperatures = array.array('f', [0.3, 0.3, 0.3])                # in keV
abundances = array.array('f', [0.1, 0.1, 0.1])                  # in Solar 
emission_measures = array.array('f', [0.2, 0.2, 0.2])      # \int \rho^2 dV

tspec = pytspec.calculate(calibration, temperatures, abundances, emission_measures)

pytspec's People

Contributors

rennehan avatar hoptune avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Forkers

hoptune

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.