Ejemplo n.º 1
0
# -*- coding: utf-8 *-*

from diaGrabber import source, target, plot
from diaGrabber.methods import merge, calc, exclude, transform

#folder = "/home/bedrich/Arbeitsfläche/Strahlvermessung/"
#folder = "/home/bedrich/Dokumente/HiWi/Strahlvermessung/"

file_name = "ods_example.ods"#"
#seperator = " "
data_type = "float"


###############
p = source.libreOfficeCalc(file_name, "Tabelle1", data_type)

#f.setReadoutEvery_n_line = 10


one = p.basisDimension("I [mA]",50, "A2:A100", [0,100])
#resolution = 50
#one.includeFromTo(0, 100, resolution)


two = p.mergeDimension("time", "B2:B100")
#two.merge = merge.mean()


#basis_dim = [one]
#merge_dim = [two]
#derivate_dim = one#nicht impl.
Ejemplo n.º 2
0
# -*- coding: utf-8 -*-

# This example show you the possibility of working with multidimensional problems

# As usual we need to include all modules of diaGrabber
from diaGrabber import source, target, plot
from diaGrabber.source.methods import merge, calc, exclude, transform


# This is our source: a libreOffice-document.
# There are two sheets in the document:
	# in 'functions' are all values written as a function of the mergeDimension
	# in 'values' are only the raw values of it.
	# REMEMBER: source.libreOfficeCalc can only read out values, not functions!
ods = source.libreOfficeCalc(
	file= "5d.ods", folder="ressources/", sheet="values", dataType="float")

# In this dokument one mergeDimension (merge) depends on four different
# basisDimensions (one,two,tree,four)
merge = ods.mergeDimension(
	name="merge", unit="-", cellRange="F3:F600", merge=merge.max())

# the given prefix 'm' stands for milli. If you use this attribute all values
# were transformed in the readout. in this case /1000
one = ods.basisDimension(
	name="one",unit="m/s", cellRange="A3:A600", resolution=40)
two = ods.basisDimension(
	name="two", prefix="m", unit="m/s", cellRange="B3:B600", resolution=40)
three = ods.basisDimension(
	name="three", prefix="m", unit="m/s", cellRange="C3:C600", resolution=40)
four = ods.basisDimension(
Ejemplo n.º 3
0
# -*- coding: utf-8 *-*
# this is the most easiest example: one file, two dimensions, a simple graph to plot
#######################


# after installing diaGrabber you can create procedures everywhere
# you just have to include some of the modules of diaGrabber via...
from diaGrabber import source, target, plot
from diaGrabber.source.methods import merge, calc, exclude, transform

# thats your source: a libreOffice-file
s = source.libreOfficeCalc(
	file= "ressources/2d.ods", sheet="Tabelle1", dataType="float")

# this will be our 'x'
x = s.basisDimension(
	name="I",unit="mA", cellRange="A2:A100", resolution=50)
# and this our 'y'
y = s.mergeDimension(
	name="time", unit="s", cellRange="B2:B100")

# read more about merge- and basis-dimensions the the documentation
# to understand its differences


# we need a target to fill with the values from our source:
t = target.coarseMatrix(s)
t.fill()


# ... and something to plot:
Ejemplo n.º 4
0
# both professors want to know whats the best height for its habitat
# there are some differences in the written results of the professors:
	# * different prefixes (one write distances in km, the other im m)
	# * differenct ammount of values
	# * different resolutions of the basiDimensions
	
# the aim is to connect the results of the 'Type' and to compair the results of
# "best height/Mueller" with "best height/Schroeder"

from diaGrabber import source, target, plot
from diaGrabber.source.methods import merge, calc, exclude, transform


#here are Prof. Muellers results:
#################################
mueller = source.libreOfficeCalc(
	file= "3d_b.ods", folder="ressources/", sheet="result", dataType="float")
##BASIS (in km)
x = mueller.basisDimension(
	name="x",unit="m", prefix='k',cellRange="a2:a229", resolution=20)

y = mueller.basisDimension(
	name="y", unit="m", prefix="k", cellRange="b2:b229", resolution=20)

##MERGE
type_max = mueller.mergeDimension(
	name="Type", unit="-", cellRange="d2:d229", merge=merge.max())

bestHeight = mueller.mergeDimension(
	name="best height/Mueller", unit="m", prefix="c", cellRange="c2:c229")
# the best height is defined as the height, where the type is maximal
bestHeight.alias().append(type_max)