Skip to content

Instantly share code, notes, and snippets.

@gidden
Created May 10, 2017 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gidden/fc8eb41c1117f144d1e656f4800c2b82 to your computer and use it in GitHub Desktop.
Save gidden/fc8eb41c1117f144d1e656f4800c2b82 to your computer and use it in GitHub Desktop.
rasterio fill value of 0, but fillna with nans?
x = xr.open_dataset('wind5min100m.nc').Band1
x.isnull().count()
<xarray.DataArray 'Band1' ()>
array(9331200) # should be 0, right?
$ gdalinfo "DTU Wind Atlas/wind5min100m.nc"
Driver: netCDF/Network Common Data Format
Files: DTU Wind Atlas/wind5min100m.nc
Size is 4320, 2160
Coordinate System is:
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]]
Origin = (-180.000000000000000,89.999999999999986)
Pixel Size = (0.083333333333333,-0.083333333333333)
Metadata:
Band1#grid_mapping=crs
Band1#long_name=GDAL Band Number 1
Band1#_FillValue=0
crs#GeoTransform=-180 0.08333333333333333 0 90 0 -0.08333333333333333
crs#grid_mapping_name=latitude_longitude
crs#inverse_flattening=298.257223563
crs#longitude_of_prime_meridian=0
crs#semi_major_axis=6378137
crs#spatial_ref=GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4326"]]
lat#long_name=latitude
lat#standard_name=latitude
lat#units=degrees_north
lon#long_name=longitude
lon#standard_name=longitude
lon#units=degrees_east
NC_GLOBAL#Conventions=CF-1.5
NC_GLOBAL#GDAL=GDAL 2.1.0dev, released 2015/99/99
NC_GLOBAL#GDAL_AREA_OR_POINT=Area
NC_GLOBAL#history=Wed May 10 17:08:12 2017: GDAL CreateCopy( DTU Wind Atlas/wind5min100m.nc, ... )
Corner Coordinates:
Upper Left (-180.0000000, 90.0000000) (180d 0' 0.00"W, 90d 0' 0.00"N)
Lower Left (-180.0000000, -90.0000000) (180d 0' 0.00"W, 90d 0' 0.00"S)
Upper Right ( 180.0000000, 90.0000000) (180d 0' 0.00"E, 90d 0' 0.00"N)
Lower Right ( 180.0000000, -90.0000000) (180d 0' 0.00"E, 90d 0' 0.00"S)
Center ( 0.0000000, 0.0000000) ( 0d 0' 0.01"E, 0d 0' 0.01"N)
Band 1 Block=4320x1 Type=Float32, ColorInterp=Undefined
NoData Value=0
Metadata:
grid_mapping=crs
long_name=GDAL Band Number 1
NETCDF_VARNAME=Band1
_FillValue=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment