示例#1
0
    def setUp(self, xr_):
        """Setup for test."""
        from satpy.readers.abi_l1b import NC_ABI_L1B
        rad_data = (np.arange(10.).reshape((2, 5)) + 1.) * 50.
        rad_data = (rad_data + 1.) / 0.5
        rad_data = rad_data.astype(np.int16)
        rad = xr.DataArray(rad_data,
                           attrs={
                               'scale_factor': 0.5,
                               'add_offset': -1.,
                               '_FillValue': 1002.,
                           })
        xr_.open_dataset.return_value = FakeDataset(
            {
                'band_id': np.array(8),
                'Rad': rad,
                "planck_fk1": np.array(13432.1),
                "planck_fk2": np.array(1497.61),
                "planck_bc1": np.array(0.09102),
                "planck_bc2": np.array(0.99971),
                "esun": np.array(2017),
                "nominal_satellite_subpoint_lat": np.array(0.0),
                "nominal_satellite_subpoint_lon": np.array(-89.5),
                "nominal_satellite_height": np.array(35786.02),
                "earth_sun_distance_anomaly_in_AU": np.array(0.99)
            }, {})

        self.reader = NC_ABI_L1B(
            'filename', {
                'platform_shortname': 'G16',
                'observation_type': 'Rad',
                'scene_abbr': 'C',
                'scan_mode': 'M3'
            }, {'filetype': 'info'})
示例#2
0
    def setUp(self, xr_):
        """Setup for test."""
        from satpy.readers.abi_l1b import NC_ABI_L1B
        proj = xr.DataArray(
            [],
            attrs={
                'semi_major_axis': 1.,
                'semi_minor_axis': 1.,
                'perspective_point_height': 1.,
                'longitude_of_projection_origin': -90.,
                'sweep_angle_axis': u'x'
            }
        )
        x__ = xr.DataArray(
            [-1., 1.],
            attrs={'scale_factor': 1., 'add_offset': 0.},
        )
        y__ = xr.DataArray(
            [-1., 1.],
            attrs={'scale_factor': 1., 'add_offset': 0.},
        )
        xr_.open_dataset.return_value = FakeDataset({
            'goes_imager_projection': proj,
            'x': x__,
            'y': y__,
            'Rad': np.ones((10, 10))}, {})

        self.reader = NC_ABI_L1B('filename',
                                 {'platform_shortname': 'G16'},
                                 {'filetype': 'info'})
示例#3
0
    def setUp(self, xr_):
        """Setup for test."""
        rad_data = (np.arange(10.).reshape((2, 5)) + 1.)
        rad_data = (rad_data + 1.) / 0.5
        rad_data = rad_data.astype(np.int16)
        rad = xr.DataArray(rad_data,
                           attrs={
                               'scale_factor': 0.5,
                               'add_offset': -1.,
                               '_FillValue': 20,
                           })
        xr_.open_dataset.return_value = FakeDataset(
            {
                'band_id': np.array(5),
                'Rad': rad,
                "planck_fk1": np.array(13432.1),
                "planck_fk2": np.array(1497.61),
                "planck_bc1": np.array(0.09102),
                "planck_bc2": np.array(0.99971),
                "esun": np.array(2017),
                "nominal_satellite_subpoint_lat": np.array(0.0),
                "nominal_satellite_subpoint_lon": np.array(-89.5),
                "nominal_satellite_height": np.array(35786.02),
                "earth_sun_distance_anomaly_in_AU": np.array(0.99)
            }, {
                "time_coverage_start": "2017-09-20T17:30:40.8Z",
                "time_coverage_end": "2017-09-20T17:41:17.5Z",
            })

        self.reader = NC_ABI_L1B('filename', {'platform_shortname': 'G16'},
                                 {'filetype': 'info'})
示例#4
0
    def setUp(self, xr_):
        """Setup for test."""
        from satpy.readers.abi_l1b import NC_ABI_L1B
        rad_data = (np.arange(10.).reshape((2, 5)) + 1.)
        rad_data = (rad_data + 1.) / 0.5
        rad_data = rad_data.astype(np.int16)
        x_image = xr.DataArray(0.)
        y_image = xr.DataArray(0.)
        time = xr.DataArray(0.)
        rad = xr.DataArray(rad_data,
                           dims=('y', 'x'),
                           attrs={
                               'scale_factor': 0.5,
                               'add_offset': -1.,
                               '_FillValue': 20,
                           },
                           coords={
                               'time': time,
                               'x_image': x_image,
                               'y_image': y_image,
                           })
        xr_.open_dataset.return_value = FakeDataset(
            {
                'band_id': np.array(5),
                'Rad': rad,
                "planck_fk1": np.array(13432.1),
                "planck_fk2": np.array(1497.61),
                "planck_bc1": np.array(0.09102),
                "planck_bc2": np.array(0.99971),
                "esun": np.array(2017),
                "x_image": x_image,
                "y_image": y_image,
                "nominal_satellite_subpoint_lat": np.array(0.0),
                "nominal_satellite_subpoint_lon": np.array(-89.5),
                "nominal_satellite_height": np.array(35786.02),
                "earth_sun_distance_anomaly_in_AU": np.array(0.99)
            }, {
                "time_coverage_start": "2017-09-20T17:30:40.8Z",
                "time_coverage_end": "2017-09-20T17:41:17.5Z",
            })

        self.reader = NC_ABI_L1B(
            'filename', {
                'platform_shortname': 'G16',
                'observation_type': 'Rad',
                'scene_abbr': 'C',
                'scan_mode': 'M3'
            }, {'filetype': 'info'})