Skip to content

Instantly share code, notes, and snippets.

View jhamman's full-sized avatar
🔨
Building something new!

Joe Hamman jhamman

🔨
Building something new!
View GitHub Profile
In [4]: tif = cat['Houston-East-20170831-103f-100d-0f4f-RGB']['thumbnail']
In [5]: tiff_da = tif.to_dask()
Out[5]:
<xarray.DataArray (y: 552, x: 549, channel: 3)>
dask.array<xarray-<this-array>, shape=(552, 549, 3), dtype=uint8, chunksize=(552, 549, 3), chunktype=numpy.ndarray>
Coordinates:
* y (y) int64 0 1 2 3 4 5 6 7 8 ... 543 544 545 546 547 548 549 550 551
* x (x) int64 0 1 2 3 4 5 6 7 8 ... 540 541 542 543 544 545 546 547 548
* channel (channel) int64 0 1 2
In [6]: tiff_da.plot.imshow(rgb='channel')
In [1]: import intake
In [2]: catalog = intake.open_stac_catalog(
...: 'https://storage.googleapis.com/pdd-stac/disasters/catalog.json',
...: name='planet-disaster-data')
...:
In [3]: list(catalog)
Out[3]:
['20170831_172754_101c',
'2017831_195552_SS02',
'20170831_195425_SS02',
@jhamman
jhamman / conway.py
Last active February 27, 2020 21:36
streaming-zarr-blog
store = zarr.RedisStore(port=args.port)
root = zarr.group(store=store, overwrite=True)
t = 0
while True:
arr = root.zeros(f"{t}", shape=grid.shape, chunks=(25, 25)) # create a new array for this timestep
arr[…] = grid # write data to zarr array
t += 1 # increment the time counter
time.sleep(update_interval)
grid = update(grid, N) # evolve the model one time step
@jhamman
jhamman / map_blocks_dataset_schema.ipynb
Last active February 24, 2020 23:43
Xarray map_blocks examples
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jhamman
jhamman / apply_along_axis.ipynb
Created October 17, 2019 21:52
apply_along_axis (not working)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jhamman
jhamman / bcsd_example.ipynb
Created October 15, 2019 17:56
xsd samples
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jhamman
jhamman / xarray_and_mongodb.ipynb
Created October 7, 2019 23:26
Reading/writing xarray with mongodb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jhamman
jhamman / gmet_to_zarr.ipynb
Created March 22, 2019 00:06
GMET to Zarr Example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jhamman
jhamman / keybase.md
Created November 16, 2018 18:04
keybase.md

Keybase proof

I hereby claim:

  • I am jhamman on github.
  • I am jhamman (https://keybase.io/jhamman) on keybase.
  • I have a public key ASCa9ggHDxnpiQiIQJaQu7h3f4z4AwIq9XMtim36XN7Jhwo

To claim this, I am signing this object: