its_live_production
its_live_production copied to clipboard
Rename V2 datacubes to have names consistent with composites
Currently used naming convention for the datacubes http://its-live-data.s3.amazonaws.com/datacubes/v2/S50W070/ITS_LIVE_vel_EPSG32718_G0120_X450000_Y4450000.zarr should be changed to be consistent with corresponding composites: http://its-live-data.s3.amazonaws.com/datacubes/v2/S50W070/ITS_LIVE_velocityEPSG32718120m_X450000_Y4450000.zarr
To change global attributes within each of the datacubes in place (thanks to Alex Goodman: I think actually you might not even need to specify mode and the cube will just be writable by default):
import s3fs
import zarr
fs = s3fs.S3FileSystem(key=<aws_access_key_id>,
secret=<aws_secret_access_key>,
token=<aws_session_token>)
mapper = fs.get_mapper(<new_s3_url>)
g = zarr.open(mapper, mode='a')
g.attrs['s3'] = <new_s3_url>
g.attrs['url'] = <new_https_url>