Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using flap.Intervals object in flap.plot slicing can fail if 'step' and 'number' is set. #11

Open
abencze opened this issue Jun 18, 2019 · 0 comments

Comments

@abencze
Copy link

abencze commented Jun 18, 2019

import numpy as np
import flap
import matplotlib.pyplot as plt

t = flap.Coordinate(
name='Time',
mode=flap.CoordinateMode(equidistant=True),
unit = 'Second',# Here the unit is NOT a Unit class object.
shape=(1000),
start=0,
step=1,
dimension_list=[1]
)
ch = flap.Coordinate(
name='Channel number',
mode=flap.CoordinateMode(equidistant=True),
shape=(3),
start = 1,
step=1,
dimension_list=[0])
ch_name = flap.Coordinate(
name='Signal name',
mode=flap.CoordinateMode(equidistant=False),
shape=(3),
values = ['CH-1','CH-2','CH-3'],
dimension_list = [0]
)
dunit = flap.Unit(name='Amplitude',unit='V')

#create a random array as data
data = np.random.randn(3,1000)
#create a flap data object instace
d = flap.DataObject(data_array = data,
data_unit = dunit,# Here the unit IS a Unit class object.
coordinates = [t,ch,ch_name],
data_title = 'Random series',
exp_id = '17062019_01'
)

interv = flap.Intervals(0,100,step=100,number=1)
d.plot(axes='Time',slicing={'Signal name':'CH-1','Time':interv})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant