This example notebook shows how to use xarray
and rioxarray
libraries to convert Weather Research and Forecasting Model (WRF) NetCDF files to GeoTIFF files.
References
import os
import xarray as xr
import rioxarray as rxr
from osgeo import osr, ogr
from affine import Affine
import rasterio
file_name = 'wrfout_20221211_12.nc'
file_path = os.path.join('data', file_name)
ds = xr.open_dataset(file_path)
ds
<xarray.Dataset> Dimensions: (Time: 1, south_north: 299, west_east: 299, bottom_top: 35, bottom_top_stag: 36, soil_layers_stag: 4, west_east_stag: 300, south_north_stag: 300, seed_dim_stag: 8, num_turb_layers: 7) Coordinates: XLAT (Time, south_north, west_east) float32 4.8 ... 25.81 XLONG (Time, south_north, west_east) float32 -94.28 ... ... XTIME (Time) datetime64[ns] 2022-12-11T12:00:00 XLAT_U (Time, south_north, west_east_stag) float32 4.8 ..... XLONG_U (Time, south_north, west_east_stag) float32 -94.32... XLAT_V (Time, south_north_stag, west_east) float32 4.764 ... XLONG_V (Time, south_north_stag, west_east) float32 -94.28... Dimensions without coordinates: Time, south_north, west_east, bottom_top, bottom_top_stag, soil_layers_stag, west_east_stag, south_north_stag, seed_dim_stag, num_turb_layers Data variables: (12/253) Times (Time) |S19 b'2022-12-11_12:00:00' LU_INDEX (Time, south_north, west_east) float32 17.0 ... 17.0 ZNU (Time, bottom_top) float32 0.9969 0.9899 ... 0.003772 ZNW (Time, bottom_top_stag) float32 1.0 0.9938 ... 0.0 ZS (Time, soil_layers_stag) float32 0.05 0.25 0.7 1.5 DZS (Time, soil_layers_stag) float32 0.1 0.3 0.6 1.0 ... ... PCB (Time, south_north, west_east) float32 0.0 ... 0.0 PC (Time, south_north, west_east) float32 0.0 ... 0.0 LANDMASK (Time, south_north, west_east) float32 0.0 ... 0.0 LAKEMASK (Time, south_north, west_east) float32 0.0 ... 0.0 SST (Time, south_north, west_east) float32 299.4 ... 2... SST_INPUT (Time, south_north, west_east) float32 0.0 ... 0.0 Attributes: (12/132) TITLE: OUTPUT FROM WRF V4.2.1 MODEL START_DATE: 2022-12-09_12:00:00 SIMULATION_START_DATE: 2022-12-09_12:00:00 WEST-EAST_GRID_DIMENSION: 300 SOUTH-NORTH_GRID_DIMENSION: 300 BOTTOM-TOP_GRID_DIMENSION: 36 ... ... ISLAKE: 21 ISICE: 15 ISURBAN: 13 ISOILWATER: 14 HYBRID_OPT: 2 ETAC: 0.2
array([[[ 4.800179, 4.800179, ..., 4.800179, 4.800179], [ 4.873489, 4.873489, ..., 4.873489, 4.873489], ..., [25.74202 , 25.74202 , ..., 25.74202 , 25.74202 ], [25.808258, 25.808258, ..., 25.808258, 25.808258]]], dtype=float32)
array([[[-94.28289, -94.20933, ..., -72.43421, -72.36065], [-94.28289, -94.20933, ..., -72.43421, -72.36065], ..., [-94.28289, -94.20933, ..., -72.43421, -72.36065], [-94.28289, -94.20933, ..., -72.43421, -72.36065]]], dtype=float32)
array(['2022-12-11T12:00:00.000000000'], dtype='datetime64[ns]')
array([[[ 4.800179, 4.800179, ..., 4.800179, 4.800179], [ 4.873489, 4.873489, ..., 4.873489, 4.873489], ..., [25.74202 , 25.74202 , ..., 25.74202 , 25.74202 ], [25.808258, 25.808258, ..., 25.808258, 25.808258]]], dtype=float32)
array([[[-94.31967, -94.24611, ..., -72.39743, -72.32387], [-94.31967, -94.24611, ..., -72.39743, -72.32387], ..., [-94.31967, -94.24611, ..., -72.39743, -72.32387], [-94.31967, -94.24611, ..., -72.39743, -72.32387]]], dtype=float32)
array([[[ 4.763527, 4.763527, ..., 4.763527, 4.763527], [ 4.836838, 4.836838, ..., 4.836838, 4.836838], ..., [25.775139, 25.775139, ..., 25.775139, 25.775139], [25.84137 , 25.84137 , ..., 25.84137 , 25.84137 ]]], dtype=float32)
array([[[-94.28289, -94.20933, ..., -72.43421, -72.36065], [-94.28289, -94.20933, ..., -72.43421, -72.36065], ..., [-94.28289, -94.20933, ..., -72.43421, -72.36065], [-94.28289, -94.20933, ..., -72.43421, -72.36065]]], dtype=float32)
array([b'2022-12-11_12:00:00'], dtype='|S19')
array([[[17., 17., ..., 10., 9.], [17., 17., ..., 9., 9.], ..., [17., 17., ..., 17., 17.], [17., 17., ..., 17., 17.]]], dtype=float32)
array([[0.996907, 0.989883, 0.980982, 0.969786, 0.955825, 0.938608, 0.917657, 0.892567, 0.863075, 0.829143, 0.791013, 0.749237, 0.70464 , 0.658129, 0.610267, 0.56134 , 0.51169 , 0.461709, 0.411838, 0.362558, 0.314379, 0.269114, 0.228781, 0.193503, 0.162648, 0.135661, 0.112057, 0.091412, 0.073355, 0.057561, 0.043748, 0.031666, 0.021098, 0.011856, 0.003772]], dtype=float32)
array([[1. , 0.993815, 0.985951, 0.976014, 0.963558, 0.948093, 0.929124, 0.906191, 0.878942, 0.847208, 0.811078, 0.770949, 0.727525, 0.681755, 0.634504, 0.58603 , 0.53665 , 0.48673 , 0.436688, 0.386988, 0.338128, 0.29063 , 0.247599, 0.209963, 0.177044, 0.148252, 0.12307 , 0.101044, 0.08178 , 0.06493 , 0.050193, 0.037303, 0.026029, 0.016168, 0.007543, 0. ]], dtype=float32)
array([[0.05, 0.25, 0.7 , 1.5 ]], dtype=float32)
array([[0.1, 0.3, 0.6, 1. ]], dtype=float32)
array([[[ 0. , 0. , ..., 55.003365, 34.780743], [ 0. , 0. , ..., 85.846634, 47.660275], ..., [ 0. , 0. , ..., 0. , 0. ], [ 0. , 0. , ..., 0. , 0. ]]], dtype=float32)
[3139500 values with dtype=float32]
[3139500 values with dtype=float32]
[3218436 values with dtype=float32]
[3218436 values with dtype=float32]
[3218436 values with dtype=float32]
[3129035 values with dtype=float32]
[3129035 values with dtype=float32]
array([0.], dtype=float32)
array([0.], dtype=float32)
array([0.], dtype=float32)
array([0.], dtype=float32)
array([0.], dtype=float32)
array([0.], dtype=float32)
array([[[ 797.03906, 798.03125, ..., 769.97656, 765.96094], [ 795.9844 , 795.82477, ..., 776.7966 , 767.84375], ..., [1359.3984 , 1373.6005 , ..., 1578.9543 , 1566.6641 ], [1362.3984 , 1365.7031 , ..., 1569.2188 , 1570.1094 ]]], dtype=float32)
array([[[95000. , 95000. , ..., 92828.05, 92895.95], [95000. , 95000. , ..., 92768.97, 92835.33], ..., [95000. , 95000. , ..., 95000. , 95000. ], [95000. , 95000. , ..., 95000. , 95000. ]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
[3129035 values with dtype=float32]
[3129035 values with dtype=float32]
array([[0. , 0.440255, 0.44179 , 0.443725, 0.446139, 0.449106, 0.452709, 0.456993, 0.461976, 0.467613, 0.473784, 0.480282, 0.486846, 0.492036, 0.49362 , 0.495364, 0.497282, 0.499391, 0.501711, 0.504263, 0.507069, 0.524673, 0.533435, 0.533436, 0.533435, 0.533435, 0.533436, 0.533435, 0.533435, 0.533436, 0.533435, 0.533435, 0.533436, 0.533435, 0.533434]], dtype=float32)
array([[0. , 0.559745, 0.55821 , 0.556275, 0.553861, 0.550894, 0.547291, 0.543007, 0.538024, 0.532387, 0.526216, 0.519718, 0.513154, 0.507964, 0.50638 , 0.504636, 0.502718, 0.500609, 0.498289, 0.495737, 0.492931, 0.475327, 0.466565, 0.466564, 0.466565, 0.466565, 0.466564, 0.466565, 0.466565, 0.466564, 0.466565, 0.466565, 0.466564, 0.466565, 0.466566]], dtype=float32)
array([[-161.67383 , -127.16081 , -100.64015 , -80.277985, -64.66454 , -52.7166 , -43.60618 , -36.698784, -31.51154 , -27.677639, -24.919815, -23.028955, -21.848349, -21.163233, -20.62999 , -20.250965, -20.031994, -19.983284, -20.120546, -20.466572, -21.053589, -23.239233, -26.56996 , -30.378195, -34.732147, -39.71008 , -45.401608, -51.90878 , -59.348618, -67.85488 , -77.580215, -88.6992 , -101.41235 , -115.94728 , -132.56485 ]], dtype=float32)
array([[ 0. , -142.35533 , -112.356705, -89.313194, -71.63031 , -58.082497, -47.73055 , -39.855415, -33.90792 , -29.47042 , -26.226427, -23.937103, -22.423122, -21.500334, -20.89321 , -20.43872 , -20.140884, -20.00761 , -20.05168 , -20.292084, -20.75593 , -22.092485, -24.793234, -28.346745, -32.409595, -37.054676, -42.365543, -48.437626, -55.379944, -63.317333, -72.39238 , -82.76795 , -94.6307 , -108.19384 , -123.70047 ]], dtype=float32)
array([[-0.006185, -0.007864, -0.009936, -0.012457, -0.015464, -0.018969, -0.022933, -0.027249, -0.031734, -0.03613 , -0.040129, -0.043424, -0.04577 , -0.047252, -0.048473, -0.04938 , -0.04992 , -0.050042, -0.0497 , -0.04886 , -0.047498, -0.043031, -0.037636, -0.032918, -0.028792, -0.025183, -0.022026, -0.019265, -0.01685 , -0.014737, -0.01289 , -0.011274, -0.009861, -0.008625, -0.007543]], dtype=float32)
array([[ 0. , -0.007025, -0.0089 , -0.011197, -0.013961, -0.017217, -0.020951, -0.025091, -0.029492, -0.033932, -0.038129, -0.041776, -0.044597, -0.046511, -0.047862, -0.048927, -0.04965 , -0.049981, -0.049871, -0.04928 , -0.048179, -0.045264, -0.040334, -0.035277, -0.030855, -0.026987, -0.023604, -0.020645, -0.018057, -0.015793, -0.013814, -0.012082, -0.010567, -0.009243, -0.008084]], dtype=float32)
array([1.466566], dtype=float32)
array([-0.466566], dtype=float32)
array([0], dtype=int32)
[3129035 values with dtype=float32]
array([[[0.016334, 0.016343, ..., 0.01547 , 0.01533 ], [0.016389, 0.016325, ..., 0.015555, 0.015305], ..., [0.014555, 0.014352, ..., 0.011327, 0.011502], [0.014653, 0.014603, ..., 0.011443, 0.011448]]], dtype=float32)
array([[[298.13858, 298.14594, ..., 297.5444 , 297.61597], [298.148 , 298.12592, ..., 297.4982 , 297.63043], ..., [297.82886, 297.8692 , ..., 296.02176, 296.03564], [297.79626, 297.83832, ..., 296.09134, 296.00705]]], dtype=float32)
array([[[297.0878 , 297.0936 , ..., 298.34634, 298.36234], [297.0952 , 297.07425, ..., 298.34625, 298.428 ], ..., [296.48474, 296.5151 , ..., 294.48557, 294.51065], [296.45047, 296.4915 , ..., 294.5648 , 294.4812 ]]], dtype=float32)
array([[[101243.414, 101245.234, ..., 99062.36 , 99127.18 ], [101245.77 , 101244.52 , ..., 99008.65 , 99067.72 ], ..., [101595.75 , 101607.5 , ..., 101837.734, 101824.08 ], [101597.93 , 101598.95 , ..., 101825.61 , 101825.305]]], dtype=float32)
array([[[ 0.878513, 0.95753 , ..., -0.063973, -0.285251], [ 0.997357, 1.035526, ..., 0.226644, -0.075598], ..., [-1.421018, -1.383761, ..., -2.551165, -2.325998], [-1.323078, -1.282944, ..., -2.40284 , -2.218556]]], dtype=float32)
array([[[ 5.319528, 5.322879, ..., -1.299879, -1.536486], [ 5.13392 , 5.149986, ..., -1.087655, -1.360346], ..., [ 4.161437, 4.253236, ..., -7.305748, -7.519074], [ 4.168088, 4.252729, ..., -7.397453, -7.543906]]], dtype=float32)
array([0.000125], dtype=float32)
array([0.000125], dtype=float32)
array([[[64000000., 64000000., ..., 64000000., 64000000.], [64000000., 64000000., ..., 64000000., 64000000.], ..., [64000000., 64000000., ..., 64000000., 64000000.], [64000000., 64000000., ..., 64000000., 64000000.]]], dtype=float32)
array([[[8000., 8000., ..., 8000., 8000.], [8000., 8000., ..., 8000., 8000.], ..., [8000., 8000., ..., 8000., 8000.], [8000., 8000., ..., 8000., 8000.]]], dtype=float32)
array([0.], dtype=float32)
array([0.], dtype=float32)
array([1.828659], dtype=float32)
array([-1.135214], dtype=float32)
array([0.306555], dtype=float32)
array([3840], dtype=int32)
[3129035 values with dtype=float32]
[3129035 values with dtype=float32]
[3129035 values with dtype=float32]
[3129035 values with dtype=float32]
[3129035 values with dtype=float32]
[3129035 values with dtype=float32]
array([[[ 0. , 0. , ..., 52.763885, 59.22222 ], [ 0. , 0. , ..., 61.419754, 62.654316], ..., [ 0. , 0. , ..., 0. , 0. ], [ 0. , 0. , ..., 0. , 0. ]]], dtype=float32)
array([[[ 0. , 0. , ..., 43.65278 , 51.083332], [ 0. , 0. , ..., 50.543205, 49.024693], ..., [ 0. , 0. , ..., 0. , 0. ], [ 0. , 0. , ..., 0. , 0. ]]], dtype=float32)
array([[[0.08 , 0.08 , ..., 0.539967, 0.523 ], [0.08 , 0.08 , ..., 0.524016, 0.523 ], ..., [0.08 , 0.08 , ..., 0.08 , 0.08 ], [0.08 , 0.08 , ..., 0.08 , 0.08 ]]], dtype=float32)
[357604 values with dtype=float32]
[357604 values with dtype=float32]
[357604 values with dtype=float32]
[357604 values with dtype=float32]
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0.000000e+00, 0.000000e+00, ..., 3.619283e-06, 6.007111e-06], [0.000000e+00, 0.000000e+00, ..., 3.221353e-06, 4.165081e-06], ..., [0.000000e+00, 0.000000e+00, ..., 0.000000e+00, 0.000000e+00], [0.000000e+00, 0.000000e+00, ..., 0.000000e+00, 0.000000e+00]]], dtype=float32)
array([[[0. , 0. , ..., 0.008763, 0.009041], [0. , 0. , ..., 0.006231, 0.006651], ..., [0. , 0. , ..., 0. , 0. ], [0. , 0. , ..., 0. , 0. ]]], dtype=float32)
array([[[17, 17, ..., 10, 9], [17, 17, ..., 9, 9], ..., [17, 17, ..., 17, 17], [17, 17, ..., 17, 17]]], dtype=int32)
array([[[14, 14, ..., 12, 12], [14, 14, ..., 12, 12], ..., [14, 14, ..., 14, 14], [14, 14, ..., 14, 14]]], dtype=int32)
array([[[ 0. , 0. , ..., 52.741657, 59.188885], [ 0. , 0. , ..., 59.622215, 58.162964], ..., [ 0. , 0. , ..., 0. , 0. ], [ 0. , 0. , ..., 0. , 0. ]]], dtype=float32)
array([[[ 0. , 0. , ..., -27.951529, -24.61982 ], [ 0. , 0. , ..., -25.006855, -24.771826], ..., [ 0. , 0. , ..., 0. , 0. ], [ 0. , 0. , ..., 0. , 0. ]]], dtype=float32)
array([[[ 0. , 0. , ..., 316447. , 487135.2], [ 0. , 0. , ..., 527797. , 404044.8], ..., [ 0. , 0. , ..., 0. , 0. ], [ 0. , 0. , ..., 0. , 0. ]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0. , 0. , ..., 0.011324, 0.024993], [0. , 0. , ..., 0.019201, 0.019644], ..., [0. , 0. , ..., 0. , 0. ], [0. , 0. , ..., 0. , 0. ]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[-0.133462, -0.132292, ..., 0.212604, 0.213736], [-0.133953, -0.132783, ..., 0.212075, 0.213208], ..., [-0.261845, -0.260788, ..., 0.050974, 0.051998], [-0.262204, -0.261148, ..., 0.05044 , 0.051463]]], dtype=float32)
array([[[0. , 0. , ..., 2.894194, 3.647057], [0. , 0. , ..., 3.137755, 2.618689], ..., [0. , 0. , ..., 0. , 0. ], [0. , 0. , ..., 0. , 0. ]]], dtype=float32)
[3129035 values with dtype=float32]
[3129035 values with dtype=float32]
array([[[ 0.000000e+00, 0.000000e+00, ..., -9.973578e-06, -5.211326e-06], [ 0.000000e+00, 0.000000e+00, ..., 4.295769e-06, -2.602215e-06], ..., [ 0.000000e+00, 0.000000e+00, ..., 0.000000e+00, 0.000000e+00], [ 0.000000e+00, 0.000000e+00, ..., 0.000000e+00, 0.000000e+00]]], dtype=float32)
array([[[-0.000000e+00, -0.000000e+00, ..., -6.726638e-05, -1.904549e-05], [-0.000000e+00, -0.000000e+00, ..., -5.673385e-05, -1.624247e-05], ..., [-0.000000e+00, -0.000000e+00, ..., -0.000000e+00, -0.000000e+00], [-0.000000e+00, -0.000000e+00, ..., -0.000000e+00, -0.000000e+00]]], dtype=float32)
array([[[ 0. , 0. , ..., 26.595, 15.75 ], [ 0. , 0. , ..., 26.595, 15.75 ], ..., [ 0. , 0. , ..., 0. , 0. ], [ 0. , 0. , ..., 0. , 0. ]]], dtype=float32)
array([[[0. , 0. , ..., 1.33125, 0.89375], [0. , 0. , ..., 1.33125, 0.89375], ..., [0. , 0. , ..., 0. , 0. ], [0. , 0. , ..., 0. , 0. ]]], dtype=float32)
array([[[ 0. , 0. , ..., -0.2108 , -0.07745], [ 0. , 0. , ..., -0.2108 , -0.07745], ..., [ 0. , 0. , ..., 0. , 0. ], [ 0. , 0. , ..., 0. , 0. ]]], dtype=float32)
array([[[ 0. , 0. , ..., 0.0284 , -0.028425], [ 0. , 0. , ..., 0.0284 , -0.028425], ..., [ 0. , 0. , ..., 0. , 0. ], [ 0. , 0. , ..., 0. , 0. ]]], dtype=float32)
array([[[ 0. , 0. , ..., -0.060875, -0.0184 ], [ 0. , 0. , ..., -0.060875, -0.0184 ], ..., [ 0. , 0. , ..., 0. , 0. ], [ 0. , 0. , ..., 0. , 0. ]]], dtype=float32)
array([[[ 0. , 0. , ..., -0.151175, -0.07025 ], [ 0. , 0. , ..., -0.151175, -0.07025 ], ..., [ 0. , 0. , ..., 0. , 0. ], [ 0. , 0. , ..., 0. , 0. ]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0. , 0. , ..., 0.020825, 0. ], [0. , 0. , ..., 0.020825, 0. ], ..., [0. , 0. , ..., 0. , 0. ], [0. , 0. , ..., 0. , 0. ]]], dtype=float32)
array([[[0.98159 , 0.98159 , ..., 0.98159 , 0.98159 ], [0.981697, 0.981697, ..., 0.981697, 0.981697], ..., [1.085915, 1.085915, ..., 1.085915, 1.085915], [1.086522, 1.086522, ..., 1.086522, 1.086522]]], dtype=float32)
array([[[0.98159 , 0.98159 , ..., 0.98159 , 0.98159 ], [0.981697, 0.981697, ..., 0.981697, 0.981697], ..., [1.085915, 1.085915, ..., 1.085915, 1.085915], [1.086522, 1.086522, ..., 1.086522, 1.086522]]], dtype=float32)
array([[[0.981538, 0.981538, ..., 0.981538, 0.981538], [0.981643, 0.981643, ..., 0.981643, 0.981643], ..., [1.086218, 1.086218, ..., 1.086218, 1.086218], [1.086825, 1.086825, ..., 1.086825, 1.086825]]], dtype=float32)
array([[[0.98159 , 0.98159 , ..., 0.98159 , 0.98159 ], [0.981697, 0.981697, ..., 0.981697, 0.981697], ..., [1.085915, 1.085915, ..., 1.085915, 1.085915], [1.086522, 1.086522, ..., 1.086522, 1.086522]]], dtype=float32)
array([[[0.98159 , 0.98159 , ..., 0.98159 , 0.98159 ], [0.981697, 0.981697, ..., 0.981697, 0.981697], ..., [1.085915, 1.085915, ..., 1.085915, 1.085915], [1.086522, 1.086522, ..., 1.086522, 1.086522]]], dtype=float32)
array([[[0.98159 , 0.98159 , ..., 0.98159 , 0.98159 ], [0.981697, 0.981697, ..., 0.981697, 0.981697], ..., [1.085915, 1.085915, ..., 1.085915, 1.085915], [1.086522, 1.086522, ..., 1.086522, 1.086522]]], dtype=float32)
array([[[0.98159 , 0.98159 , ..., 0.98159 , 0.98159 ], [0.981697, 0.981697, ..., 0.981697, 0.981697], ..., [1.085915, 1.085915, ..., 1.085915, 1.085915], [1.086522, 1.086522, ..., 1.086522, 1.086522]]], dtype=float32)
array([[[0.981538, 0.981538, ..., 0.981538, 0.981538], [0.981643, 0.981643, ..., 0.981643, 0.981643], ..., [1.086218, 1.086218, ..., 1.086218, 1.086218], [1.086825, 1.086825, ..., 1.086825, 1.086825]]], dtype=float32)
array([[[1.018809, 1.018809, ..., 1.018809, 1.018809], [1.0187 , 1.0187 , ..., 1.0187 , 1.0187 ], ..., [0.920625, 0.920625, ..., 0.920625, 0.920625], [0.920111, 0.920111, ..., 0.920111, 0.920111]]], dtype=float32)
array([[[0.981538, 0.981538, ..., 0.981538, 0.981538], [0.981643, 0.981643, ..., 0.981643, 0.981643], ..., [1.086218, 1.086218, ..., 1.086218, 1.086218], [1.086825, 1.086825, ..., 1.086825, 1.086825]]], dtype=float32)
array([[[1.220403e-05, 1.220403e-05, ..., 1.220403e-05, 1.220403e-05], [1.238997e-05, 1.238997e-05, ..., 1.238997e-05, 1.238997e-05], ..., [6.334120e-05, 6.334120e-05, ..., 6.334120e-05, 6.334120e-05], [6.349303e-05, 6.349303e-05, ..., 6.349303e-05, 6.349303e-05]]], dtype=float32)
array([[[0.000145, 0.000145, ..., 0.000145, 0.000145], [0.000145, 0.000145, ..., 0.000145, 0.000145], ..., [0.000131, 0.000131, ..., 0.000131, 0.000131], [0.000131, 0.000131, ..., 0.000131, 0.000131]]], dtype=float32)
array([[[-0., -0., ..., -0., -0.], [-0., -0., ..., -0., -0.], ..., [-0., -0., ..., -0., -0.], [-0., -0., ..., -0., -0.]]], dtype=float32)
array([[[1., 1., ..., 1., 1.], [1., 1., ..., 1., 1.], ..., [1., 1., ..., 1., 1.], [1., 1., ..., 1., 1.]]], dtype=float32)
array([[[ 0. , 0. , ..., 185.95102, 180.0879 ], [ 0. , 0. , ..., 191.0567 , 185.3248 ], ..., [ 0. , 0. , ..., 0. , 0. ], [ 0. , 0. , ..., 0. , 0. ]]], dtype=float32)
array([[[299.3892 , 299.3892 , ..., 297.5208 , 297.46576], [299.4231 , 299.4231 , ..., 297.43387, 297.56238], ..., [298.25943, 298.30362, ..., 298.96954, 298.96994], [298.15982, 298.19687, ..., 298.95883, 298.9522 ]]], dtype=float32)
array([5000.], dtype=float32)
array([290.], dtype=float32)
array([100000.], dtype=float32)
array([50.], dtype=float32)
array([200.], dtype=float32)
array([-11.], dtype=float32)
array([0.], dtype=float32)
array([0.], dtype=float32)
array([0.], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0.000000e+00, 0.000000e+00, ..., 0.000000e+00, 0.000000e+00], [0.000000e+00, 9.501703e-01, ..., 3.190938e-22, 0.000000e+00], ..., [0.000000e+00, 1.729607e-08, ..., 1.155179e-21, 0.000000e+00], [0.000000e+00, 0.000000e+00, ..., 0.000000e+00, 0.000000e+00]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
[3129035 values with dtype=float32]
[3129035 values with dtype=float32]
array([[[ 0. , 0. , ..., 183.30222 , 184.57709 ], [ 0. , 0. , ..., 182.91713 , 184.06635 ], ..., [ 0. , 0. , ..., 29.533443, 30.323029], [ 0. , 0. , ..., 29.149107, 29.933285]]], dtype=float32)
array([[[362.66718, 362.64355, ..., 346.79016, 341.04095], [362.91562, 362.8241 , ..., 340.03824, 340.80887], ..., [340.94003, 341.2611 , ..., 337.8451 , 337.59894], [340.80023, 341.08987, ..., 337.5787 , 337.1707 ]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[ 7217007.5, 7217058.5, ..., 12144392. , 12545453. ], [ 7211036. , 7211255.5, ..., 12532815. , 12467073. ], ..., [ 5390324.5, 5388924.5, ..., 5361019.5, 5360668. ], [ 5381850. , 5380832.5, ..., 5353735. , 5353542.5]]], dtype=float32)
array([[[ 7217007.5, 7217058.5, ..., 12048992. , 12468773. ], [ 7211036. , 7211255.5, ..., 12460295. , 12459673. ], ..., [ 5390324.5, 5388924.5, ..., 5361019.5, 5360668. ], [ 5381850. , 5380832.5, ..., 5353735. , 5353542.5]]], dtype=float32)
array([[[66076992., 66074356., ..., 66091876., 66091784.], [66011628., 66009552., ..., 66027476., 66026296.], ..., [43985508., 43983656., ..., 43990324., 43989148.], [43907596., 43905360., ..., 43912160., 43911356.]]], dtype=float32)
array([[[66076992., 66074356., ..., 66091716., 66091624.], [66011628., 66009552., ..., 66027316., 66026136.], ..., [43985508., 43983656., ..., 43990324., 43989148.], [43907596., 43905360., ..., 43912160., 43911356.]]], dtype=float32)
array([[[3944219.5, 3944724.2, ..., 9488016. , 9966682. ], [3939450.2, 3939892.2, ..., 9961719. , 9974523. ], ..., [2599123.8, 2598316.8, ..., 2573117.5, 2573476.8], [2592958.5, 2592594. , ..., 2568361.8, 2568561.8]]], dtype=float32)
array([[[3944219.5, 3944724.2, ..., 9507216. , 9983082. ], [3939450.2, 3939892.2, ..., 9976999. , 9975403. ], ..., [2599123.8, 2598316.8, ..., 2573117.5, 2573476.8], [2592958.5, 2592594. , ..., 2568361.8, 2568561.8]]], dtype=float32)
array([[[49303088., 49309276., ..., 49792832., 49832652.], [49243280., 49248896., ..., 49808820., 49872636.], ..., [32489034., 32478874., ..., 32164194., 32168330.], [32411840., 32407748., ..., 32104764., 32107272.]]], dtype=float32)
array([[[49303088., 49309276., ..., 49893632., 49914572.], [49243280., 49248896., ..., 49885460., 49876796.], ..., [32489034., 32478874., ..., 32164194., 32168330.], [32411840., 32407748., ..., 32104764., 32107272.]]], dtype=float32)
array([[[50121044., 50142652., ..., 47216024., 46483316.], [50102092., 50116200., ..., 45795132., 45997164.], ..., [50373344., 50356936., ..., 49433596., 49459928.], [50327244., 50316740., ..., 49434200., 49429012.]]], dtype=float32)
array([[[50121044., 50142652., ..., 48111224., 47379476.], [50102092., 50116200., ..., 47299812., 47438524.], ..., [50373344., 50356936., ..., 49433596., 49459928.], [50327244., 50316740., ..., 49434200., 49429012.]]], dtype=float32)
array([[[1187701.4 , 1187762.9 , ..., 1182668.1 , 1182764.4 ], [1187235.5 , 1187105.1 , ..., 1181518.8 , 1181554.5 ], ..., [1005280.5 , 1005006.25, ..., 1125392.8 , 1126417.4 ], [1005866.6 , 1005330.4 , ..., 1126020.1 , 1126936.9 ]]], dtype=float32)
array([[[1187701.4 , 1187762.9 , ..., 1182668.1 , 1182764.4 ], [1187235.5 , 1187105.1 , ..., 1181518.8 , 1181554.5 ], ..., [1005280.5 , 1005006.25, ..., 1125392.8 , 1126417.4 ], [1005866.6 , 1005330.4 , ..., 1126020.1 , 1126936.9 ]]], dtype=float32)
array([[[77150488., 77150488., ..., 75263248., 71783128.], [77186168., 77186168., ..., 71652648., 72150128.], ..., [75990904., 76034712., ..., 76718704., 76718712.], [75891184., 75928808., ..., 76707824., 76704520.]]], dtype=float32)
array([[[77150488., 77150488., ..., 75263248., 71783128.], [77186168., 77186168., ..., 71652648., 72150128.], ..., [75990904., 76034712., ..., 76718704., 76718712.], [75891184., 75928808., ..., 76707824., 76704520.]]], dtype=float32)
array([[[62743632., 62735832., ..., 62984288., 61875172.], [62772080., 62765064., ..., 61811600., 61979060.], ..., [59918440., 59968616., ..., 59749968., 59735968.], [59878892., 59906480., ..., 59745224., 59727396.]]], dtype=float32)
array([[[62743632., 62735832., ..., 62822208., 61723812.], [62772080., 62765064., ..., 61594560., 61808900.], ..., [59918440., 59968616., ..., 59749968., 59735968.], [59878892., 59906480., ..., 59745224., 59727396.]]], dtype=float32)
array([[[ 0. , 0. , ..., 66.46287 , 68.41875 ], [ 0. , 0. , ..., 67.99657 , 68.284996], ..., [ 0. , 0. , ..., 18.022757, 18.329086], [ 0. , 0. , ..., 17.862549, 18.17061 ]]], dtype=float32)
array([[[ 0. , 0. , ..., 66.46287 , 68.41875 ], [ 0. , 0. , ..., 67.99657 , 68.284996], ..., [ 0. , 0. , ..., 18.022757, 18.329086], [ 0. , 0. , ..., 17.862549, 18.17061 ]]], dtype=float32)
array([[[ 0. , 0. , ..., 291.37402 , 292.95743 ], [ 0. , 0. , ..., 290.6369 , 292.21765 ], ..., [ 0. , 0. , ..., 66.01429 , 67.42382 ], [ 0. , 0. , ..., 65.276115, 66.68462 ]]], dtype=float32)
array([[[ 0. , 0. , ..., 291.37402 , 292.95743 ], [ 0. , 0. , ..., 290.6369 , 292.21765 ], ..., [ 0. , 0. , ..., 66.01429 , 67.42382 ], [ 0. , 0. , ..., 65.276115, 66.68462 ]]], dtype=float32)
array([[[ 0. , 0. , ..., 34.845306, 36.915417], [ 0. , 0. , ..., 36.583427, 36.81327 ], ..., [ 0. , 0. , ..., 2.362675, 2.425842], [ 0. , 0. , ..., 2.331928, 2.394663]]], dtype=float32)
array([[[ 0. , 0. , ..., 34.845306, 36.915417], [ 0. , 0. , ..., 36.583427, 36.81327 ], ..., [ 0. , 0. , ..., 2.362675, 2.425842], [ 0. , 0. , ..., 2.331928, 2.394663]]], dtype=float32)
array([[[ 0. , 0. , ..., 183.30222 , 184.57709 ], [ 0. , 0. , ..., 182.91714 , 184.06635 ], ..., [ 0. , 0. , ..., 29.533443, 30.323029], [ 0. , 0. , ..., 29.149107, 29.933285]]], dtype=float32)
array([[[ 0. , 0. , ..., 183.30222 , 184.57709 ], [ 0. , 0. , ..., 182.91714 , 184.06635 ], ..., [ 0. , 0. , ..., 29.533443, 30.323029], [ 0. , 0. , ..., 29.149107, 29.933285]]], dtype=float32)
array([[[292.45453, 292.48737, ..., 265.74277, 262.24002], [292.26907, 292.46277, ..., 261.52347, 262.09192], ..., [293.1109 , 293.0706 , ..., 285.06668, 285.21515], [292.87668, 292.9346 , ..., 285.01004, 284.9938 ]]], dtype=float32)
array([[[292.45453, 292.48737, ..., 265.74277, 262.24002], [292.26907, 292.46277, ..., 261.52347, 262.09192], ..., [293.1109 , 293.0706 , ..., 285.06668, 285.21515], [292.87668, 292.9346 , ..., 285.01004, 284.9938 ]]], dtype=float32)
array([[[7.016671, 7.013094, ..., 7.070263, 7.068059], [6.998888, 6.998976, ..., 7.050173, 7.059423], ..., [5.683836, 5.686971, ..., 6.468979, 6.474614], [5.689606, 5.690662, ..., 6.477479, 6.481445]]], dtype=float32)
array([[[7.016671, 7.013094, ..., 7.070263, 7.068059], [6.998888, 6.998976, ..., 7.050173, 7.059423], ..., [5.683836, 5.686971, ..., 6.468979, 6.474614], [5.689606, 5.690662, ..., 6.477479, 6.481445]]], dtype=float32)
array([[[446.47046, 446.47046, ..., 395.682 , 377.46185], [446.67267, 446.67267, ..., 376.19012, 377.4312 ], ..., [439.76935, 440.03 , ..., 443.97244, 443.97476], [439.1822 , 439.4005 , ..., 443.9088 , 443.86948]]], dtype=float32)
array([[[446.47046, 446.47046, ..., 395.682 , 377.46185], [446.67267, 446.67267, ..., 376.19012, 377.4312 ], ..., [439.76935, 440.03 , ..., 443.97244, 443.97476], [439.1822 , 439.4005 , ..., 443.9088 , 443.86948]]], dtype=float32)
array([[[362.66718, 362.64355, ..., 346.79016, 341.04095], [362.91562, 362.8241 , ..., 340.03824, 340.80887], ..., [340.94003, 341.2611 , ..., 337.8451 , 337.59894], [340.80023, 341.08987, ..., 337.5787 , 337.1707 ]]], dtype=float32)
array([[[362.66718, 362.64355, ..., 346.79016, 341.04095], [362.91562, 362.8241 , ..., 340.03824, 340.80887], ..., [340.94003, 341.2611 , ..., 337.8451 , 337.59894], [340.80023, 341.08987, ..., 337.5787 , 337.1707 ]]], dtype=float32)
array([[[292.45453, 292.48737, ..., 265.74277, 262.24002], [292.26907, 292.46277, ..., 261.52347, 262.09192], ..., [293.1109 , 293.0706 , ..., 285.06668, 285.21515], [292.87668, 292.9346 , ..., 285.01004, 284.9938 ]]], dtype=float32)
array([[[0.08 , 0.08 , ..., 0.190098, 0.2 ], [0.08 , 0.08 , ..., 0.2 , 0.2 ], ..., [0.08 , 0.08 , ..., 0.08 , 0.08 ], [0.08 , 0.08 , ..., 0.08 , 0.08 ]]], dtype=float32)
array([[[ 4.800179, 4.800179, ..., 4.800179, 4.800179], [ 4.873489, 4.873489, ..., 4.873489, 4.873489], ..., [25.74202 , 25.74202 , ..., 25.74202 , 25.74202 ], [25.808258, 25.808258, ..., 25.808258, 25.808258]]], dtype=float32)
array([[[0.08 , 0.08 , ..., 0.190098, 0.2 ], [0.08 , 0.08 , ..., 0.2 , 0.2 ], ..., [0.08 , 0.08 , ..., 0.08 , 0.08 ], [0.08 , 0.08 , ..., 0.08 , 0.08 ]]], dtype=float32)
array([[[0.98 , 0.98 , ..., 0.959902, 0.92 ], [0.98 , 0.98 , ..., 0.92 , 0.92 ], ..., [0.98 , 0.98 , ..., 0.98 , 0.98 ], [0.98 , 0.98 , ..., 0.98 , 0.98 ]]], dtype=float32)
array([[[ 0. , 0. , ..., -0.051727, -0.039978], [ 0. , 0. , ..., -0.046112, -0.045929], ..., [ 0. , 0. , ..., 0. , 0. ], [ 0. , 0. , ..., 0. , 0. ]]], dtype=float32)
array([[[299.3892 , 299.3892 , ..., 296.71146, 296.70923], [299.4231 , 299.4231 , ..., 296.7309 , 296.72632], ..., [298.25943, 298.30362, ..., 298.96954, 298.96994], [298.15982, 298.19687, ..., 298.95883, 298.9522 ]]], dtype=float32)
array([[[2., 2., ..., 1., 1.], [2., 2., ..., 1., 1.], ..., [2., 2., ..., 2., 2.], [2., 2., ..., 2., 2.]]], dtype=float32)
array([[[0.202174, 0.202758, ..., 0.13392 , 0.157304], [0.196179, 0.197316, ..., 0.122972, 0.14394 ], ..., [0.15973 , 0.162826, ..., 0.311798, 0.317164], [0.157992, 0.160574, ..., 0.31292 , 0.316956]]], dtype=float32)
array([[[ 563.377 , 562.41876 , ..., 51.89437 , 42.056686], [ 561.9659 , 557.2253 , ..., 52.00413 , 52.151077], ..., [ 744.9678 , 744.9524 , ..., 1242.1875 , 1260.0055 ], [ 744.64777 , 754.4418 , ..., 1265.9895 , 1261.4706 ]]], dtype=float32)
array([[[11.725573, 11.681781, ..., -0.180089, -1.295225], [11.677514, 11.938801, ..., -0.457013, -0.548771], ..., [ 3.333637, 3.418433, ..., 39.965515, 40.310646], [ 2.784894, 2.782662, ..., 38.96318 , 40.44466 ]]], dtype=float32)
array([[[4.978220e-05, 4.980257e-05, ..., 1.084459e-05, 1.186203e-05], [4.852586e-05, 4.935573e-05, ..., 1.054475e-05, 1.104411e-05], ..., [4.307499e-05, 4.577442e-05, ..., 1.304261e-04, 1.298008e-04], [4.092383e-05, 4.220267e-05, ..., 1.289966e-04, 1.301788e-04]]], dtype=float32)
array([[[124.4555 , 124.50643 , ..., 27.122313, 29.666933], [121.314644, 123.38932 , ..., 26.372417, 27.62132 ], ..., [107.68746 , 114.43605 , ..., 326.06516 , 324.5021 ], [102.30957 , 105.50667 , ..., 322.49146 , 325.4471 ]]], dtype=float32)
array([[[1903641.2 , 1882738.8 , ..., 8044753.5 , 8492256. ], [1925675.2 , 1942835.8 , ..., 8217401. , 9426658. ], ..., [ 138872.14 , 131181.5 , ..., 3735779. , 3666851.8 ], [ 51234.227, 66014.17 , ..., 3655444.5 , 3692418. ]]], dtype=float32)
array([[[20257102., 20243146., ..., 17957200., 17222804.], [19940790., 20242088., ..., 17583280., 15974257.], ..., [18092304., 19733948., ..., 39481244., 38984980.], [17246914., 17776736., ..., 38951780., 39155476.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([0], dtype=int32)
array([[[5.460828, 5.416134, ..., 1.364826, 1.638359], [5.402601, 5.389735, ..., 1.219812, 1.42378 ], ..., [5.650729, 5.788425, ..., 7.738371, 7.870625], [5.577072, 5.673795, ..., 7.777915, 7.863365]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[0, 0, 0, 0, 0, 0, 0, 0]], dtype=int32)
array([[0, 0, 0, 0, 0, 0, 0, 0]], dtype=int32)
array([[0, 0, 0, 0, 0, 0, 0, 0]], dtype=int32)
array([[0, 0, 0, 0, 0, 0, 0, 0]], dtype=int32)
array([[0, 0, 0, 0, 0, 0, 0, 0]], dtype=int32)
array([[0, 0, 0, 0, 0, 0, 0, 0]], dtype=int32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[8.581409e-20, 8.581727e-20, ..., 4.633608e-31, 4.638020e-31], [8.581539e-20, 2.998218e-41, ..., 1.160457e-40, 2.645932e-41], ..., [1.962064e-23, 2.183083e-41, ..., 3.291370e-41, 2.731271e-41], [1.962062e-23, 1.962100e-23, ..., 0.000000e+00, 0.000000e+00]]], dtype=float32)
array([[[4.033517e-21, 4.033666e-21, ..., 0.000000e+00, 0.000000e+00], [4.033578e-21, 0.000000e+00, ..., 0.000000e+00, 0.000000e+00], ..., [7.748629e-25, 0.000000e+00, ..., 0.000000e+00, 0.000000e+00], [7.748140e-25, 7.748334e-25, ..., 0.000000e+00, 0.000000e+00]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[101243.414, 101245.234, ..., 101218.39 , 101215.67 ], [101245.77 , 101244.52 , ..., 101223.42 , 101216.31 ], ..., [101595.75 , 101607.5 , ..., 101837.734, 101824.08 ], [101597.93 , 101598.95 , ..., 101825.61 , 101825.305]]], dtype=float32)
array([[[298.95444, 298.96735, ..., 298.10013, 298.24646], [298.96683, 298.9314 , ..., 298.00345, 298.27676], ..., [298.64218, 298.7251 , ..., 297.50156, 297.44064], [298.58002, 298.64944, ..., 297.5121 , 297.43945]]], dtype=float32)
array([[[299.45602, 299.4641 , ..., 299.2636 , 299.28085], [299.47928, 299.4499 , ..., 299.26636, 299.34503], ..., [299.14807, 299.19138, ..., 296.57242, 296.5798 ], [299.10995, 299.15582, ..., 296.65945, 296.54327]]], dtype=float32)
array([[[305.9623 , 305.97177, ..., 304.9247 , 304.8979 ], [305.99823, 305.9502 , ..., 304.93768, 304.88782], ..., [304.8276 , 304.7415 , ..., 301.81195, 301.92432], [304.86224, 304.8607 , ..., 301.9266 , 301.873 ]]], dtype=float32)
array([[ 1500., 3000., 4600., 6100., 7600., 9100., 10700.]], dtype=float32)
array([[ 3000., 4600., 6100., 7600., 9100., 10700., 12700.]], dtype=float32)
[625807 values with dtype=float32]
array([[[0.308796, 0.312516, ..., 0.307951, 0.286893], [0.29333 , 0.296337, ..., 0.356915, 0.292175], ..., [0.349014, 0.355721, ..., 0.647486, 0.657034], [0.343044, 0.349801, ..., 0.654711, 0.659566]]], dtype=float32)
array([[[3.626893e-02, 7.342469e-02, ..., 2.963172e-02, 0.000000e+00], [0.000000e+00, 0.000000e+00, ..., 1.518414e+00, 0.000000e+00], ..., [1.126104e+00, 1.455398e+00, ..., 5.659980e+01, 5.975307e+01], [8.684878e-01, 1.162565e+00, ..., 5.897820e+01, 6.060371e+01]]], dtype=float32)
array([[[0.000000e+00, 0.000000e+00, ..., 0.000000e+00, 0.000000e+00], [0.000000e+00, 0.000000e+00, ..., 1.180571e-02, 0.000000e+00], ..., [0.000000e+00, 8.081900e-03, ..., 2.185123e+01, 2.327645e+01], [0.000000e+00, 0.000000e+00, ..., 2.292564e+01, 2.366199e+01]]], dtype=float32)
array([[[0. , 0. , ..., 0. , 0. ], [0. , 0. , ..., 0. , 0. ], ..., [0. , 0. , ..., 6.124911, 6.606644], [0. , 0. , ..., 6.487788, 6.737465]]], dtype=float32)
array([[[0.000000e+00, 0.000000e+00, ..., 0.000000e+00, 0.000000e+00], [0.000000e+00, 9.501703e-01, ..., 3.190938e-22, 0.000000e+00], ..., [0.000000e+00, 1.729607e-08, ..., 1.155179e-21, 0.000000e+00], [0.000000e+00, 0.000000e+00, ..., 0.000000e+00, 0.000000e+00]]], dtype=float32)
array([[[0.000000e+00, 0.000000e+00, ..., 0.000000e+00, 0.000000e+00], [0.000000e+00, 9.501703e-01, ..., 3.190938e-22, 0.000000e+00], ..., [0.000000e+00, 1.729607e-08, ..., 1.155179e-21, 0.000000e+00], [0.000000e+00, 0.000000e+00, ..., 0.000000e+00, 0.000000e+00]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[33461.22 , 33446.32 , ..., 38296.152, 39791.383], [33112.965, 33429.152, ..., 37386.258, 40149.41 ], ..., [44321.332, 46127.484, ..., 58765.01 , 57348.543], [43340.8 , 44011.598, ..., 58196.812, 57642.047]]], dtype=float32)
array([[[3.6, 3.6, ..., 3.6, 3.6], [3.6, 3.6, ..., 3.6, 3.6], ..., [3.6, 3.6, ..., 3.6, 3.6], [3.6, 3.6, ..., 3.6, 3.6]]], dtype=float32)
array([[[999999., 999999., ..., 999999., 999999.], [999999., 999999., ..., 999999., 999999.], ..., [999999., 999999., ..., 999999., 999999.], [999999., 999999., ..., 999999., 999999.]]], dtype=float32)
array([[[3.326234, 3.393013, ..., 1.286365, 1.27565 ], [3.68994 , 3.597721, ..., 1.247351, 1.329966], ..., [0.132372, 0.121842, ..., 0.586754, 0.664573], [0.097926, 0.122287, ..., 0.480249, 0.566806]]], dtype=float32)
array([[[ 581.35486, 583.06616, ..., 2182.0635 , 2185.338 ], [ 563.8473 , 563.1555 , ..., 2189.63 , 2176.168 ], ..., [ 717.28534, 717.40765, ..., 1203.5352 , 1202.9573 ], [ 717.27075, 717.2913 , ..., 1203.1272 , 1202.7764 ]]], dtype=float32)
array([[[32.293396, 32.98213 , ..., 0.652522, 0. ], [36.51464 , 30.191654, ..., 1.59177 , 0. ], ..., [12.140907, 3.083272, ..., 24.721724, 32.268867], [21.470993, 17.22909 , ..., 31.883247, 31.947803]]], dtype=float32)
array([[[-109.89362 , -104.578415, ..., -364.8949 , -414.9905 ], [ -93.38582 , -116.674614, ..., -352.26514 , -403.22174 ], ..., [ -34.956276, -75.85766 , ..., -861.83453 , -826.52545 ], [ -16.069706, -20.484608, ..., -827.7048 , -836.9082 ]]], dtype=float32)
array([[[32.293396, 32.98213 , ..., 0.652522, 0. ], [36.51464 , 30.191654, ..., 1.59177 , 0. ], ..., [12.140907, 3.083272, ..., 24.721724, 32.268867], [21.470993, 17.22909 , ..., 31.883247, 31.947803]]], dtype=float32)
array([[[-109.89362 , -104.578415, ..., -364.8949 , -414.9905 ], [ -93.38582 , -116.674614, ..., -352.26514 , -403.22174 ], ..., [ -34.956276, -75.85766 , ..., -861.83453 , -826.52545 ], [ -16.069706, -20.484608, ..., -827.7048 , -836.9082 ]]], dtype=float32)
array([[[ 7.638333e+03, 7.638166e+03, ..., -1.000000e+00, -1.000000e+00], [ 7.638262e+03, 7.639522e+03, ..., -1.000000e+00, -1.000000e+00], ..., [-1.000000e+00, -1.000000e+00, ..., -1.000000e+00, -1.000000e+00], [ 7.172708e+02, 7.172913e+02, ..., -1.000000e+00, -1.000000e+00]]], dtype=float32)
array([[[ 3.951014e+04, 3.951027e+04, ..., -1.000000e+00, -1.000000e+00], [ 3.951007e+04, 3.950548e+04, ..., -1.000000e+00, -1.000000e+00], ..., [-1.000000e+00, -1.000000e+00, ..., -1.000000e+00, -1.000000e+00], [ 9.354270e+04, 9.354398e+04, ..., -1.000000e+00, -1.000000e+00]]], dtype=float32)
array([[[273.4044 , 273.38513, ..., 274.43433, 274.62476], [273.34094, 273.442 , ..., 274.40836, 274.60745], ..., [273.43954, 273.61325, ..., 278.3789 , 278.21692], [273.29208, 273.3516 , ..., 278.24777, 278.2732 ]]], dtype=float32)
array([[[46.06222 , 46.14917 , ..., 47.918888, 48.01409 ], [46.417 , 45.791367, ..., 47.3344 , 47.93905 ], ..., [24.338974, 23.875444, ..., 26.438044, 26.494987], [24.25505 , 24.018375, ..., 26.387897, 26.266968]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0.21552 , 0.247073, ..., 7.367497, 7.421971], [0.18634 , 0.194672, ..., 7.405136, 7.485563], ..., [1.098993, 1.048559, ..., 1.045263, 1.020513], [1.329285, 1.316277, ..., 1.023991, 1.029704]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[ 1.013472, 1.043528, 1.080603, 1.125662, 1.179395, 1.24187 , 1.31227 , 1.38844 , 1.466623, 1.541485, 1.606277, 1.653847, 1.677582, 1.672593, 1.635715, 1.56474 , 1.458317, 1.316202, 1.139408, 0.930384, 0.693045, 0.440489, 0.191214, 0.010293, -0. , -0. , -0. , -0. , -0. , -0. , -0. , -0. , -0. , -0. , -0. ]], dtype=float32)
array([[ -1279.825 , -4135.1904, -7657.3306, -11937.898 , -17042.51 , -22977.688 , -29665.643 , -36901.758 , -44329.168 , -51441.035 , -57596.348 , -62115.44 , -64370.27 , -63896.324 , -60392.88 , -53650.316 , -43540.074 , -30039.184 , -13243.759 , 6613.499 , 29160.768 , 53153.523 , 76834.664 , 94022.15 , 95000. , 95000. , 95000. , 95000. , 95000. , 95000. , 95000. , 95000. , 95000. , 95000. , 95000. ]], dtype=float32)
array([[ 1. , 1.0303 , 1.064217, 1.105677, 1.155418, 1.213812, 1.2804 , 1.353632, 1.430502, 1.506478, 1.57558 , 1.631 , 1.666027, 1.675047, 1.653919, 1.599899, 1.511238, 1.387174, 1.228107, 1.035788, 0.813392, 0.572998, 0.324186, 0.106803, 0.005491, -0. , -0. , -0. , -0. , -0. , -0. , -0. , -0. , -0. , -0. , 0. ]], dtype=float32)
array([[ 0. , -2878.5247, -6100.6123, -10039.315 , -14764.714 , -20312.129 , -26637.992 , -33595.016 , -40897.65 , -48115.43 , -54680.1 , -59944.957 , -63272.56 , -64129.48 , -62122.348 , -56990.41 , -48567.586 , -36781.496 , -21670.174 , -3399.8203, 17727.79 , 40565.168 , 64202.32 , 84853.73 , 94478.38 , 95000. , 95000. , 95000. , 95000. , 95000. , 95000. , 95000. , 95000. , 95000. , 95000. , 95000. ]], dtype=float32)
array([[9.968657e-01, 9.896282e-01, 9.801564e-01, 9.677767e-01, 9.516463e-01, 9.307482e-01, 9.039227e-01, 8.699591e-01, 8.277712e-01, 7.766529e-01, 7.165769e-01, 6.484400e-01, 5.741405e-01, 4.962325e-01, 4.170720e-01, 3.387942e-01, 2.637607e-01, 1.944285e-01, 1.331814e-01, 8.213749e-02, 4.294907e-02, 1.701273e-02, 3.937146e-03, 1.694172e-04, 0.000000e+00, 0.000000e+00, 0.000000e+00, 0.000000e+00, 0.000000e+00, 0.000000e+00, 0.000000e+00, 0.000000e+00, 0.000000e+00, 0.000000e+00, 0.000000e+00]], dtype=float32)
array([[3.958046e+00, 2.417862e+01, 7.847578e+01, 1.908809e+02, 3.970051e+02, 7.467175e+02, 1.304808e+03, 2.147730e+03, 3.353870e+03, 4.986538e+03, 7.071460e+03, 9.575731e+03, 1.239748e+04, 1.538021e+04, 1.835353e+04, 2.114188e+04, 2.355328e+04, 2.539165e+04, 2.647237e+04, 2.663991e+04, 2.578581e+04, 2.394965e+04, 2.136015e+04, 1.836673e+04, 1.545159e+04, 1.288781e+04, 1.064542e+04, 8.684137e+03, 6.968715e+03, 5.468335e+03, 4.156043e+03, 3.008255e+03, 2.004353e+03, 1.126299e+03, 3.583152e+02]], dtype=float32)
array([[1.000000e+00, 9.937314e-01, 9.855250e-01, 9.747877e-01, 9.607657e-01, 9.425270e-01, 9.189695e-01, 8.888758e-01, 8.510424e-01, 8.045000e-01, 7.488058e-01, 6.843480e-01, 6.125320e-01, 5.357490e-01, 4.567161e-01, 3.774279e-01, 3.001604e-01, 2.273611e-01, 1.614959e-01, 1.048668e-01, 5.940812e-02, 2.649001e-02, 7.535458e-03, 3.388345e-04, 0.000000e+00, 0.000000e+00, 0.000000e+00, 0.000000e+00, 0.000000e+00, 0.000000e+00, 0.000000e+00, 0.000000e+00, 0.000000e+00, 0.000000e+00, 0.000000e+00, 0.000000e+00]], dtype=float32)
array([[0.000000e+00, 7.916093e+00, 4.043549e+01, 1.165217e+02, 2.652288e+02, 5.287814e+02, 9.646535e+02, 1.644962e+03, 2.650492e+03, 4.057252e+03, 5.915830e+03, 8.227097e+03, 1.092437e+04, 1.387060e+04, 1.688982e+04, 1.981725e+04, 2.246652e+04, 2.464004e+04, 2.614326e+04, 2.680148e+04, 2.647835e+04, 2.509327e+04, 2.280604e+04, 1.991425e+04, 1.681920e+04, 1.408398e+04, 1.169164e+04, 9.599204e+03, 7.769070e+03, 6.168359e+03, 4.768312e+03, 3.543773e+03, 2.472738e+03, 1.535968e+03, 7.166304e+02, 0.000000e+00]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 1., 1.], [0., 0., ..., 1., 1.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
array([[[299.3892 , 299.3892 , ..., 296.37283, 296.46005], [299.4231 , 299.4231 , ..., 296.45123, 296.48935], ..., [298.25943, 298.30362, ..., 298.96954, 298.96994], [298.15982, 298.19687, ..., 298.95883, 298.9522 ]]], dtype=float32)
array([[[0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.], ..., [0., 0., ..., 0., 0.], [0., 0., ..., 0., 0.]]], dtype=float32)
Select 'T2' variable and convert from K to C.
da = ds.T2.sel(Time=0) -273.15
We pre-process the data to match CF conventions.
da_with_latlon = da.assign_coords(lat=da.coords['XLAT'], lon=da.coords['XLONG'])
da_with_latlon_rename = da_with_latlon.rename({'south_north':'y', 'west_east':'x'})
da_with_latlon_drop = da_with_latlon_rename.drop(['XLAT', 'XLONG', 'XTIME'])
da_wrf_cf = da_with_latlon_drop
da_wrf_cf
<xarray.DataArray 'T2' (y: 299, x: 299)> array([[24.988586, 24.995941, 24.98938 , ..., 24.238098, 24.39441 , 24.465973], [24.998016, 24.975922, 24.946411, ..., 24.205078, 24.348206, 24.480438], [24.987885, 24.968018, 24.917847, ..., 24.132355, 24.332092, 24.46167 ], ..., [24.696686, 24.733307, 24.769958, ..., 22.910309, 22.873535, 22.919525], [24.678864, 24.719208, 24.76773 , ..., 22.932556, 22.871765, 22.88565 ], [24.64627 , 24.688324, 24.740234, ..., 23.005432, 22.941345, 22.857056]], dtype=float32) Coordinates: lat (y, x) float32 4.8 4.8 4.8 4.8 4.8 ... 25.81 25.81 25.81 25.81 lon (y, x) float32 -94.28 -94.21 -94.14 -94.06 ... -72.51 -72.43 -72.36 Dimensions without coordinates: y, x
array([[24.988586, 24.995941, 24.98938 , ..., 24.238098, 24.39441 , 24.465973], [24.998016, 24.975922, 24.946411, ..., 24.205078, 24.348206, 24.480438], [24.987885, 24.968018, 24.917847, ..., 24.132355, 24.332092, 24.46167 ], ..., [24.696686, 24.733307, 24.769958, ..., 22.910309, 22.873535, 22.919525], [24.678864, 24.719208, 24.76773 , ..., 22.932556, 22.871765, 22.88565 ], [24.64627 , 24.688324, 24.740234, ..., 23.005432, 22.941345, 22.857056]], dtype=float32)
array([[ 4.800179, 4.800179, 4.800179, ..., 4.800179, 4.800179, 4.800179], [ 4.873489, 4.873489, 4.873489, ..., 4.873489, 4.873489, 4.873489], [ 4.946777, 4.946777, 4.946777, ..., 4.946777, 4.946777, 4.946777], ..., [25.675735, 25.675735, 25.675735, ..., 25.675735, 25.675735, 25.675735], [25.74202 , 25.74202 , 25.74202 , ..., 25.74202 , 25.74202 , 25.74202 ], [25.808258, 25.808258, 25.808258, ..., 25.808258, 25.808258, 25.808258]], dtype=float32)
array([[-94.28289 , -94.20933 , -94.135765, ..., -72.50778 , -72.43421 , -72.36065 ], [-94.28289 , -94.20933 , -94.135765, ..., -72.50778 , -72.43421 , -72.36065 ], [-94.28289 , -94.20933 , -94.135765, ..., -72.50778 , -72.43421 , -72.36065 ], ..., [-94.28289 , -94.20933 , -94.135765, ..., -72.50778 , -72.43421 , -72.36065 ], [-94.28289 , -94.20933 , -94.135765, ..., -72.50778 , -72.43421 , -72.36065 ], [-94.28289 , -94.20933 , -94.135765, ..., -72.50778 , -72.43421 , -72.36065 ]], dtype=float32)
da_wrf_cf.plot(x='lon', y='lat')
<matplotlib.collections.QuadMesh at 0x175cba800>
To convert the data into a geoereferenced raster, we need to assign it a projection and a transform
WRF datasets store the projection in a dataset attribute named MAP_PROJ. The value is a numeric value that is associated with a different projection.
LAMBERT_CONFORMAL = 1
POLAR_STEREOGRAPHIC = 2
MERCATOR = 3
LAT_LON = 6
ds.attrs['MAP_PROJ']
3
This dataset's projection is Mercator, so we extract the parameters required to construct the projection string. The CRS definitions come from here.
truelat1 = ds.attrs['TRUELAT1']
origin_lon = ds.attrs['STAND_LON']
proj_str = ('+proj=merc +lat_ts={lat1} +lon_0={lon0} +x_0=0 +y_0=0 +datum=WGS84').format(
lat1=truelat1, lon0=origin_lon)
proj_str
'+proj=merc +lat_ts=12.0 +lon_0=9.0 +x_0=0 +y_0=0 +datum=WGS84'
We have to now compute a transform.
lons_u = ds.XLONG
lons_v = ds.XLONG
lats_u = ds.XLAT
lats_v = ds.XLAT
dim_x = ds.west_east.size
dim_y = ds.south_north.size
lower_left_u = float(lons_u[0,0,0]), float(lats_u[0,0,0])
lower_right_u = float(lons_u[0,0,-1]), float(lats_u[0,0,-1])
lower_left_v = float(lons_v[0,0,0]), float(lats_v[0,0,0])
upper_left_v = float(lons_v[0,-1,0]), float(lats_v[0,-1,0])
def transform_point(point):
point_geom = ogr.Geometry(ogr.wkbPoint)
point_geom.AddPoint(point[0], point[1])
srs_in = osr.SpatialReference()
srs_in.ImportFromProj4('+proj=latlong +datum=WGS84')
srs_out = osr.SpatialReference()
srs_out.ImportFromProj4(proj_str)
transform = osr.CoordinateTransformation(srs_in, srs_out)
point_geom.Transform(transform)
return point_geom.GetX(), point_geom.GetY()
lower_left_u_xy = transform_point(lower_left_u)
lower_right_u_xy = transform_point(lower_right_u)
lower_left_v_xy = transform_point(lower_left_v)
upper_left_v_xy = transform_point(upper_left_v)
dx = (lower_right_u_xy[0] - lower_left_u_xy[0])/dim_x
dy = (upper_left_v_xy[1] - lower_left_v_xy[1])/dim_y
dx, dy
gdal_transform = (lower_left_u_xy[0], dx, 0, lower_left_v_xy[1], 0, dy)
transform = Affine.from_gdal(*gdal_transform)
transform
Affine(7984.582560670005, 0.0, -11247780.567759313, 0.0, 7935.42637387715, 519869.30354344024)
Apply the transform and CRS.
da_wrf_cf.rio.write_crs(rasterio.crs.CRS().from_proj4(proj_str), inplace=True)
da_wrf_cf.rio.write_transform(transform, inplace=True)
<xarray.DataArray 'T2' (y: 299, x: 299)> array([[24.988586, 24.995941, 24.98938 , ..., 24.238098, 24.39441 , 24.465973], [24.998016, 24.975922, 24.946411, ..., 24.205078, 24.348206, 24.480438], [24.987885, 24.968018, 24.917847, ..., 24.132355, 24.332092, 24.46167 ], ..., [24.696686, 24.733307, 24.769958, ..., 22.910309, 22.873535, 22.919525], [24.678864, 24.719208, 24.76773 , ..., 22.932556, 22.871765, 22.88565 ], [24.64627 , 24.688324, 24.740234, ..., 23.005432, 22.941345, 22.857056]], dtype=float32) Coordinates: lat (y, x) float32 4.8 4.8 4.8 4.8 4.8 ... 25.81 25.81 25.81 25.81 lon (y, x) float32 -94.28 -94.21 -94.14 ... -72.51 -72.43 -72.36 spatial_ref int64 0 Dimensions without coordinates: y, x
array([[24.988586, 24.995941, 24.98938 , ..., 24.238098, 24.39441 , 24.465973], [24.998016, 24.975922, 24.946411, ..., 24.205078, 24.348206, 24.480438], [24.987885, 24.968018, 24.917847, ..., 24.132355, 24.332092, 24.46167 ], ..., [24.696686, 24.733307, 24.769958, ..., 22.910309, 22.873535, 22.919525], [24.678864, 24.719208, 24.76773 , ..., 22.932556, 22.871765, 22.88565 ], [24.64627 , 24.688324, 24.740234, ..., 23.005432, 22.941345, 22.857056]], dtype=float32)
array([[ 4.800179, 4.800179, 4.800179, ..., 4.800179, 4.800179, 4.800179], [ 4.873489, 4.873489, 4.873489, ..., 4.873489, 4.873489, 4.873489], [ 4.946777, 4.946777, 4.946777, ..., 4.946777, 4.946777, 4.946777], ..., [25.675735, 25.675735, 25.675735, ..., 25.675735, 25.675735, 25.675735], [25.74202 , 25.74202 , 25.74202 , ..., 25.74202 , 25.74202 , 25.74202 ], [25.808258, 25.808258, 25.808258, ..., 25.808258, 25.808258, 25.808258]], dtype=float32)
array([[-94.28289 , -94.20933 , -94.135765, ..., -72.50778 , -72.43421 , -72.36065 ], [-94.28289 , -94.20933 , -94.135765, ..., -72.50778 , -72.43421 , -72.36065 ], [-94.28289 , -94.20933 , -94.135765, ..., -72.50778 , -72.43421 , -72.36065 ], ..., [-94.28289 , -94.20933 , -94.135765, ..., -72.50778 , -72.43421 , -72.36065 ], [-94.28289 , -94.20933 , -94.135765, ..., -72.50778 , -72.43421 , -72.36065 ], [-94.28289 , -94.20933 , -94.135765, ..., -72.50778 , -72.43421 , -72.36065 ]], dtype=float32)
array(0)
We now have a array with correct CRS and transform. We drop existing coordinates and reproject it to EPSG:4326
da_wrf_cf_reprojected = da_wrf_cf.drop(['lat', 'lon']).rio.reproject('epsg:4326')
da_wrf_cf_reprojected
<xarray.DataArray 'T2' (y: 293, x: 305)> array([[24.64627 , 24.688324, 24.740234, ..., 23.005432, 22.941345, 22.857056], [24.678864, 24.719208, 24.76773 , ..., 22.932556, 22.871765, 22.88565 ], [24.696686, 24.733307, 24.769958, ..., 22.910309, 22.873535, 22.919525], ..., [24.987885, 24.968018, 24.917847, ..., 24.132355, 24.332092, 24.46167 ], [24.998016, 24.975922, 24.946411, ..., 24.205078, 24.348206, 24.480438], [24.988586, 24.995941, 24.98938 , ..., 24.238098, 24.39441 , 24.465973]], dtype=float32) Coordinates: spatial_ref int64 0 Dimensions without coordinates: y, x Attributes: _FillValue: 3.402823466e+38
array([[24.64627 , 24.688324, 24.740234, ..., 23.005432, 22.941345, 22.857056], [24.678864, 24.719208, 24.76773 , ..., 22.932556, 22.871765, 22.88565 ], [24.696686, 24.733307, 24.769958, ..., 22.910309, 22.873535, 22.919525], ..., [24.987885, 24.968018, 24.917847, ..., 24.132355, 24.332092, 24.46167 ], [24.998016, 24.975922, 24.946411, ..., 24.205078, 24.348206, 24.480438], [24.988586, 24.995941, 24.98938 , ..., 24.238098, 24.39441 , 24.465973]], dtype=float32)
array(0)
output_file_name = file_name.replace('.nc', '.tif')
output_file_path = os.path.join('data', output_file_name)
da_wrf_cf_reprojected.rio.to_raster(output_file_path)
/Users/ujavalgandhi/opt/anaconda3/envs/python_dataviz/lib/python3.10/site-packages/rioxarray/raster_writer.py:110: UserWarning: The nodata value (3.402823466e+38) has been automatically changed to (3.4028234663852886e+38) to match the dtype of the data. warnings.warn(