Skip to content

Commit

Permalink
fix: error creating SICD 1.3.0 sensor models
Browse files Browse the repository at this point in the history
  • Loading branch information
edparris committed Jul 26, 2024
1 parent a579577 commit 9272da0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/aws/osml/gdal/sicd_sensor_model_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ def from_dataclass(sicd: Union[sicd121.SICD, sicd130.SICD]) -> Optional[SensorMo

projection_set = None
ugpn = None
if sicd.grid.type_value == sicd121.ImageGridType.RGAZIM:
if sicd.image_formation.image_form_algo == sicd121.ImageFormAlgo.PFA:
if sicd.grid.type_value.value == sicd121.ImageGridType.RGAZIM.value:
if sicd.image_formation.image_form_algo.value == sicd121.ImageFormAlgo.PFA.value:
ugpn = xyztype_to_ndarray(sicd.pfa.fpn)
projection_set = PFAProjectionSet(
scp_ecf=scp_ecf,
Expand All @@ -146,22 +146,22 @@ def from_dataclass(sicd: Union[sicd121.SICD, sicd130.SICD]) -> Optional[SensorMo
coa_time_poly=time_coa_poly,
arp_poly=arp_poly,
)
elif sicd.image_formation.image_form_algo == sicd121.ImageFormAlgo.RGAZCOMP:
elif sicd.image_formation.image_form_algo.value == sicd121.ImageFormAlgo.RGAZCOMP.value:
projection_set = RGAZCOMPProjectionSet(
scp_ecf=scp_ecf, az_scale_factor=sicd.rg_az_comp.az_sf, coa_time_poly=time_coa_poly, arp_poly=arp_poly
)
elif sicd.grid.type_value == sicd121.ImageGridType.RGZERO:
elif sicd.grid.type_value.value == sicd121.ImageGridType.RGZERO.value:
projection_set = INCAProjectionSet(
r_ca_scp=sicd.rma.inca.r_ca_scp,
inca_time_coa_poly=poly1d_to_native(sicd.rma.inca.time_capoly),
drate_sf_poly=poly2d_to_native(sicd.rma.inca.drate_sfpoly),
coa_time_poly=time_coa_poly,
arp_poly=arp_poly,
)
elif sicd.grid.type_value in [
sicd121.ImageGridType.PLANE,
sicd121.ImageGridType.XCTYAT,
sicd121.ImageGridType.XRGYCR,
elif sicd.grid.type_value.value in [
sicd121.ImageGridType.PLANE.value,
sicd121.ImageGridType.XCTYAT.value,
sicd121.ImageGridType.XRGYCR.value,
]:
projection_set = PlaneProjectionSet(
scp_ecf=scp_ecf,
Expand Down
2 changes: 2 additions & 0 deletions test/aws/osml/gdal/test_sensor_model_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ def test_sicd_sensor_models(self):
"./test/data/sicd/capella-sicd121-chip1.ntf",
"./test/data/sicd/capella-sicd121-chip2.ntf",
"./test/data/sicd/umbra-sicd121-chip1.ntf",
"./test/data/sicd/capella-sicd130-chip1.ntf",
"./test/data/sicd/capella-sicd130-chip2.ntf",
]
for image_path in test_examples:
ds = gdal.Open(image_path)
Expand Down
3 changes: 3 additions & 0 deletions test/data/sicd/capella-sicd130-chip1.ntf
Git LFS file not shown
3 changes: 3 additions & 0 deletions test/data/sicd/capella-sicd130-chip2.ntf
Git LFS file not shown

0 comments on commit 9272da0

Please sign in to comment.