home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 447377321

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/2606#issuecomment-447377321 https://api.github.com/repos/pydata/xarray/issues/2606 447377321 MDEyOklzc3VlQ29tbWVudDQ0NzM3NzMyMQ== 1411854 2018-12-14T16:28:29Z 2018-12-14T16:28:29Z NONE

Sorry my bad, I mis-used the function. The encoding parameters must be in the attrs and not encoding argument:

```python

encoded_var = xr.Variable(dims=('latitude','longitude'), data=dask.array.from_array([[-11608, 9419, 27983, 32767, 1306], [ 24657, 27490, 12354, 13565, -31678], [ 23286, 19197, -425, -17866, -2387], [ 8284, 22922, 25428, 28584, 29309], [ 21439, 26654, 15559, -2752, -32766]], chunks=(5,5)), attrs=OrderedDict([('long_name', 'Land-sea mask'), ('standard_name', 'land_binary_mask'), ('units', '(0 - 1)'), ('_FillValue', -32767), ('dtype', dtype('int16')), ('scale_factor', 1.0576998063464478e-07), ('add_offset', 0.9965342350445446) ]), encoding={'chunks': (5, 5), } )

xr.conventions.decode_cf_variable('l',encoded_var).compute() <xarray.Variable (latitude: 5, longitude: 5)> array([[0.995306, 0.99753 , 0.999494, 1. , 0.996672], [0.999142, 0.999442, 0.997841, 0.997969, 0.993184], [0.998997, 0.998565, 0.996489, 0.994645, 0.996282], [0.99741 , 0.998959, 0.999224, 0.999558, 0.999634], [0.998802, 0.999353, 0.99818 , 0.996243, 0.993069]]) Attributes: long_name: Land-sea mask standard_name: land_binary_mask units: (0 - 1) dtype: int16 ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  391168098
Powered by Datasette · Queries took 0.514ms · About: xarray-datasette