-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9249101
commit a4fed9a
Showing
4 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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=5520 | ||
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters