Skip to main content

A module containing useful methods for working with fact

Project description

A python package with utils to work with the FACT Imaging Cerenkov Telescope

install with

$ pip install git+https://github.com/fact-project/pyfact

This takes automatically care of the dependencies which are installable with pip.

However, if you want to use the GUI Event Viewer you will need to install Tk before you install matplotlib as it depends on the tkagg backend.

functions:

fact includes several functions to convert the times used in fact data to more standard formats and vice versa.

e.g. :

from fact import run2dt

# convert fact fNight format to python datetime object:
date = run2dt("20150101")

Submodules

plotting

Utils for plotting data into a FACT camera view. Based on matplotlib.

import matplotlib.pyplot as plt
import fact.plotting as factplot
from numpy.random import normal

# create some pseudo data with shape (10, 1440):
data = normal(30, 5, (10, 1440))

factplot.camera(data[0])
plt.show()

Or you can start an interactive Viewer which lets you click through the events and save the images:

from fact.plotting import Viewer
from numpy.random import poisson

# pseudo data:
data = poisson(30, (10, 1440))

# call the Viewer with data and a label for the colorbar:
Viewer(data, "label")

There are also functions to get the camera_geometry from the delivered source file:

from fact.plotting import get_pixel_coords

pixel_x, pixel_y = get_pixel_coords()

auxservices

Utilities to read in our aux fits files into pandas dataframes.

from fact.auxservices import MagicWeather
from datetime import date

weather = MagicWeather(auxdir='/fact/aux/')

df = weather.read_date(date(2016, 1, 1))

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

pyfact-0.8.1.tar.gz (67.3 kB view details)

Uploaded Source

File details

Details for the file pyfact-0.8.1.tar.gz.

File metadata

  • Download URL: pyfact-0.8.1.tar.gz
  • Upload date:
  • Size: 67.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyfact-0.8.1.tar.gz
Algorithm Hash digest
SHA256 0ae5846b05ede42b830110d21a2bd9bb0b545f8bcf663aaab198b7814ea12016
MD5 8431baeeedd9839d69730904b54977e8
BLAKE2b-256 eac5090c6e1b58a165d2cf6a4c0b310b9663137167a9c0efdf2b50af82f2f7e7

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