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
1222609313,I_kwDOAMm_X85I34mh,6560,"netCDF + lazy backend: Error when sel is used with slice, reverse arrange",90036937,closed,0,,,12,2022-05-02T08:13:04Z,2023-03-27T21:05:53Z,2023-03-27T21:05:53Z,NONE,,,,"### What happened?
```
import xarray as xr
data = xr.open_dataset('data_example.nc')
# wrong
a = data.sel(time='1979-1',isobaricInhPa=200).z[:, ::10,::10][:, ::-1,:]
```
It seem that when use sel() , [: , ::-1 , :] and [: , ::10 , ::10] at the same time will cause the second coord will wrong like this.
Why just when use sel and[: , ::10 , ::10][: , ::-1 , :] ,it will goes wrong in axis=2( the data DO NOT correspond to the coordinates) ?
### What did you expect to happen?
The data correspond to the coordinates on Latitude.
### Minimal Complete Verifiable Example
[problem_example.zip](https://github.com/pydata/xarray/files/8618429/problem_example.zip)
### MVCE confirmation
- [X] Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
- [x] Complete example — the example is self-contained, including all data and the text of any traceback.
- [X] Verifiable example — the example copy & pastes into an IPython prompt or [Binder notebook](https://mybinder.org/v2/gh/pydata/xarray/main?urlpath=lab/tree/doc/examples/blank_template.ipynb), returning the result.
- [x] New issue — a search of GitHub Issues suggests this is not a duplicate.
### Relevant log output
_No response_
### Anything else we need to know?
_No response_
### Environment
INSTALLED VERSIONS
------------------
commit: None
python: 3.8.12 (default, Oct 12 2021, 03:01:40) [MSC v.1916 64 bit (AMD64)]
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: AMD64 Family 25 Mod
el 33 Stepping 0, AuthenticAMD
byteorder: little
LC_ALL: None
LANG: en
LOCALE: ('Chinese (Simplified)_China', '936')
libhdf5: 1.12.1
libnetcdf: 4.8.1
xarray: 2022.3.0
pandas: 1.4.2
numpy: 1.22.3
scipy: 1.7.3
netCDF4: 1.5.7
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: None
cftime: 1.6.0
nc_time_axis: None
PseudoNetCDF: None
rasterio: 1.2.10
cfgrib: 0.9.10.1
iris: None
bottleneck: None
dask: None
distributed: None
matplotlib: 3.5.1
cartopy: 0.20.2
seaborn: None
numbagg: None
fsspec: None
cupy: None
pint: None
sparse: None
setuptools: 56.0.0
pip: 22.0.4
conda: None
pytest: None
IPython: 8.3.0
sphinx: 4.5.0
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/6560/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue
1222066968,I_kwDOAMm_X85I10MY,6553,"processing errror when using xr.dataset[:,::-10,::10]",90036937,closed,0,,,3,2022-05-01T08:09:56Z,2022-05-02T07:16:05Z,2022-05-01T22:08:36Z,NONE,,,,"### What happened?
These two should equals , but not . The coords of latitude are right , but the data is wrong.
### What did you expect to happen?
> these two should equals ,but not , latitude was wrong
>
```
> import numpy as np
> import xarray as xr
> data1 = xr.open_dataset('test1111111.nc')
```
> ! ! ! Note,important: After running the second sentence and running the first sentence again, the result will change so that the first sentence is normal! ! ! !
> ```
> #wrong code
> In[37]: np.array(data1.sel(time='1990-1' , isobaricInhPa=200 ).z[: , ::-10 , ::10])
> Out[37]:
> array([[[109890.25, 109890.75, 109890.75, ..., 109888.25, 109889.25,
> 109889.75],
> [110014.75, 110017.75, 110020.75, ..., 110006.75, 110009.75,
> 110012.25],
> [110109.75, 110115.25, 110119.75, ..., 110098.25, 110101.75,
> 110106.25],
> ...,
> [107800.25, 107824.75, 107845.75, ..., 107719.75, 107747.25,
> 107775.25],
> [107684.25, 107697.75, 107709.75, ..., 107641.25, 107656.25,
> 107670.25],
> [107585.75, 107587.75, 107589.75, ..., 107578.75, 107581.25,
> 107583.25]]], dtype=float32)
> ```
>
> ```
> #right code
> In[38]: np.array( data1.sel(time='1990-1' , isobaricInhPa=200 ).z)[: , ::-10 , ::10]
> Out[38]:
> array([[[109798.75, 109798.75, 109798.75, ..., 109798.75, 109798.75,
> 109798.75],
> [109915.75, 109916.75, 109917.25, ..., 109912.75, 109914.25,
> 109915.25],
> [110037.75, 110040.25, 110043.75, ..., 110028.25, 110030.25,
> 110034.25],
> ...,
> [107776.25, 107797.25, 107818.75, ..., 107702.75, 107727.25,
> 107753.25],
> [107662.25, 107673.25, 107683.25, ..., 107626.75, 107638.75,
> 107650.75],
> [107571.25, 107571.25, 107571.25, ..., 107571.25, 107571.25,
> 107571.25]]], dtype=float32)
> ```
>
> The latitude is really messed up. [test1111111.zip](https://github.com/pydata/xarray/files/8596782/test1111111.zip)
>
I think it is caused by a logic error, this code sometimes works fine, however when reading this file an exception occurs, although the coords are correct, the internal data is completely wrong, please check the processing logic.
### Minimal Complete Verifiable Example
_No response_
### Relevant log output
_No response_
### Anything else we need to know?
_No response_
### Environment
INSTALLED VERSIONS
------------------
commit: None
python: 3.8.12 (default, Oct 12 2021, 03:01:40) [MSC v.1916 64 bit (AMD64)]
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: AMD64 Family 25 Model 33 Stepping 0, AuthenticAMD
byteorder: little
LC_ALL: None
LANG: en
LOCALE: ('Chinese (Simplified)_China', '936')
libhdf5: 1.12.1
libnetcdf: 4.8.1
xarray: 2022.3.0
pandas: 1.4.2
numpy: 1.22.3
scipy: 1.7.3
netCDF4: 1.5.7
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: None
cftime: 1.6.0
nc_time_axis: None
PseudoNetCDF: None
rasterio: 1.2.10
cfgrib: 0.9.10.1
iris: None
bottleneck: None
dask: None
distributed: None
matplotlib: 3.5.1
cartopy: 0.20.2
seaborn: None
numbagg: None
fsspec: None
cupy: None
pint: None
sparse: None
setuptools: 56.0.0
pip: 22.0.4
conda: None
pytest: None
IPython: 8.3.0
sphinx: 4.5.0
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/6553/reactions"", ""total_count"": 1, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 1, ""eyes"": 0}",,completed,13221727,issue
1221809615,I_kwDOAMm_X85I01XP,6547,"these two should equals ,but not , latitude was wrong",90036937,closed,0,,,1,2022-04-30T11:34:11Z,2022-04-30T17:31:49Z,2022-04-30T17:31:42Z,NONE,,,,"these two should equals ,but not , latitude was wrong
```
import numpy as np
import xarray as xr
data1 = xr.open_dataset('test1111111.nc')
```
```
#wrong code
> np.array(data1.sel(time='1990-1' , isobaricInhPa=200 ).z[: , ::-10 , ::10])
Out[37]:
array([[[109890.25, 109890.75, 109890.75, ..., 109888.25, 109889.25,
109889.75],
[110014.75, 110017.75, 110020.75, ..., 110006.75, 110009.75,
110012.25],
[110109.75, 110115.25, 110119.75, ..., 110098.25, 110101.75,
110106.25],
...,
[107800.25, 107824.75, 107845.75, ..., 107719.75, 107747.25,
107775.25],
[107684.25, 107697.75, 107709.75, ..., 107641.25, 107656.25,
107670.25],
[107585.75, 107587.75, 107589.75, ..., 107578.75, 107581.25,
107583.25]]], dtype=float32)
```
```
#right code
> np.array( data1.sel(time='1990-1' , isobaricInhPa=200 ).z)[: , ::-10 , ::10]
Out[38]:
array([[[109798.75, 109798.75, 109798.75, ..., 109798.75, 109798.75,
109798.75],
[109915.75, 109916.75, 109917.25, ..., 109912.75, 109914.25,
109915.25],
[110037.75, 110040.25, 110043.75, ..., 110028.25, 110030.25,
110034.25],
...,
[107776.25, 107797.25, 107818.75, ..., 107702.75, 107727.25,
107753.25],
[107662.25, 107673.25, 107683.25, ..., 107626.75, 107638.75,
107650.75],
[107571.25, 107571.25, 107571.25, ..., 107571.25, 107571.25,
107571.25]]], dtype=float32)
```
The latitude is really messed up.
[test1111111.zip](https://github.com/pydata/xarray/files/8596782/test1111111.zip)
_Originally posted by @jesieleo in https://github.com/pydata/xarray/discussions/6546_","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/6547/reactions"", ""total_count"": 1, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 1, ""eyes"": 0}",,completed,13221727,issue