Example #1
0
'''
import collections
import numpy as np
import numpy.ma as ma

from grid_cell_model.parameters import DataSpace
from grid_cell_model.otherpkg.log import log_warn, getClassLogger
from grid_cell_model.analysis.image import Position2D
import grid_cell_model.analysis.image as image
import grid_cell_model.analysis.signal as asignal
from grid_cell_model.parameters.metadata import EISweepExtractor

import logging

logger = logging.getLogger(__name__)
gammaAggrLogger = getClassLogger('GammaAggregateData', __name__)

__all__ = [
    'aggregate2DTrial',
    'aggregate2D',
    'computeYX',
    'computeVelYX',
    'aggregateType',
    'AggregateData',
    'FilteredData',
    'GridnessScore',
    'IGridnessScore',
    'IPCGridnessScore',
    'IPCIGridnessScore',
    'SpatialInformation',
    'ISpatialInformation',
Example #2
0
    ProbabilisticConnectionsSelector
    IIConnectionsSelector
    EEConnectionsSelector
    ISurroundOrigSelector
    ISurroundPastollSelector
    PickedISurroundPastollSelector
'''
from __future__ import absolute_import, print_function, division

import os.path

import numpy as np
from grid_cell_model.otherpkg.log import getClassLogger
from simtools.storage import DataStorage

baseLogger = getClassLogger('SlopeSelector', __name__)
probLogger = getClassLogger('ProbabilisticConnectionsSelector', __name__)


__all__ = [
    'SlopeSelector',
    'DefaultSelector',
    'PickedDefaultSelector',
    'NoThetaSelector',
    'ProbabilisticConnectionsSelector',
    'IIConnectionsSelector',
    'EEConnectionsSelector',
    'ISurroundOrigSelector',
    'ISurroundPastollSelector',
    'PickedISurroundPastollSelector',
]
Example #3
0
'''Manipulate random seeds during the simulation.

.. currentmodule:: grid_cell_model.models.seeds

'''

import numpy as np
import nest

from grid_cell_model.otherpkg.log import getClassLogger

trial_logger = getClassLogger("TrialSeedGenerator", __name__)


class TrialSeedGenerator(object):
    '''Seed manipulator that generates seeds based on trial numbers.

    This generator works only with NEST simulator and number of virtual
    processes must always be 1.

    Parameters
    ----------
    master_seed : int
        Master seed. Set by the user globally.
    offset : int
        Additional offset to the seed to enable further parameterisation. This
        will be added to the master seed.
    '''

    NGENS = 3
Example #4
0
import matplotlib.pyplot as plt
import matplotlib.ticker as ti
from scipy.interpolate import RectBivariateSpline

from grid_cell_model.plotting.global_defs import globalAxesSettings
from grid_cell_model.plotting.low_level   import symmetricDataLimits
from grid_cell_model.otherpkg.log import getClassLogger
from base                 import createColorbar

from . import xlabelText, ylabelText
from . import aggregate as aggr
from .base import filterData

logger = logging.getLogger(__name__)
plotSweepLogger = logging.getLogger('{0}.{1}'.format(__name__, 'plotSweep'))
logger_1d = getClassLogger('plot_1d_sweep', __name__)

def plotACTrial(sp, varList, iterList, noise_sigma, trialNumList=[0], **kw):
    '''Plot parameter sweep of gamma autocorrelation peaks.'''
    #kw arguments
    r           = kw.pop('r', 0)
    c           = kw.pop('c', 0)
    cbar        = kw.pop('cbar', True)
    sigmaTitle  = kw.pop('sigmaTitle', True)
    annotations = kw.pop('annotations', None)

    if isinstance(sp, aggr.AggregateData):
        C, X, Y  = sp.getData()
    else:
        C = aggr.aggregate2DTrial(sp, varList, trialNumList)
        Y, X = aggr.computeYX(sp, iterList, r=r, c=c)
Example #5
0
    BumpFormationFilter
'''
import collections
import numpy as np
import numpy.ma as ma

from grid_cell_model.parameters import DataSpace
from grid_cell_model.otherpkg.log import log_warn, getClassLogger
from grid_cell_model.analysis.image import Position2D
import grid_cell_model.analysis.image as image
import grid_cell_model.analysis.signal as asignal
from grid_cell_model.parameters.metadata import EISweepExtractor

import logging
logger = logging.getLogger(__name__)
gammaAggrLogger = getClassLogger('GammaAggregateData', __name__)

__all__ = [
    'aggregate2DTrial',
    'aggregate2D',
    'computeYX',
    'computeVelYX',
    'aggregateType',

    'AggregateData',
    'FilteredData',
    'GridnessScore',
    'IGridnessScore',
    'IPCGridnessScore',
    'IPCIGridnessScore',
    'SpatialInformation',
Example #6
0
'''Slope manipulations for the noise simulations.'''
from __future__ import absolute_import, print_function, division

import os.path

import numpy as np
from grid_cell_model.otherpkg.log import getClassLogger
from grid_cell_model.data_storage import DataStorage

baseLogger = getClassLogger('SlopeSelector', __name__)
probLogger = getClassLogger('ProbabilisticConnectionsSelector', __name__)

__all__ = [
    'DefaultSelector',
    'NoThetaSelector',
    'ProbabilisticConnectionsSelector',
    'IIConnectionsSelector',
]


class SlopeSelector(object):
    '''Extracts the slope data from bump slope data files.

    Parameters
    ----------
    data_root : str
        Path to the directory containing the slope data files.
    threshold : float
        Threshold below which the values will be ignored. This can avoid
        unnecessary simulations in which bump slope is close to zero. Set to
        -infinity if you want to ignore this threshold.