Skip to content

Commit

Permalink
Move geotransform and spatial_ref to attrs
Browse files Browse the repository at this point in the history
Once I find out how to use them correctly, I will switch to AreaDefinition instead of SwathDefinition
Ref: nasa/EMIT-Data-Resources#43
  • Loading branch information
zxdawn committed Oct 18, 2023
1 parent adb45a4 commit e16176c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions satpy/readers/emit_l1b.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
from datetime import datetime

import numpy as np
from pyproj import CRS
from affine import Affine
from pyresample.geometry import SwathDefinition
from satpy.readers.netcdf_utils import NetCDF4FileHandler
from satpy.utils import get_legacy_chunk_size
Expand Down Expand Up @@ -97,6 +95,8 @@ def attrs(self):
"end_time": self.end_time,
"platform_name": self.platform_name,
"sensor": self.sensor,
"geotransform": self.geotransform,
"spatial_ref": self.spatial_ref,
}

def _standardize_dims(self, dataset):
Expand Down Expand Up @@ -165,10 +165,6 @@ def get_dataset(self, dataset_id, ds_info):
self.get_lonlats()
dataset.attrs['area'] = self.area

Check warning on line 166 in satpy/readers/emit_l1b.py

View check run for this annotation

Codecov / codecov/patch

satpy/readers/emit_l1b.py#L165-L166

Added lines #L165 - L166 were not covered by tests

# write crs and geotransform
dataset.rio.write_transform(Affine.from_gdal(*self.geotransform), inplace=True)
dataset.rio.write_crs(CRS.from_wkt(self.spatial_ref), inplace=True)

return dataset

Check warning on line 168 in satpy/readers/emit_l1b.py

View check run for this annotation

Codecov / codecov/patch

satpy/readers/emit_l1b.py#L168

Added line #L168 was not covered by tests

def get_lonlats(self):
Expand Down

0 comments on commit e16176c

Please sign in to comment.