@@ -0,0 +1,1078 @@
+%0A%0A%0Aclass Worker(object):%0A%0A    def __init__(self):%0A        self.finished = False%0A%0A%0Aclass GridProcessor(Worker):%0A%0A    def __init__(self):%0A        self.pid = os.getpid()%0A        self.age = None%0A        self.angle = None%0A        self.data_dir = None%0A        self.results_dir = None%0A    %0A    def set_data_dir(self, data_dir):%0A        self.data_dir = data_dir%0A    %0A    def set_results_dir(self, results_dir):%0A        self.results_dir = results_dir%0A%0A    def match_template(self, age, angle):%0A        self.age = age%0A        self.angle = angle%0A        self.amp, self.snr = scarplet.match_template(self.data_dir, age, angle)%0A%0Aclass Reducer(Worker):%0A%0A    def __init__(self):%0A        self.best_fn = None%0A        self.results_fn = None%0A%0A    def set_best_fn(self, best_fn):%0A        self.best_fn = best_fn%0A    %0A    def update_best_estimates(self, this_fn):%0A        best_params = np.load(self.best_fn)%0A        this_params = np.load(this_fn)%0A%0A        mask = this_params%5B-1,:,:%5D %3E best_params%5B-1,:,:%5D%0A        best_params%5B:, mask%5D = this_params%5B:, mask%5D%0A        np.save(self.best_fn, best_params)%0A

Check if data has nodata mask