Coder Social home page Coder Social logo

pysfg's Introduction

pysfg

Second attempt in getting a useful python library for our SFG setups.

Install

  • Install Anaconda for python3 64Bit
  • Setup a conda environment with: conda env create -f environment.yml
  • Activate the environment with: conda activate sfg
  • Add a kernel to the default jupyterlab environment ipython kernel install --user --name=sfg

Usage

Read data

import numpy as np
import pysfg

fpath = './data/00_sc_quartz_ssp_e10s_gal0.dat'
data = pysfg.read.victor.data_file(fpath)
# A dictionary with metadata and file data
data

# The raw file data
data['raw_data']

# Structured version of the data
data['data']

# The shape of the strcutured data is:
np.shape(data['data'])
(number_of_ppdelays, number_of_frames/scans, number_of_spectra, number_of_pixel)

# Import all data from a folder
all_data = pysfg.read.victor.folder('./')

# Data is a dict of dicts.
# Keys are the data file paths.
# Values is a data return dict
all_data.keys()

Get calibration from data header

import pysfg

fname = './data/sc_quartz.dat'
data = pysfg.read.victor.data_file(fname)
wavenumber = pysfg.calibration.from_victor_header(data).wavenumber

Of if you just want to read the wavenumber from the file:

import pysfg
fname = './data/sc_quartz.dat'
wavenumber = pysfg.calibration.from_victor_file_wavenumber(fname)

Take a look at the content of the tests/ folder. It contains usage examples and should aid in understanding the package.

pysfg's People

Contributors

deisi avatar

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.