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}

Adam
  • 2,726
  • 1
  • 9
  • 22
  • 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. – bwc Jun 18 '19 at 23:25
  • Did you get any ways to fix this issue in concat dims? – Krishnaap Feb 21 '22 at 10:22

1 Answers1

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.

MRocklin
  • 55,641
  • 23
  • 163
  • 235