Beispiel #1
0
    def test_piv_new_multiproc(self):
        params = TopologyPIV.create_default_params()

        params.series.path = str(self.path_Jet)
        params.series.ind_start = 60
        params.series.ind_step = 1
        params.series.strcouple = "i, 0:2"

        params.piv0.shape_crop_im0 = 128
        params.multipass.number = 2
        params.multipass.use_tps = True

        params.saving.how = "recompute"
        params.saving.postfix = self.postfix

        topology = TopologyPIV(params, logging_level="info")
        topology.compute()

        topology = TopologyPIV(params, logging_level="info")
        topology.compute(nb_max_workers=2)

        # remove one file to test params.saving.how = "complete"
        path_files = list(Path(topology.path_dir_result).glob("piv*"))

        if not path_files:
            sleep(0.2)
            path_files = list(Path(topology.path_dir_result).glob("piv*"))

        path_files[0].unlink()

        params.saving.how = "complete"
        topology = TopologyPIV(params, logging_level="debug")
        topology.compute("exec_sequential")

        assert len(topology.results) == 1
Beispiel #2
0
def main(args):

    params = params_piv.make_params_piv(args.exp,
                                        savinghow=args.saving_how,
                                        postfix_in=args.postfix_in,
                                        postfix_out=args.postfix_out)

    topology = TopologyPIV(params, nb_max_workers=int(args.nb_cores))
    topology.compute(sequential=args.seq)
Beispiel #3
0
def piv_from_png(save_path, image_folder):

    correl_val = 0.3
    overlap_val = 0.5
    window_size_val = 128

    path_src = save_path + image_folder

    save_path = (
        save_path +
        f"piv_correl{correl_val}_overlap{overlap_val}_window_size{window_size_val}"
    )

    if os.path.isdir(save_path) is False:
        os.mkdir(save_path)
    os.chmod(save_path, 0o774)

    postfix = datetime.datetime.now().isoformat()

    params = TopologyPIV.create_default_params()

    params.series.path = path_src
    params.series.ind_start = 1
    params.series.ind_step = 1
    params.series.strcouple = "i:i+2"

    params.piv0.shape_crop_im0 = window_size_val
    params.piv0.grid.overlap = overlap_val
    params.multipass.number = int(log(window_size_val, 2) -
                                  4)  # last window is 32x32
    params.multipass.use_tps = "True"
    params.fix.correl_min = correl_val

    params.saving.how = "recompute"
    params.saving.path = save_path
    params.saving.postfix = postfix

    topology = TopologyPIV(params)
    topology.compute(sequential=False)

    paths = Path(save_path).glob("*.h5")
    for path in paths:
        os.chmod(path, 0o774)
Beispiel #4
0
    def test_piv_new(self):
        params = TopologyPIV.create_default_params()

        params.series.path = str(self.path_Oseen)
        params.series.ind_start = 1
        params.series.ind_step = 1

        params.piv0.shape_crop_im0 = 32
        params.multipass.number = 2
        params.multipass.use_tps = True

        # params.saving.how has to be equal to 'complete' for idempotent jobs
        # (on clusters)
        params.saving.how = "recompute"
        params.saving.postfix = self.postfix

        topology = TopologyPIV(params, logging_level="info")

        topology.make_code_graphviz(topology.path_dir_result / "topo.dot")
        topology.compute()
instructions = ParamContainer(path_file=xml_file)
instructions.Action.ActionName
tidy_uvmat_instructions(instructions)

params = params_from_uvmat_xml(instructions)

params.series.ind_start = 0

params.saving.path = os.path.split(os.path.dirname(xml_file))[0].replace(
    '.civ', '.piv')

try:
    nb_cores = int(sys.argv[-1])
except ValueError:
    nb_cores = None
else:
    params.saving.path += '_{}cores'.format(nb_cores)

params.saving.how = 'recompute'

# params.multipass.subdom_size = 100

print('params.multipass.subdom_size = ', params.multipass.subdom_size)

params.multipass.use_tps = True

topology = TopologyPIV(params, logging_level='info', nb_max_workers=None)

topology.compute()
Beispiel #6
0
from fluidimage.topologies.piv import TopologyPIV
import os

params = TopologyPIV.create_default_params()

params.series.path = '../../image_samples/Karman/Images'
params.series.ind_start = 1

params.piv0.shape_crop_im0 = 32
params.multipass.number = 2
params.multipass.use_tps = True

# params.saving.how has to be equal to 'complete' for idempotent jobs
# (on clusters)
params.saving.how = 'complete'
params.saving.postfix = 'piv_complete'

topology = TopologyPIV(params, logging_level='info')
#topology.make_code_graphviz('topo.dot')

topology.compute()
Beispiel #7
0
from fluidimage.topologies.piv import TopologyPIV

from fluidimage.run_from_xml import params_from_uvmat_xml, ParamContainer

base = '/fsnet/project/meige/2016/16FLUIDIMAGE/samples/Bicouche'

host = socket.gethostname()

instructions = ParamContainer(
    path_file=base + '/Dalsa1.civ_bench_cluster_xml/0_XML/img_1-161.xml')

params = params_from_uvmat_xml(instructions)

params.saving.path = base + '/Dalsa1.piv_bench_' + host

try:
    nb_cores = int(sys.argv[-1])
except ValueError:
    nb_cores = None
else:
    params.saving.path += '_{}cores'.format(nb_cores)

params.saving.how = 'complete'

params.multipass.subdom_size = 500

topology = TopologyPIV(params)

# topology.compute()
Beispiel #8
0
 def __init__(self, instructions, args):
     self.instructions = instructions
     self.params = params_piv_from_uvmat_xml(instructions, args)
     logger.info("Initialize fluidimage computations with parameters:")
     logger.info(self.params._make_xml_text())
     self.topology = TopologyPIV(self.params)