Project

General

Profile

Revision 834:d989df597b80

IDd989df597b80
Parent 833:354ddca04053
Child 835:d623d705abd3

Added by Maarten Sneep about 2 years ago

Use the exclude parameter when ingesting existing files

View differences:

src/pycama/IrradiancePlot.py
208 208
    #
209 209
    #  @param fname NetCDF file with input data.
210 210
    #  @param time_index Time slice to read.
211
    def ingest(self, fname, time_step):
211
    def ingest(self, fname, time_step, exclude=None):
212 212
        self.time_index_in_output = time_step
213 213
        with h5py.File(fname, mode='r') as ref:
214 214
            try:
......
228 228
                if vgrp.attrs['time_step'] == time_step:
229 229
                    self.variables[key] = {}
230 230
                    for name, vv in [(kkey,vval) for (kkey, vval) in vgrp.items() if isinstance(vval, h5py.Dataset)]:
231
                        if exclude is not None and name in exclude:
232
                            continue
233
                            
231 234
                        self.variables[key][name] = {}
232 235
                        self.variables[key][name]['data'] = vv[:]
233 236
                        self.variables[key][name]['dimensions'] = [d.keys()[0] for d in vv.dims]

Also available in: Unified diff