Comments (3)
If you specify it like so, it works:
ds[1].gh.rio.to_raster('converted_tiff.tiff')
rds = rioxarray.open_rasterio("converted_tiff.tiff")
rds.attrs
{'GRIB_cfName': 'geopotential_height',
'GRIB_cfVarName': 'gh',
'GRIB_dataType': 'fc',
'GRIB_gridDefinitionDescription': 'Latitude/longitude. Also called equidistant cylindrical, or Plate Carree',
'GRIB_gridType': 'regular_ll',
'GRIB_iDirectionIncrementInDegrees': 0.108,
'GRIB_iScansNegatively': 0,
'GRIB_jDirectionIncrementInDegrees': 0.108,
'GRIB_jPointsAreConsecutive': 0,
'GRIB_jScansPositively': 1,
'GRIB_latitudeOfFirstGridPointInDegrees': 0.138,
'GRIB_latitudeOfLastGridPointInDegrees': 30.054,
'GRIB_longitudeOfFirstGridPointInDegrees': 260.0,
'GRIB_longitudeOfLastGridPointInDegrees': 299.852,
'GRIB_missingValue': 3.4028234663852886e+38,
'GRIB_name': 'Geopotential height',
'GRIB_numberOfPoints': 102860,
'GRIB_NV': 0,
'GRIB_Nx': 370,
'GRIB_Ny': 278,
'GRIB_paramId': 156,
'GRIB_shortName': 'gh',
'GRIB_stepType': 'instant',
'GRIB_stepUnits': 1,
'GRIB_typeOfLevel': 'cloudBase',
'GRIB_units': 'gpm',
'long_name': 'Geopotential height',
'standard_name': 'geopotential_height',
'units': 'gpm',
'scale_factor': 1.0,
'add_offset': 0.0}
from rioxarray.
Thanks for the report. Fix in #616
from rioxarray.
@snowman2
ds[1].gh.rio.to_raster('converted_tiff.tiff')
-- this is good when you want to create a tiff for a single band. But if you want to create a tiff of multiple bands (convert ds containing multiple data variables/bands into tiff). How will you do that -- like this ds[0].rio.to_raster('converted_tiff.tiff')
, correct ?
Eg: each of these data variables pwat, tcc have different attributes + ds level attributes are also different.
print(ds[0])
<xarray.Dataset>
Dimensions: (latitude: 278, longitude: 370)
Coordinates:
time datetime64[ns] 2022-12-08
step timedelta64[ns] 00:00:00
atmosphereSingleLayer float64 0.0
* latitude (latitude) float64 0.138 0.246 0.354 ... 29.95 30.05
* longitude (longitude) float64 260.0 260.1 260.2 ... 299.7 299.9
valid_time datetime64[ns] 2022-12-08
Data variables:
unknown (latitude, longitude) float32 ...
pwat (latitude, longitude) float32 ...
tcc (latitude, longitude) float32 ...
tcolr (latitude, longitude) float32 ...
tcols (latitude, longitude) float32 ...
tcolw (latitude, longitude) float32 ...
tcoli (latitude, longitude) float32 ...
tcolc (latitude, longitude) float32 ...
refc (latitude, longitude) float32 ...
Attributes:
GRIB_edition: 2
GRIB_centre: kwbc
GRIB_centreDescription: US National Weather Service - NCEP
GRIB_subCentre: 0
Conventions: CF-1.7
institution: US National Weather Service - NCEP
I'm assuming that #616 will also be handling multiple bands case as well i.e. attributes will be preserved of each bands + ds level. Any timeline for merging & releasing #616 ?
from rioxarray.
Related Issues (20)
- rioxarray.open_rasterio(file) doesn't work HOT 1
- Support GCPs without known z coordinate HOT 3
- `spatial_ref` coordinate not accessible after saving dataset HOT 2
- Add a rio.fill.fillnodata-based nodata interpolation in addition to existing scipy-based HOT 1
- write somewhere in the documentation that extentions are not respecting F401
- Rename bands as variables using long_name attribute HOT 8
- typo in docs
- `rio.transform()` does not retrieve exact transform stored in `rio.write_transform()` HOT 2
- Document difference between `set_crs` and `write_crs` HOT 4
- Typo in docs: longitute
- Fail to reproject and reproject_match a dataset with rotation affine. HOT 3
- reproject_match renames dims HOT 2
- Xarray padding with mode='reflect'
- Padding and Croping doesn't end up same result HOT 2
- overview_level failing in xarray with engine='rasterio' due to missing doc? HOT 2
- Rio array merge missing HOT 3
- Delayed/chunked opening (sentinel) SAFE data with bands as variables fails HOT 1
- `reproject_match` raises `MissingSpatialDimensionError` with spatial dims set HOT 1
- Save larger raster with zstd compression writes dirty block HOT 3
- Memory leak when looping through data variables of a dataset loaded from a VRT HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rioxarray.