issue_comments: 457584997
This data as json
html_url | issue_url | id | node_id | user | created_at | updated_at | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
https://github.com/pydata/xarray/issues/2042#issuecomment-457584997 | https://api.github.com/repos/pydata/xarray/issues/2042 | 457584997 | MDEyOklzc3VlQ29tbWVudDQ1NzU4NDk5Nw== | 601025 | 2019-01-25T14:13:35Z | 2019-01-25T14:13:35Z | NONE | Here is an old chunk of code I wrote awhile back to do this. Please
note three things. There is the metadata attached to the file (I think
it was through "tags"), metadata attached to the metadata "meta"
variable, and some metadata that is attached on a per-band basis. It
can be problematic when you assume that the info is global to the image
and is embedded somehow (it took me weeks to figure some of this out). Hope this helps: ===================== def to_tiff(data, fname, template=None, **kwargs): import numpy as np
surfaces) import numpy as np data = np.expand_dims(data,axis=0) elif 3 != nbands: # nothing to do if it is already 3D print("Error: to_tiff can only currently deal with 2D and 3D data") return
QGIS stats = { 'STATISTICS_MINIMUM': np.nanmin(data[b]), 'STATISTICS_MAXIMUM': np.nanmax(data[b]), 'STATISTICS_MEAN': np.nanmean(data[b]), 'STATISTICS_STDDEV': np.nanstd(data[b])} out.update_tags(b+1,**stats) #print(" stats= %s"%str(stats))
On Jan 23 2019 1:29 PM, Guillaume Eynard-Bontemps wrote:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
312203596 |