Code Monkey home page Code Monkey logo

nenupy-tf's Introduction

nenupytf

nenupy

Python3 package to read and analyze NenuFAR Time-Frequency data from UnDySPuTeD.

Installation

nenupytf can be installed via pip, the recommended tool for installing Python packages:

pip install nenupytf

Keep you up-to-date with the latest release and get the newest functionalities by regularly updating the package:

pip install nenupytf --upgrade

Quickstart

Observation informations

Prior to diving within the large data volume, one can quickly get a summary of the observation content with the command:

nenupytf-info --obs /path/to/observation_directory/

The output would look something like:

--------------- nenupytf ---------------
Info on /path/to/observation_directory/OBS_XXX_XXX_0.spectra
Lane: 0
Time: 2019-10-13T07:20:55.0000000 -- 2019-10-13T07:25:54.4404020
Frequency: 39.0625 -- 76.5625 MHz
Beams: [0]
----------------------------------------

displaying for each lane, the time and frequency range as well as the beam indices.

On can also display these informations on individual files by printing the instance of a Lane object:

from nenupytf.read import Lane
l = Lane('OBS_XXX_XXX_0.spectra')
print(l)

Selecting data

To select data from a specific file:

from nenupytf.read import Lane
l = Lane('OBS_XXX_XXX_0.spectra')
time_select = ['2019-10-13 07:25:50.4404020', '2019-10-13 07:25:54.4404020']
freq_select = [50, 54.97]
spec = l.select(time=time_select, freq=freq_select, beam=0, stokes='I')

The select() methods, returns a SpecData object, storing the time (in astropy.time.Time format), the frequency in MHz, and the Dynamic Spectrum (which is a 2D array). Besides, a SpecData object enables several cleaning or analysis methods specific to dynamic spectra.

Averaging on time and frequency may allow to see a full picture of the data. However it may take some time to process!

from nenupytf.read import Lane
l = Lane('OBS_XXX_XXX_0.spectra')
spec = l.average()

Of course, one can specify every parameter such as in the select() method. Besides, average() accepts df and dt, respectively the time bin (in seconds) and the frequency bin (in MHz):

from nenupytf.read import Lane
l = Lane('OBS_XXX_XXX_0.spectra')
time_select = ['2019-10-13 07:25:50.4404020', '2019-10-13 08:00:00.000']
freq_select = [30, 60]
t, f, d = l.average(df=2, dt=3, time=time_select, freq=freq_select, beam=0, stokes='I')

Command-line plot

To display a plot of the selection, simply run:

nenupytf-plot --obs /path/to/observation_directory/ --lane 0 --time 2019-10-13T07:25:50.4404020 2019-10-13T07:25:54.4404020 --freq 50 54.97 --stokes I

nenupy-tf's People

Contributors

alanloh avatar cedricdviou avatar

Watchers

James Cloos avatar  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.