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/HistogramPlot.py
252 252
    #
253 253
    #  @param fname NetCDF file with input data.
254 254
    #  @param time_index Time slice to read.
255
    def ingest(self, fname, time_index):
255
    def ingest(self, fname, time_index, exclude=None):
256 256
        self.time_index_in_output = time_index
257 257
        with h5py.File(fname, 'r') as ref:
258 258
            try:
......
263 263
                return False
264 264

  
265 265
            vlist = [k.decode("ASCII") for k in ref['variable_names'][:]]
266
            if exclude is not None:
267
                vlist = [v for v in vlist if v not in exclude]
268
                
266 269
            self.input_variables = Namespace(variables={})
267 270

  
268 271
            for k in vlist:

Also available in: Unified diff