示例#1
0
def test_locally_sparse_noise(lsn, nwb_c, analysis_c_new):
    ds = BODS(nwb_c)
    session_type = ds.get_metadata()['session_type']
    logging.debug(session_type)

    if session_type == si.THREE_SESSION_C:
        lsn_new = LocallySparseNoise.from_analysis_file(ds, analysis_c_new, si.LOCALLY_SPARSE_NOISE)
    elif session_type == si.THREE_SESSION_C2:
        lsn_new = LocallySparseNoise.from_analysis_file(ds, analysis_c_new, si.LOCALLY_SPARSE_NOISE_4DEG)
        
    #assert np.allclose(lsn.sweep_response, lsn_new.sweep_response)
    assert np.allclose(lsn.mean_sweep_response, lsn_new.mean_sweep_response, equal_nan=True)
def test_locally_sparse_noise(lsn, nwb_c, analysis_c_new):
    ds = BODS(nwb_c)
    session_type = ds.get_metadata()['session_type']
    logging.debug(session_type)

    if session_type == si.THREE_SESSION_C:
        lsn_new = LocallySparseNoise.from_analysis_file(ds, analysis_c_new, si.LOCALLY_SPARSE_NOISE)
    elif session_type == si.THREE_SESSION_C2:
        lsn_new = LocallySparseNoise.from_analysis_file(ds, analysis_c_new, si.LOCALLY_SPARSE_NOISE_4DEG)
        
    #assert np.allclose(lsn.sweep_response, lsn_new.sweep_response)
    assert np.allclose(lsn.mean_sweep_response, lsn_new.mean_sweep_response, equal_nan=True)
示例#3
0
def lsn(nwb_c, analysis_c):
    # in order to work around 2/3 unicode compatibility, separate files are specified for python 2 and 3
    # we need to look up a different key depending on python version
    key = si.LOCALLY_SPARSE_NOISE_4DEG if sys.version_info < (
        3, ) else si.LOCALLY_SPARSE_NOISE

    return LocallySparseNoise.from_analysis_file(BODS(nwb_c), analysis_c, key)
def lsna_check_hvas(data_set, data_file):
    avail_stims = si.stimuli_in_session(data_set.get_session_type())    
    targeted_structure = data_set.get_metadata()['targeted_structure']

    stim = None

    if targeted_structure == "VISp":
        if si.LOCALLY_SPARSE_NOISE_4DEG in avail_stims:
            stim = si.LOCALLY_SPARSE_NOISE_4DEG
        elif si.LOCALLY_SPARSE_NOISE in avail_stims:
            stim = si.LOCALLY_SPARSE_NOISE
    else:
        if si.LOCALLY_SPARSE_NOISE_8DEG in avail_stims:
            stim = si.LOCALLY_SPARSE_NOISE_8DEG
        elif si.LOCALLY_SPARSE_NOISE in avail_stims:
            stim = si.LOCALLY_SPARSE_NOISE

    if stim is None:
        raise MissingStimulusException("Could not find appropriate LSN stimulus for session %s", 
                                       data_set.get_session_type())
    else:
        logging.debug("in structure %s, using %s stimulus for plots", targeted_structure, stim)
            
    
    return LocallySparseNoise.from_analysis_file(data_set, data_file, stim)
def lsn(nwb_c, analysis_c):
    return LocallySparseNoise.from_analysis_file(BODS(nwb_c), analysis_c,
                                                 si.LOCALLY_SPARSE_NOISE_8DEG)
def lsn(nwb_c, analysis_c):
    # in order to work around 2/3 unicode compatibility, separate files are specified for python 2 and 3
    # we need to look up a different key depending on python version
    key =  si.LOCALLY_SPARSE_NOISE_4DEG if sys.version_info < (3,) else si.LOCALLY_SPARSE_NOISE

    return LocallySparseNoise.from_analysis_file(BODS(nwb_c), analysis_c, key)