Skip to content

Commit

Permalink
update changelog; add smoketest
Browse files Browse the repository at this point in the history
  • Loading branch information
pressler-vsc committed Mar 4, 2024
1 parent 9249101 commit 1088c90
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ release points are not being annotated in GitHub.
- Unit tests for `sarpy/consistency/sicd_consistency.py`
- Support reading CPHDs with an AmpSF PVP whose Data/SignalArrayFormat is CF8
- Unit tests for `sarpy/consistency/sidd_consistency.py`
- Support for MATESA TRE
### Fixed
- `sarpy.io.kml.add_polygon` coordinate conditioning for older numpy versions
- Replace unsupported `pillow` constant `Image.ANTIALIAS` with `Image.LANCZOS`
Expand Down
1 change: 1 addition & 0 deletions tests/data/example_matesa_tre.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MATESA00889EO-1_HYPERION FTITLE 005507APR2005_Hyperion_331406N0442000E_SWIR172_1p2B_L1R-BIP0005RADIOMTRC_CALIB 0001EO-1_HYPERION FILENAME 0020HypGain_revC.dat.svfPARENT 0001EO-1_HYPERION FILENAME 0032EO12005097_020D020C_r1_WPS_01.L0PRE_DARKCOLLECT 0001EO-1_HYPERION FILENAME 0032EO12005097_020A0209_r1_WPS_01.L0POST_DARKCOLLECT 0001EO-1_HYPERION FILENAME 0032EO12005097_020F020E_r1_WPS_01.L0PARENT 0003EO-1_HYPERION FILENAME 0026EO1H1680372005097110PZ.L1REO-1_HYPERION FILENAME 0026EO1H1680372005097110PZ.AUXEO-1_HYPERION FILENAME 0026EO1H1680372005097110PZ.MET
14 changes: 14 additions & 0 deletions tests/data/example_matesa_tre.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import mmap
import os
import pathlib

# From https://nsgreg.nga.mil/doc/view?i=5516
nitf_with_matesa = '07APR2005_Hyperion_331406N0442000E_SWIR172_1p2B_L1R-BIP/07APR2005_Hyperion_331406N0442000E_SWIR172_1p2B_L1R-BIP.ntf'
cetag = b'MATESA'

with open(nitf_with_matesa, 'r+b') as nitffile, mmap.mmap(nitffile.fileno(), 0) as mm:
mm.seek(mm.find(cetag, 0) + len(cetag), os.SEEK_SET)
cel = mm.read(5)
data = mm.read(int(cel))

(pathlib.Path(__file__).parent / 'example_matesa_tre.bin').write_bytes(cetag + cel + data)
5 changes: 5 additions & 0 deletions tests/io/general/test_tre.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ class TestTreRegistry(unittest.TestCase):
def test_find_tre(self):
the_tre = find_tre('ACFTA')
self.assertEqual(the_tre, ACFTA)


def test_matesa(tests_path):
example = find_tre('MATESA').from_bytes((tests_path / 'data/example_matesa_tre.bin').read_bytes(), 0)
assert example.DATA.GROUPs[-1].MATEs[-1].MATE_ID == 'EO1H1680372005097110PZ.MET'

0 comments on commit 1088c90

Please sign in to comment.