Exemplo n.º 1
0
        #
        ## Altitude of the dataset [m].
        alt = fmd[0]['alt'] # [m]

        ## The pixel mask.
        pixel_mask = {}

        with open(dp.get_input_path() + "/masked_pixels.txt", "r") as mpf:
            rows = mpf.readlines()
            for row in rows:
                vals = [int(val) for val in row.strip().split("\t")]
                x = vals[0]; y = vals[1]; X = (256*y) + x; C = 1
                pixel_mask[X] = C

        ## The frames from the dataset.
        frames = ds.getFrames((lat, lon, alt), pixelmask = pixel_mask)

        lg.info(" * Found %d datafiles." % (len(frames)))

        ## A list of frames.
        mds = []

        ## A list of clusters.
        klusters = []

        # Loop over the frames.
        for i, f in enumerate(frames):

            if i % 50 == 0:
                print("*--> '%s': processing frame % 10d..." % (dp.get_name(), i))
Exemplo n.º 2
0
    lg.info("")

    ## The dataset to process.
    ds = Dataset(datapath)

    ## Latitude of the test dataset [deg.].
    lat = 51.509915

    ## Longitude of the test dataset [deg.].
    lon = -0.142515 # [deg.]

    ## Altitude of the test dataset [m].
    alt = 34.02

    ## The frames from the dataset.
    frames = ds.getFrames((lat, lon, alt))

    lg.info("* Found %d datafiles:" % (len(frames)))

    ## A list of frames.
    mds = []

    # Clusters
    #----------

    ## A list of clusters.
    klusters = []

    # Loop over the frames and upload them to the DFC.
    for f in frames:
    #
    ## Altitude of the dataset [m].
    alt = fmd[0]['alt'] # [m]

    ## The pixel mask.
    pixel_mask = {}

    with open(datapath + "/masked_pixels.txt", "r") as mpf:
        rows = mpf.readlines()
        for row in rows:
            vals = [int(val) for val in row.strip().split("\t")]
            x = vals[0]; y = vals[1]; X = (256*y) + x; C = 1
            pixel_mask[X] = C

    ## The frames from the dataset.
    frames = ds.getFrames((lat, lon, alt), pixelmask = pixel_mask)

    lg.info(" * Found %d datafiles." % (len(frames)))
    print("* Found %d datafiles." % (len(frames)))
    print("*")

    if max_frames < 0 or max_frames > len(frames):
        max_frames = len(frames)


    ## A list of frames.
    mds = []

    # Clusters
    #----------