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/ScatterPlot.py
345 345
    #
346 346
    #  @param fname NetCDF file with input data.
347 347
    #  @param time_index Time slice to read.
348
    def ingest(self, fname, time_index):
348
    def ingest(self, fname, time_index, exclude=None):
349 349
        self.time_index_in_output = time_index
350 350

  
351 351
        with netCDF4.Dataset(fname, 'r') as ref:
......
359 359
            self.pair_list = []
360 360
            self.index_list = []
361 361
            variable_names = grp.variables['variable_names_scatter'][:]
362
            if exclude is not None:
363
                variable_names = [v for v in variable_names if v not in exclude]
364
                
362 365
            self.logger.debug("{0}.ingest(): variable names [{1}]".format(self.__class__.__name__, ", ".join(variable_names)))
363 366
            for i1, n1 in enumerate(variable_names[:-1]):
364 367
                for i, n2 in enumerate(variable_names[i1+1:]):

Also available in: Unified diff