abby-baskind / seniorthesis

0 stars 2 forks source link

Pangeo Scratch Bucket #17

Open abby-baskind opened 3 years ago

abby-baskind commented 3 years ago

This is a super dumb question but how do I save stuff to the scratch bucket? The Pangeo documentation only describes how to set it up (below) but not how to use it.

import os
PANGEO_SCRATCH = os.environ['PANGEO_SCRATCH']
# -> gs://pangeo-scratch/<username>
import fsspec
mapper = fsspec.get_mapper(f'{PANGEO_SCRATCH}/sub/path')
# mapper can now be to read / write zarr stores
jbusecke commented 3 years ago

Have you tried ds.to_zarr(mapper). That should work.

Just be aware that the data is not kept long over there! After a few days it might be deleted.