2

I try to open multiple MODIS files (MYD06_L2) using xarray (xr.open_mfdataset).

I can open a single file or may be some files but i am not able to open many files or one day file as they have different dimensions.

d06 = xr.open_mfdataset(M06_2040, concat_dim= 'None', parallel=True)
['Cloud_Mask_1km'][:,:,:,0].values

Here M06_2040 is the directory of the files

I end up with the following error:

ValueError: arguments without labels along dimension 'Cell_Along_Swath_1km:mod06' cannot be aligned because they have different dimension sizes: {2040, 2030}

2
  • I dealt with the same thing parsing MODIS data and the two different swath sizes. My workaround was to get a list of all files with swath size 2030 and 2040 and load each list separately with open_mfdataset. Commented Jun 18, 2019 at 23:25
  • Did you get any ways to fix this issue in concat dims? Commented Feb 21, 2022 at 10:22

1 Answer 1

2

Correct. I believe that the xarray.open_mfdataset function expects that all dimensions other than the concatenated dimension are the same in all files.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.