home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 454335138

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
454335138 MDU6SXNzdWU0NTQzMzUxMzg= 3012 rasterio.open exposes the GeoTIFF scales attribute, but xarray.open_rasterio not 191850 closed 0     0 2019-06-10T19:34:18Z 2019-07-10T16:00:50Z 2019-07-10T16:00:50Z CONTRIBUTOR      

Code Sample, a copy-pastable example if possible

```python

import xarray as xr from pprint import pprint arr = xr.open_rasterio('example.tif') pprint(arr) <xarray.DataArray (band: 2, y: 7201, x: 5896)> [84914192 values with dtype=uint16] Coordinates: * band (band) int64 1 2 * y (y) float64 -17.18 -17.18 -17.18 -17.19 ... -23.58 -23.58 -23.58 * x (x) float64 -52.23 -52.23 -52.23 -52.23 ... -46.99 -46.99 -46.99 Attributes: transform: (0.0008888888888890009, 0.0, -52.22933333332605, 0.0, -0.000... crs: +init=epsg:4326 res: (0.0008888888888890009, 0.0008888888888890009) is_tiled: 1 nodatavals: (65535.0, 65535.0) ```

Would be nice if it had the scales attribute.

Problem description

rasterio.open exposes the GeoTIFF scales attribute, but xarray not.

```python

import rasterio rarr = rasterio.open('example.tif') print(rarr.scales) (0.001, 0.001) ```

Expected Output

```python

import xarray as xr from pprint import pprint arr = xr.open_rasterio('example.tif') pprint(arr) <xarray.DataArray (band: 2, y: 7201, x: 5896)> [84914192 values with dtype=uint16] Coordinates: * band (band) int64 1 2 * y (y) float64 -17.18 -17.18 -17.18 -17.19 ... -23.58 -23.58 -23.58 * x (x) float64 -52.23 -52.23 -52.23 -52.23 ... -46.99 -46.99 -46.99 Attributes: transform: (0.0008888888888890009, 0.0, -52.22933333332605, 0.0, -0.000... crs: +init=epsg:4326 res: (0.0008888888888890009, 0.0008888888888890009) is_tiled: 1 nodatavals: (65535.0, 65535.0) scales: (0.001, 0.001) ```

xarray version

python xr.__version__ == '0.12.1'

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3012/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 0 rows from issue in issue_comments
Powered by Datasette · Queries took 0.709ms · About: xarray-datasette