Exemplo n.º 1
0
def default_analysis_function():
    """
    Basic example of an analysis command for run_batch; users are
    likely to need something similar but highly customized.
    """
    # CEBALERT: why are these imports here rather than at the top?
    import topo
    from topo.plotting.plotgroup import save_plotgroup

    # Save all plotgroups listed in default_analysis_plotgroups
    for pg in default_analysis_plotgroups:
        save_plotgroup(pg,use_cached_results=True)

    # Plot projections from each measured map
    measured_sheets = [s for s in topo.sim.objects(ProjectionSheet).values()
                       if hasattr(s,'measure_maps') and s.measure_maps]
    for s in measured_sheets:
        for p in s.in_connections:
            save_plotgroup("Projection",projection=p)

    # Test response to a standardized pattern
    from imagen import Gaussian
    from analysis import pattern_present
    from math import pi
    pattern_present(inputs=Gaussian(orientation=pi/4,aspect_ratio=4.7))
    save_plotgroup("Activity",saver_params={"filename_suffix":"_45d"})
Exemplo n.º 2
0
def default_analysis_function():
    """
    Basic example of an analysis command for run_batch; users are
    likely to need something similar but highly customized.
    """
    # CEBALERT: why are these imports here rather than at the top?
    import topo
    from topo.plotting.plotgroup import save_plotgroup

    # Save all plotgroups listed in default_analysis_plotgroups
    for pg in default_analysis_plotgroups:
        save_plotgroup(pg,use_cached_results=True)

    # Plot projections from each measured map
    measured_sheets = [s for s in topo.sim.objects(ProjectionSheet).values()
                       if hasattr(s,'measure_maps') and s.measure_maps]
    for s in measured_sheets:
        for p in s.in_connections:
            save_plotgroup("Projection",projection=p)

    # Test response to a standardized pattern
    from topo.pattern import Gaussian
    from analysis import pattern_present
    from math import pi
    pattern_present(inputs=Gaussian(orientation=pi/4,aspect_ratio=4.7))
    save_plotgroup("Activity",saver_params={"filename_suffix":"_45d"})
 def test_cfprojection_saving(self):
     save_plotgroup('Projection',
                    projection=self.sim['B'].projections('Afferent'))
     self.exists("testplotfilesaver_000000.00_B_Afferent.png")
 def test_cf_saving(self):
     save_plotgroup("Connection Fields",sheet=self.sim['B'])
     self.exists("testplotfilesaver_000000.00_Afferent.png")
 def test_orientation_preference_saving(self):
     save_plotgroup('Orientation Preference')
     self.exists("testplotfilesaver_000000.00_B_Orientation_Preference.png")
     self.exists("testplotfilesaver_000000.00_B_Orientation_PreferenceAndSelectivity.png")
     self.exists("testplotfilesaver_000000.00_B_Orientation_Selectivity.png")
     self.exists("testplotfilesaver_000000.00__Color_Key.png")
 def test_activity_saving(self):
     save_plotgroup('Activity')
     self.exists("testplotfilesaver_000000.00_A_Activity.png")
     self.exists("testplotfilesaver_000000.00_B_Activity.png")