Beispiel #1
0
    def point_tabulation(self):
        from reame.utils import tabulate_data_points
        from reame.sensors import VAR

        try:
            return self._point_tabulation
        except AttributeError:
            variables = VAR[self.algorithm]
            prod = self.cis_product()
            data = prod.create_data_object(variables)
            points = data.get_non_masked_points()
            self._point_tabulation = tabulate_data_points(points, self.grid)
            return self._point_tabulation
Beispiel #2
0
    variables = reame.sensors.VAR[args.algorithm]
    for i, fname in enumerate(args.files):
        here_name = out_name.format(i)
        if os.path.isfile(here_name) and not args.clobber:
            print("Output already generated: " + here_name)
            continue

        # Fetch appropriate class
        sensor = getattr(reame.sensors, args.algorithm)([fname], **kwargs)

        try:
            data = sensor.create_bounded_data_object(variables)
        except NotImplementedError:
            continue

        points = data.get_non_masked_bounded_points()
        hist, max_aod, mean_aod, mean_log = tabulate_data_points(points, grid)

        # Save results
        save = dict(files=[fname],
                    hist=hist,
                    max_aod=max_aod,
                    l=variables,
                    x=grid.lat_bins,
                    y=grid.lon_bins,
                    z=grid.aod_bins)
        mean_aod.save(save)
        mean_log.save(save)
        np.savez_compressed(here_name, **save)
        print(fname)
    if args.mod03_path:
        kwargs["mod03_path"] = args.mod03_path
    if args.grid_path:
        kwargs["grid_path"] = args.grid_path
    variables = reame.sensors.VAR[args.algorithm]
    for fname in args.files:
        # Fetch appropriate class
        sensor = getattr(reame.sensors, args.algorithm)([fname], **kwargs)

        try:
            data = sensor.create_bounded_data_object(variables)
        except NotImplementedError:
            continue

        points = data.get_non_masked_bounded_points()
        outputs = tabulate_data_points(points, grid)

        hist += outputs[0]
        max_aod = np.maximum(max_aod, outputs[1])
        mean_aod += outputs[2]
        mean_log += outputs[3]

    # Save results
    save = dict(files=args.files,
                hist=hist,
                max_aod=max_aod,
                l=variables,
                x=grid.lat_bins,
                y=grid.lon_bins,
                z=grid.aod_bins)
    mean_aod.save(save)