Example #1
0
if __name__ == '__main__':
    from geoproc.data.mwp import MWPDataManager

    t0 = time.time()
    locations = ["120W050N", "100W040N"]
    products = ["1D1OS", "2D2OT", "3D3OT"]
    DATA_DIR = "/Users/tpmaxwel/Dropbox/Tom/Data/Birkitt"
    location: str = locations[0]
    product = products[0]
    year = 2019
    download = False
    roi = None
    bbox = Region([3000, 3500], 750)
    savePath = DATA_DIR + "/watermap_diagnostic_animation.gif"
    fps = 1.0
    time_index_range = [192, 195]

    dataMgr = MWPDataManager(
        DATA_DIR, "https://floodmap.modaps.eosdis.nasa.gov/Products")
    dataMgr.setDefaults(product=product,
                        download=download,
                        year=2019,
                        start_day=time_index_range[0],
                        end_day=time_index_range[1],
                        bbox=bbox)
    data_arrays = dataMgr.get_tile_data(location)

    animator = ArrayAnimation(roi=roi, fps=fps)
    anim = animator.create_animation(data_arrays)
#    anim = animator.create_watermap_diag_animation( f"{product} @ {location}", data_arrays, savePath, True )
Example #2
0
                data_vars.append(key)
        return data_vars


if __name__ == "__main__":
    from geoproc.util.configuration import Region
    from geoproc.data.mwp import MWPDataManager

    colors = [(0, 0, 0), (0, 1, 0), (0, 0, 1), (1, 1, 0)]
    locations = ["120W050N", "100W040N"]
    products = ["1D1OS", "2D2OT", "3D3OT"]
    DATA_DIR = "/Users/tpmaxwel/Dropbox/Tom/Data/Birkitt"
    location: str = locations[0]
    product = products[0]
    year = 2019
    download = False
    roi = None
    bbox = Region([3000, 3500], 750)
    time_index_range = [0, 365]

    dataMgr = MWPDataManager(
        DATA_DIR, "https://floodmap.modaps.eosdis.nasa.gov/Products")
    dataMgr.setDefaults(product=product,
                        download=download,
                        year=2019,
                        start_day=time_index_range[0],
                        end_day=time_index_range[1])  # , bbox=bbox )
    data_array: xr.DataArray = dataMgr.get_tile_data(location, True)

    data_array.xplot.animate(title='MPW Time Slice Animation', colors=colors)
Example #3
0
        self.slider.start()
        plt.show()

    def getSubplotShape(self ) -> List[int]:
        n1 = math.floor( math.sqrt( self.nPlots ) )
        n0 = math.ceil( self.nPlots / n1 )
        return [ n0, n1 ]

if __name__ == "__main__":
    from geoproc.util.configuration import Region
    from geoproc.data.mwp import MWPDataManager

    colors = [ (0, 0, 0), (0, 1, 0), (0, 0, 1), (1, 1, 0) ]
    locations = [ "120W050N", "100W040N" ]
    products = [ "1D1OS", "2D2OT" , "3D3OT" ]
    DATA_DIR = "/Users/tpmaxwel/Dropbox/Tom/Data/Birkitt"
    location: str = locations[0]
    product = products[0]
    year = 2019
    download = False
    roi = None
    bbox = Region( [3000,3500], 750 )
    time_index_range = [ 0, 365 ]

    dataMgr = MWPDataManager(DATA_DIR, "https://floodmap.modaps.eosdis.nasa.gov/Products")
    dataMgr.setDefaults( product=product, download=download, year=2019, start_day=time_index_range[0], end_day=time_index_range[1] ) # , bbox=bbox )
    tile_data = dataMgr.get_tile_data( location, True )

    animation = SliceAnimation( tile_data, title='MPW Time Slice Animation', colors=colors )
    animation.show()