예제 #1
0
파일: import.py 프로젝트: G-Node/Mitsubachi
# -*- coding: utf-8 -*-
'''
Created on 29.02.2012

@author: stransky
'''
import datajongleur
import time
import morphjongleur.util.parser.swc
from morphjongleur.orm.datajongleur.morphology import *
from morphjongleur.orm.datajongleur.neuron_single_cell_experiment import *
from morphjongleur.orm.datajongleur.clamp import *
from morphjongleur.orm.datajongleur.neuron import *

session = datajongleur.get_session()

def import_swcs(swcs):
    for swc in swcs:
        import_swc(swc)

def import_swc(swc):
    m_swc   = Morphology.swc_parse(swc)
    #m_swc   = Morphology.specify(m_swc)

    print("uploading data according to '%s'." %(swc)) ,
    start_time = time.time()
    m_swc.save()
    end_time = time.time()
    print("in %s seconds." %(end_time-start_time))
    
    print m_swc.uuid
예제 #2
0
import datajongleur as dj
from datajongleur.beanbags.models import *
from datajongleur.beanbags.neuro.models import *
from datajongleur.addendum.models import *
import numpy as np
import random

session = dj.get_session()

numbers = []
numbers2 = []
numbers_int = []
units = []
time_units = ['s', 'ms', 'us', 'ns', 'ps']

for idx in range(4):
    numbers.append(random.random())
    numbers2.append(random.random())
    numbers_int.append(random.randint(0, 10))
    units.append(random.choice(time_units))

np_numbers = np.array(numbers)
np_numbers2 = np.array(numbers2)
np_numbers_int = np.array(numbers_int)