Example #1
0
coordFileName = coordFileLocation + 'barkersfiel3_LatLongs_clustered.csv'
clusterFileName = coordFileLocation + 'clusteringResult.csv'
patchFilePattern = {'males': '/M_*', 'females': '/F_*'}
subfolder = folder + '/images/clustercharts2/'
vlocation = folder + 'videos/'
imagePattern = '/c_%06d.png'

coordinates = monet.getClusters(clusterFileName)

for expPath in sorted(glob.glob(folder + 'ANALYZED/E_05*')):
    experiment = expPath.split("/")[-1]
    vname = vlocation + experiment + '_cdots.mp4'
    background = coordFileName.replace('.csv', '.png')
    imageLocation = subfolder + experiment

    print(experiment)

    subprocess.Popen(['mkdir', subfolder + experiment])

    clusters = monet.populateClusters(len(coordinates[0]), coordFileName,
                                      expPath, patchFilePattern)

    genotypes = monet.getGenotypes(clusters[0]['male'][0])
    aggDict = monet.autoGenerateGenotypesDictionary(groups, genotypes)
    aggList = monet.aggregateClusters(clusters, aggDict)
    monet.generateClusterGraphs(aggList, [coordinates[1], coordinates[0]],
                                imageLocation, colors)
    video = monet.generateVideo(vname, background, imageLocation, imagePattern)

video.wait()
Example #2
0
    'black', 'cyan', 'teal'
]

groups = ["W", "H", "R", "B", "E"]

folder = '/Volumes/marshallShare/Comoros_STP/Comoros/output/'
patchFilePattern = {'males': '/M_*', 'females': '/F_*'}
imagePattern = '/c_%06d.png'
bgname = '/Volumes/marshallShare/Comoros_STP/Comoros/all_sites2.png'
clusterName = '/Volumes/marshallShare/Comoros_STP/Comoros/all_sites2.csv'

for expFolder in sorted(glob.glob(folder + '*normal')):
    expBaseName = expFolder.split('/')[-1]
    print(expBaseName)
    for expPath in sorted(glob.glob(expFolder + '/ANALYZED/E_*')):
        vname = expPath.replace('ANALYZED', 'videos') + '_cdots.mp4'
        coordinates = monet.getClusters(clusterName)

        imageLocation = expPath.replace('ANALYZED', 'images/clustercharts')
        subprocess.Popen(['mkdir', imageLocation])
        clusters = monet.populateClusters(len(coordinates[0]), '', expPath,
                                          patchFilePattern)
        genotypes = monet.getGenotypes(clusters[0]['male'][0])
        aggDict = monet.autoGenerateGenotypesDictionary(groups, genotypes)
        aggList = monet.aggregateClusters(clusters, aggDict)
        monet.generateClusterGraphs(aggList, coordinates, imageLocation,
                                    colors, None, 0.1, 512, True)
        video = monet.generateVideo(vname, bgname, imageLocation, imagePattern)

video.wait()
Example #3
0
    'females': '/F_*'
}, '/c_%06d.png')
(bgName, originalCoordFile) = (glob.glob(extras + '/*_VBG_' + clstSample +
                                         '_*.png')[0],
                               glob.glob(extras + '/*_CLS_' + clstSample +
                                         '_*.csv')[0])
(clusterName, vname,
 imageLocation) = (glob.glob(extras + '/*_AGCV_' + clstSample + '_*.csv')[0],
                   outPath + 'video/movie.mp4', outPath + 'clustercharts/')
original_corners = aux.get_corners(originalCoordFile)
coordinates = monet.getClusters(clusterName)
subprocess.Popen(['mkdir', imageLocation])

###############################################################################
# Create video
###############################################################################
clusters = monet.populateClusters(len(coordinates[0]), '', expPath,
                                  patchFilePattern)
clusters
aggList = monet.aggregateClusters(clusters, aggDict)
monet.generateClusterGraphs(aggList,
                            coordinates,
                            imageLocation,
                            colors,
                            original_corners,
                            0.002,
                            512,
                            skip=True)
video = monet.generateVideo(vname, bgName, imageLocation, imagePattern)
video.wait()