Using MFDataset to combine netcdf files in python

I

Isaac Won

I am trying to combine netcdf files, but it contifuously shows " File "CBL_plot.py", line 11, in f = MFDataset(fili) File "utils.pyx", line 274, in netCDF4.MFDataset.init (netCDF4.c:3822) IOError: master dataset THref_11:00..nc does not have a aggregation dimension."

So, I checked only one netcdf files and the information of a netcdf file isas below:

float64 th_ref(u't',) unlimited dimensions = () current size = (30,)

It looks there is no aggregation dimension. However, I would like to combine those netcdf files rather than just using one by one. Is there any way tocreate aggregation dimension to make this MFData set work?

Below is the python code I used:
import numpy as np
from netCDF4 import MFDataset
varn = 'th_ref'
fili = THref_*nc'
f = MFDataset(fili)
Th = f.variables[varn]
Th_ref=np.array(Th[:])
print Th.shape

I will really appreciate any help, idea, and hint.

Thank you, Isaac
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top