Beispiel #1
0
# 25 March 2011
# o Initial development implementation.
#

from numpy import *
from C_spectrum import *

C_t = C_spectrum_color(['r', 'g', 'b', 'y'])
C_t.component_add('b')

C_s = C_spectrum(['1', '2', '3'])
print C_s

a = array((1, 1, 1, 2, 5, 10, 5, 2, 1, 1, 1))
C_sa = C_spectrum(a)
C_sa.component_add(2)
print C_sa.arr_get()

C_sp = C_spectrum_color()
C_sp.component_add('red')
C_sp.component_add('red')
C_sp.component_add(2)
C_sp.component_add(0)

C_sp2a = C_spectrum_color((4, ))
C_sp2b = C_spectrum_color((1, ))
C_spA = C_sp2a + C_sp2a + C_sp2a + C_sp2a + C_sp2a + C_sp2b + C_sp2b
#C_spA.printConcise_set(True)
C_spA.printAsRow_set(True)
print C_spA
Beispiel #2
0
#
# 	A simple 'driver' for a C_genome class instance
#
# HISTORY
#
# 07 December 2011
# o Initial development implementation.
#

from    numpy           import *
from    C_ggrid         import *
from    C_spectrum      import *
import  copy

Csp     = C_spectrum(['R', 'G', 'B']);
Csp.component_add('R');
Csp.component_add('G');
Csp.component_add('B');

print Csp

Cg0     = C_ggrid(2, Csp, name='Cg0');
Cg1     = C_ggrid(np.array((2,2)), Csp, name='Cg1')
Cg00    = copy.deepcopy(Cg0) ; Cg00.mstr_name = 'Cg00'

print Cg0
print Cg00
Cg2 = Cg0 + Cg1
print Cg2

Cg0.spectralArray_set( np.array( [[0,0],[1,1]] ), np.array((10, 10, 10)))
# 25 March 2011
# o Initial development implementation.
#

from    numpy           import *
from    C_spectrum      import *

C_t     = C_spectrum_color(['r', 'g', 'b', 'y'])
C_t.component_add('b')

C_s     = C_spectrum(['1', '2', '3'])
print C_s

a       = array( (1, 1, 1, 2, 5, 10, 5, 2, 1, 1, 1))
C_sa    = C_spectrum(a)
C_sa.component_add(2)
print C_sa.arr_get()

C_sp    = C_spectrum_color()
C_sp.component_add('red')
C_sp.component_add('red')
C_sp.component_add(2)
C_sp.component_add(0)

C_sp2a   = C_spectrum_color((4,))
C_sp2b  = C_spectrum_color((1,))
C_spA   = C_sp2a + C_sp2a + C_sp2a + C_sp2a + C_sp2a + C_sp2b + C_sp2b
#C_spA.printConcise_set(True)
C_spA.printAsRow_set(True)
print C_spA