repo stringlengths 2 99 | file stringlengths 13 225 | code stringlengths 0 18.3M | file_length int64 0 18.3M | avg_line_length float64 0 1.36M | max_line_length int64 0 4.26M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
sarpy | sarpy-master/tests/io/product/sidd3_elements/test_sidd3_elements.py | #
# Copyright 2023 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
import logging
import numpy as np
import pytest
import sarpy.io.complex.sicd_elements.Radiometric as SicdRadiometric
from sarpy.io.product.sidd3_elements import blocks
def test_anglezeroto360_nominal(caplog):
with ca... | 2,200 | 36.305085 | 103 | py |
sarpy | sarpy-master/tests/io/phase_history/test_cphd.py | import logging
import os
import json
import tempfile
import unittest
import shutil
import numpy.testing
from sarpy.io.phase_history.cphd import CPHDReader, CPHDReader0_3, CPHDReader1, CPHDWriter1
from sarpy.io.phase_history.converter import open_phase_history
import sarpy.consistency.cphd_consistency
from tests impor... | 7,535 | 48.254902 | 116 | py |
sarpy | sarpy-master/tests/io/phase_history/__init__.py |
__classification__ = 'UNCLASSIFIED'
| 37 | 11.666667 | 35 | py |
sarpy | sarpy-master/tests/io/phase_history/cphd1_elements/__init__.py |
__classification__ = 'UNCLASSIFIED'
| 37 | 11.666667 | 35 | py |
sarpy | sarpy-master/tests/io/phase_history/cphd1_elements/test_utils.py | import numpy as np
import sarpy.io.phase_history.cphd1_elements.utils
import unittest
class TestCphd1Utils(unittest.TestCase):
def test_binary_format_to_dtype(self):
self.assertEqual(sarpy.io.phase_history.cphd1_elements.utils.binary_format_string_to_dtype('I1'), np.int8)
dt = np.dtype([('a', '>i8... | 523 | 39.307692 | 123 | py |
sarpy | sarpy-master/tests/io/complex/test_sicd.py | import os
import json
import tempfile
import unittest
from sarpy.io.complex.converter import conversion_utility
from sarpy.io.complex.sicd import SICDReader
from sarpy.io.complex.sicd_schema import get_schema_path, get_default_version_string
from tests import parse_file_entry
try:
from lxml import etree
except ... | 2,629 | 38.848485 | 112 | py |
sarpy | sarpy-master/tests/io/complex/test_reader.py | import logging
import os
import json
import unittest
from sarpy.io.complex.converter import open_complex
from sarpy.io.complex.sicd import SICDReader
from sarpy.io.complex.radarsat import RadarSatReader
from sarpy.io.complex.sentinel import SentinelReader
from sarpy.io.complex.tsx import TSXReader
from sarpy.io.comple... | 8,004 | 47.515152 | 135 | py |
sarpy | sarpy-master/tests/io/complex/__init__.py |
__classification__ = 'UNCLASSIFIED'
| 37 | 11.666667 | 35 | py |
sarpy | sarpy-master/tests/io/complex/test_remote.py | import unittest
from sarpy.io.complex.converter import open_complex
from sarpy.io.complex.sicd import SICDReader
try:
import smart_open
except ImportError:
smart_open = None
file_object = None
if smart_open is not None:
try:
file_object = smart_open.open(
'https://six-library.s3.amazo... | 3,118 | 43.557143 | 124 | py |
sarpy | sarpy-master/tests/io/complex/test_utils.py |
import numpy
from numpy.polynomial import polynomial
from sarpy.io.complex.utils import two_dim_poly_fit
import unittest
class TestRadarSatUtils(unittest.TestCase):
def test_two_dim_poly_fit(self):
coeffs = numpy.arange(9).reshape((3, 3))
y, x = numpy.meshgrid(numpy.arange(2, 6), numpy.arange(-2,... | 562 | 34.1875 | 94 | py |
sarpy | sarpy-master/tests/io/complex/sicd_elements/test_sicd_elements_rgazcomp.py | #
# Copyright 2023 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
from sarpy.io.complex.sicd_elements import RgAzComp
def test_rgazcomp(rma_sicd, kwargs):
rg_az = RgAzComp.RgAzCompType(None, None, **kwargs)
rg_az._derive_parameters(rma_sicd.Grid, rma_sicd.Timeline, rma_sicd.SCPCO... | 494 | 29.9375 | 79 | py |
sarpy | sarpy-master/tests/io/complex/sicd_elements/test_sicd_elements_antenna.py | #
# Copyright 2023 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
import numpy as np
import pytest
from sarpy.io.complex.sicd_elements import Antenna
from sarpy.io.complex.sicd_elements import blocks
@pytest.fixture
def tx_ant_param(sicd, kwargs):
return Antenna.AntParamType(XAxisPo... | 3,948 | 40.568421 | 104 | py |
sarpy | sarpy-master/tests/io/complex/sicd_elements/test_sicd_elements_blocks.py | #
# Copyright 2023 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
from collections import OrderedDict
import copy
import re
from typing import Tuple
from xml.etree.ElementTree import Element, ElementTree, SubElement
import numpy as np
import pytest
from sarpy.io.complex.sicd_elements imp... | 32,409 | 32.760417 | 87 | py |
sarpy | sarpy-master/tests/io/complex/sicd_elements/test_sicd_elements_grid.py | #
# Copyright 2023 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
import numpy as np
from sarpy.io.complex.sicd_elements import Grid
from sarpy.io.xml.base import parse_xml_from_string
def test_grid_gridtype(sicd, rma_sicd, caplog):
"""Test Grid.GridType class"""
# Start with em... | 6,197 | 36.792683 | 90 | py |
sarpy | sarpy-master/tests/io/complex/sicd_elements/conftest.py | #
# Copyright 2023 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
import pathlib
import pytest
from sarpy.io.complex.sicd_elements import SICD
@pytest.fixture()
def sicd():
xml_file = pathlib.Path(pathlib.Path.cwd(), 'tests/data/example.sicd.xml')
structure = SICD.SICDType().fr... | 693 | 17.756757 | 82 | py |
sarpy | sarpy-master/tests/io/complex/sicd_elements/test_sicd_elements_radiometric.py | #
# Copyright 2023 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
from sarpy.io.complex.sicd_elements import Radiometric
def test_radiometric(sicd, rma_sicd, kwargs):
noise_level = Radiometric.NoiseLevelType_()
assert noise_level.NoiseLevelType is None
assert noise_level.Nois... | 2,223 | 38.714286 | 104 | py |
sarpy | sarpy-master/tests/io/complex/sicd_elements/test_sicd_elements_sicd.py | #
# Copyright 2023 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
import copy
import re
import numpy as np
import pytest
from sarpy.io.complex.sicd_elements import RgAzComp
def test_sicd_smoke_tests(sicd, rma_sicd, tol):
assert sicd.is_valid()
sicd_copy = sicd.copy()
asser... | 13,569 | 37.660969 | 121 | py |
sarpy | sarpy-master/tests/io/complex/sicd_elements/test_sicd_elements_utils.py | #
# Copyright 2023 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
import copy
from sarpy.io.complex.sicd_elements import utils
from sarpy.io.complex.sicd_elements import validation_checks
def test_validation_checks(sicd):
"""Smoke test with PFA SICD"""
validation_checks.detailed... | 2,882 | 33.73494 | 90 | py |
sarpy | sarpy-master/tests/io/complex/sicd_elements/test_sicd_elements_imageformation.py | #
# Copyright 2023 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
import re
import numpy as np
import pytest
from sarpy.io.complex.sicd_elements import ImageFormation
MIN_FREQ = 9.0e9
MAX_FREQ = 10.0e9
def test_image_formation_rcvchanproc(kwargs):
# Basic smoke test
rcv_chan_p... | 8,383 | 35.611354 | 123 | py |
sarpy | sarpy-master/tests/io/complex/sicd_elements/test_sicd_elements_matchinfo.py | #
# Copyright 2023 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
from sarpy.io.complex.sicd_elements import MatchInfo
from sarpy.io.xml.base import parse_xml_from_string
def test_matchinfo(kwargs):
match_coll_type = MatchInfo.MatchCollectionType(CoreName='TEST', **kwargs)
assert... | 1,715 | 37.133333 | 87 | py |
sarpy | sarpy-master/tests/io/complex/sicd_elements/test_sicd_elements_pfa.py | #
# Copyright 2023 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
import numpy as np
import pytest
from sarpy.io.complex.sicd_elements import blocks
from sarpy.io.complex.sicd_elements import PFA
def test_pfa(sicd, tol, kwargs):
"""Test PFA classes"""
stdeskew = PFA.STDeskewType... | 4,175 | 40.76 | 100 | py |
sarpy | sarpy-master/tests/io/complex/sicd_elements/test_sicd_elements_radarcollection.py | #
# Copyright 2023 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
import numpy as np
import pytest
from sarpy.io.complex.sicd_elements import RadarCollection
def test_radarcollection_getbandname():
assert RadarCollection.get_band_name(None) == 'UN'
assert RadarCollection.get_ban... | 16,641 | 50.364198 | 132 | py |
sarpy | sarpy-master/tests/io/complex/sicd_elements/test_sicd_elements_timeline.py | #
# Copyright 2023 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
import numpy as np
from sarpy.io.complex.sicd_elements import Timeline
def test_timeline(sicd, kwargs):
def get_ipp_set(ipp, idx, **kwargs):
return Timeline.IPPSetType(ipp.TStart,
... | 4,681 | 41.563636 | 113 | py |
sarpy | sarpy-master/tests/io/complex/sicd_elements/test_sicd_elements_imagecreation.py | #
# Copyright 2023 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
import numpy as np
from sarpy.io.complex.sicd_elements import ImageCreation
def test_imagecreationtype(kwargs):
# Smoke test
image_creation_type = ImageCreation.ImageCreationType(
Application="Fake IFP",
... | 1,144 | 30.805556 | 70 | py |
sarpy | sarpy-master/tests/io/complex/sicd_elements/test_sicd_elements_collectioninfo.py | #
# Copyright 2023 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
from sarpy.io.complex.sicd_elements import CollectionInfo
def test_collectioninfo_radarmodetype(kwargs):
radar_mode_type = CollectionInfo.RadarModeType(ModeType="SPOTLIGHT", ModeID="SL")
assert radar_mode_type.Mode... | 2,812 | 43.650794 | 85 | py |
sarpy | sarpy-master/tests/io/complex/sicd_elements/test_sicd_elements_errorstatistics.py | #
# Copyright 2023 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
from sarpy.io.complex.sicd_elements import blocks
from sarpy.io.complex.sicd_elements import ErrorStatistics
def test_errorstatistics(kwargs):
scp_error_type = ErrorStatistics.CompositeSCPErrorType(Rg=1.0, Az=2.0, RgAz... | 3,326 | 51.809524 | 131 | py |
sarpy | sarpy-master/tests/io/complex/sicd_elements/test_sicd_elements_position.py | #
# Copyright 2023 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
import copy
import numpy as np
import pytest
from sarpy.io.complex.sicd_elements import Position
from sarpy.io.complex.sicd_elements import SCPCOA
@pytest.fixture()
def position(sicd, kwargs):
return Position.Positio... | 2,501 | 30.275 | 80 | py |
sarpy | sarpy-master/tests/io/complex/sicd_elements/test_sicd_elements_imagedata.py | #
# Copyright 2023 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
import numpy as np
import pytest
from sarpy.io.complex.sicd_elements import ImageData
def test_imagedata(sicd, kwargs, caplog):
image_type = ImageData.FullImageType()
assert image_type.NumRows is None
assert i... | 4,378 | 47.120879 | 109 | py |
sarpy | sarpy-master/tests/io/complex/sicd_elements/test_sicd_elements_scpcoa.py | #
# Copyright 2023 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
import copy
import re
import numpy as np
import pytest
from sarpy.io.complex.sicd_elements import SCPCOA
@pytest.fixture()
def scpcoa(sicd, kwargs):
return SCPCOA.SCPCOAType(
SCPTime=sicd.SCPCOA.SCPTime,
... | 9,720 | 32.177474 | 129 | py |
sarpy | sarpy-master/tests/io/DEM/test_geotiff1deg_list.py | """
These test functions will exercise the GeoTIFF1DegList class which contains methods used to determine
which GeoTIFF files are needed to cover a specified geodetic bounding box. These tests create dummy,
temporary, DEM files on-the-fly, so there is no need to provide any actual DEM files.
"""
import logging
import... | 8,182 | 37.238318 | 116 | py |
sarpy | sarpy-master/tests/io/DEM/test_geoid.py | import time
import os
import logging
import numpy
import json
import unittest
import sarpy.io.DEM.geoid as geoid
from tests import parse_file_entry
test_file = None
geoid_files = []
this_loc = os.path.abspath(__file__)
file_reference = os.path.join(os.path.split(this_loc)[0], 'geoid.json') # specifies file location... | 3,694 | 38.308511 | 120 | py |
sarpy | sarpy-master/tests/io/DEM/__init__.py |
__classification__ = 'UNCLASSIFIED'
| 37 | 11.666667 | 35 | py |
sarpy | sarpy-master/tests/io/DEM/test_geotiff1deg_reader.py | """
These test functions will exercise the GeoTIFF1DegInterpolator class which reads DEM data files and interpolates
data points as needed. Most of these tests use fabricated data, so the GeoTIFF1DegInterpolator class is moderately
well tests without providing external DEM data. However, when available, real DEM data... | 17,833 | 43.253102 | 121 | py |
sarpy | sarpy-master/tests/consistency/test_consistency.py | #
# Copyright 2020-2021 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
import itertools
import pytest
import sarpy.consistency.consistency as con
class DummyConsistency(con.ConsistencyChecker):
"""A ConsistencyChecker used for unit testing and code coverage"""
def __init__(self... | 4,970 | 27.405714 | 107 | py |
sarpy | sarpy-master/tests/consistency/test_cphd_consistency.py | #
# Copyright 2020-2021 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
import copy
import importlib.util
import os
import re
import shutil
import tempfile
import xml.etree.ElementTree as ET
from lxml import etree
import numpy as np
import pytest
from sarpy.consistency.cphd_consistency i... | 46,073 | 40.620596 | 115 | py |
sarpy | sarpy-master/tests/geometry/test_geocoords.py | import pytest
import numpy
from sarpy.geometry import geocoords
EQUATORIAL_RADIUS = 6378137
POLAR_RADIUS = 6356752.314245179
TOLERANCE = 1e-8
numpy.random.seed(314159)
@pytest.fixture(scope='module')
def input():
llh = numpy.array([[0, 0, 0], [0, 180, 0], [90, 0, 0], [-90, 0, 0], [0, 90, 0]], dtype='float64'... | 7,290 | 34.565854 | 101 | py |
sarpy | sarpy-master/tests/geometry/__init__.py |
__classification__ = 'UNCLASSIFIED'
| 37 | 11.666667 | 35 | py |
sarpy | sarpy-master/tests/geometry/test_point_projection.py | #
# Copyright 2023 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
import pathlib
import numpy as np
import pytest
from sarpy.geometry import point_projection
from sarpy.io.complex.sicd_elements.SICD import SICDType
from sarpy.io.product.sidd2_elements.SIDD import SIDDType
from sarpy.io.D... | 12,005 | 46.082353 | 120 | py |
sarpy | sarpy-master/tests/geometry/test_latlon.py | #
# Copyright 2022 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
import numpy as np
import pytest
from sarpy.geometry import latlon
def test_string():
ll_str = latlon.string(33.92527777777778, 'lat') # float input
assert ll_str == '33°55\'31"N'
ll_str = latlon.string(33, ... | 2,772 | 29.811111 | 90 | py |
sarpy | sarpy-master/tests/geometry/test_geometry_elements.py | #
# Copyright 2022 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
import numpy as np
import pytest
from sarpy.geometry import geometry_elements
@pytest.fixture(scope='module')
def test_elements():
point = [33.447899, -112.097254]
point_json = {
"type": "Point",
"... | 25,941 | 42.021559 | 141 | py |
sarpy | sarpy-master/tests/visualization/test_remap.py | #
# Copyright 2022 Valkyrie Systems Corporation
#
# Licensed under MIT License. See LICENSE.
#
import collections
import unittest
import numpy as np
from sarpy.visualization import remap
try:
import matplotlib.pyplot as plt
MATPLOTLIB_AVAILABLE = True
except ImportError:
MATPLOTLIB_AVAILABLE = False
... | 14,497 | 39.954802 | 97 | py |
sarpy | sarpy-master/tests/visualization/test_cphd_kmz_product_creation.py | import os
import xml.etree.ElementTree
import zipfile
import pytest
import sarpy.io.phase_history
import sarpy.visualization.cphd_kmz_product_creation as cphd_kmz
TEST_FILE_NAMES = {
'simple': 'spotlight_example.cphd',
}
TEST_FILE_PATHS = {}
TEST_FILE_ROOT = os.environ.get('SARPY_TEST_PATH', None)
if TEST_FILE... | 1,364 | 28.042553 | 78 | py |
sarpy | sarpy-master/tests/visualization/__init__.py | 0 | 0 | 0 | py | |
sarpy | sarpy-master/sarpy/__details__.py |
__classification__ = 'UNCLASSIFIED'
_post_identifier = '' # this is the public release version
| 97 | 23.5 | 59 | py |
sarpy | sarpy-master/sarpy/compliance.py |
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
class SarpyError(Exception):
"""A custom base exception class"""
pass
def bytes_to_string(bytes_in, encoding='utf-8'):
"""
Ensure that the input bytes is mapped to a string.
Parameters
----------
bytes_in : bytes
... | 669 | 19.30303 | 92 | py |
sarpy | sarpy-master/sarpy/__init__.py | from .__about__ import *
import logging
__all__ = ['__version__',
'__classification__', '__author__', '__url__', '__email__',
'__title__', '__summary__',
'__license__', '__copyright__']
# establish logging paradigm
logger = logging.getLogger(__name__)
logger.setLevel(logging.WARNING... | 322 | 22.071429 | 70 | py |
sarpy | sarpy-master/sarpy/__about__.py | # MIT License
#
# Copyright (c) 2020 National Geospatial-Intelligence Agency
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# t... | 1,841 | 39.043478 | 105 | py |
sarpy | sarpy-master/sarpy/io/kml.py | """
Functionality for exporting certain data elements to a kml document
"""
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
import zipfile
import logging
import os
import numpy
from typing import Union, List
from uuid import uuid4
from io import BytesIO
from xml.dom import minidom
from sarpy.ge... | 51,284 | 36.136133 | 136 | py |
sarpy | sarpy-master/sarpy/io/__init__.py |
__classification__ = "UNCLASSIFIED"
def open(file_name: str):
"""
Given a file, try to find and return the appropriate reader object.
Parameters
----------
file_name : str
Returns
-------
BaseReader
Raises
------
SarpyIOError
"""
from .complex.converter import ... | 1,207 | 20.192982 | 82 | py |
sarpy | sarpy-master/sarpy/io/received/base.py | """
Base structures for received signal data readers and usage
"""
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
from typing import Union, Tuple, Sequence, Dict, Optional
import numpy
from sarpy.io.general.base import BaseReader
from sarpy.io.general.data_segment import DataSegment
from sarpy... | 5,562 | 29.07027 | 109 | py |
sarpy | sarpy-master/sarpy/io/received/converter.py | """
This module provide utilities for reading essentially Compensated Received Signal Data
"""
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
import os
from typing import Callable
from sarpy.io.general.base import SarpyIOError, BaseReader, check_for_openers
from sarpy.io.received.base import C... | 2,036 | 22.964706 | 86 | py |
sarpy | sarpy-master/sarpy/io/received/__init__.py |
__classification__ = 'UNCLASSIFIED'
| 37 | 11.666667 | 35 | py |
sarpy | sarpy-master/sarpy/io/received/crsd.py | """
Module for reading and writing CRSD version 1.0 files
"""
__classification__ = "UNCLASSIFIED"
__author__ = ("Thomas McCullough", "Michael Stewart, Valyrie")
import logging
import os
from typing import Union, Tuple, List, Sequence, Dict, BinaryIO, Optional
from collections import OrderedDict
import numpy
from s... | 26,665 | 31.759214 | 123 | py |
sarpy | sarpy-master/sarpy/io/received/crsd1_elements/base.py |
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
DEFAULT_STRICT = False
FLOAT_FORMAT = '0.17E'
| 118 | 13.875 | 35 | py |
sarpy | sarpy-master/sarpy/io/received/crsd1_elements/Antenna.py | """
The Antenna type definition.
"""
__classification__ = "UNCLASSIFIED"
__author__ = ("Thomas McCullough", "Michael Stewart, Valkyrie")
from typing import List
from sarpy.io.xml.base import Serializable
from sarpy.io.xml.descriptors import FloatDescriptor, StringDescriptor, BooleanDescriptor, \
SerializableDesc... | 7,511 | 36.373134 | 107 | py |
sarpy | sarpy-master/sarpy/io/received/crsd1_elements/CRSD.py | """
The Compensated Received Signal Data 1.0 definition.
"""
__classification__ = "UNCLASSIFIED"
__author__ = ("Thomas McCullough", "Michael Stewart, Valkyrie")
from xml.etree import ElementTree
from collections import OrderedDict
from typing import Union
import numpy
from sarpy.io.xml.base import Serializable, find... | 20,462 | 38.888889 | 115 | py |
sarpy | sarpy-master/sarpy/io/received/crsd1_elements/Data.py | """
The DataType definition.
"""
__classification__ = "UNCLASSIFIED"
__author__ = ("Thomas McCullough", "Michael Stewart, Valkyrie")
from typing import List
from sarpy.io.xml.base import Serializable
from sarpy.io.xml.descriptors import StringDescriptor, StringEnumDescriptor, \
IntegerDescriptor, SerializableLis... | 6,848 | 40.011976 | 115 | py |
sarpy | sarpy-master/sarpy/io/received/crsd1_elements/ErrorParameters.py | """
The error parameters type definition.
"""
__classification__ = "UNCLASSIFIED"
__author__ = ("Thomas McCullough", "Michael Stewart, Valkyrie")
from typing import Union
from sarpy.io.xml.base import Serializable, ParametersCollection
from sarpy.io.xml.descriptors import FloatDescriptor, SerializableDescriptor, \
... | 15,839 | 38.6 | 128 | py |
sarpy | sarpy-master/sarpy/io/received/crsd1_elements/CollectionID.py | """
The CollectionIDType definition.
"""
__classification__ = "UNCLASSIFIED"
__author__ = ("Thomas McCullough", "Michael Stewart, Valkyrie")
from sarpy.io.xml.descriptors import StringDescriptor
from sarpy.io.complex.sicd_elements.CollectionInfo import CollectionInfoType
from .base import DEFAULT_STRICT
class Coll... | 1,998 | 34.696429 | 97 | py |
sarpy | sarpy-master/sarpy/io/received/crsd1_elements/PVP.py | """
The Per Vector parameters (PVP) definition.
"""
__classification__ = "UNCLASSIFIED"
__author__ = ("Thomas McCullough", "Michael Stewart, Valkyrie")
from typing import Union, List
import numpy
from sarpy.io.xml.base import Serializable
from sarpy.io.xml.descriptors import IntegerDescriptor, SerializableDescripto... | 17,069 | 34.636743 | 114 | py |
sarpy | sarpy-master/sarpy/io/received/crsd1_elements/Channel.py | """
The Channel definition.
"""
__classification__ = "UNCLASSIFIED"
__author__ = ("Thomas McCullough", "Michael Stewart, Valkyrie")
from typing import Union, List
from sarpy.io.xml.base import Serializable, ParametersCollection
from sarpy.io.xml.descriptors import StringDescriptor, StringEnumDescriptor, \
Intege... | 14,820 | 38.734584 | 111 | py |
sarpy | sarpy-master/sarpy/io/received/crsd1_elements/__init__.py | """
**This sub-package is a work in progress to encapsulate pythonic object-oriented CRSD structure 1.0.0
"""
__classification__ = "UNCLASSIFIED"
| 147 | 23.666667 | 101 | py |
sarpy | sarpy-master/sarpy/io/received/crsd1_elements/ReferenceGeometry.py | """
The reference geometry parameters definition.
"""
__classification__ = "UNCLASSIFIED"
__author__ = ("Thomas McCullough", "Michael Stewart, Valkyrie")
import numpy
from sarpy.io.xml.base import Serializable, parse_serializable
from sarpy.io.xml.descriptors import FloatDescriptor, StringEnumDescriptor, \
Seri... | 7,442 | 35.846535 | 98 | py |
sarpy | sarpy-master/sarpy/io/received/crsd1_elements/Global.py | """
The Global type definition.
"""
__classification__ = "UNCLASSIFIED"
__author__ = ("Thomas McCullough", "Michael Stewart, Valkyrie")
from typing import Union
import numpy
from sarpy.io.xml.base import Serializable, Arrayable
from sarpy.io.xml.descriptors import FloatDescriptor, DateTimeDescriptor, \
Serializ... | 6,689 | 39.05988 | 108 | py |
sarpy | sarpy-master/sarpy/io/received/crsd_schema/__init__.py | """
This package contains the CRSD schema
"""
__classification__ = 'UNCLASSIFIED'
__author__ = "Thomas McCullough"
import os
import re
from typing import List, Dict, Tuple, Union
_CRSD_DEFAULT_TUPLE = (1, 0, 0)
_the_directory = os.path.split(__file__)[0]
urn_mapping = {
'urn:CRSD:1.0.0': {
'version': ... | 3,244 | 21.692308 | 88 | py |
sarpy | sarpy-master/sarpy/io/general/base.py | """
The basic definitions for file-like reading and writing. This is generally
centered on image-like file efforts, and array-like interaction with image data.
This module completely revamped in version 1.3.0 for data segment usage.
"""
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
import os
i... | 28,939 | 31.923777 | 110 | py |
sarpy | sarpy-master/sarpy/io/general/tiff.py | """
Module providing api consistent with other file types for reading tiff files.
"""
__classification__ = "UNCLASSIFIED"
__author__ = ("Thomas McCullough", "Daniel Haverporth")
# It was the original intent to use gdal for the bulk of tiff reading
# Unfortunately, the necessary sarpy functionality can only be obtaine... | 19,566 | 33.08885 | 123 | py |
sarpy | sarpy-master/sarpy/io/general/slice_parsing.py | """
Utilities for parsing slice input.
"""
__classification__ = "UNCLASSIFIED"
__author__ = 'Thomas McCullough'
from typing import Union, Tuple, Sequence
import numpy
def validate_slice_int(the_int: int, bound: int, include: bool = True) -> int:
"""
Ensure that the given integer makes sense as a slice entry... | 7,058 | 32.140845 | 120 | py |
sarpy | sarpy-master/sarpy/io/general/utils.py | """
Common functionality for converting metadata
"""
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
from typing import Union, Tuple, BinaryIO, Any, Optional
import hashlib
import os
import warnings
import struct
import mmap
import numpy
try:
import h5py
except ImportError:
h5py = Non... | 9,121 | 25.062857 | 106 | py |
sarpy | sarpy-master/sarpy/io/general/nitf.py | """
Module laying out basic functionality for reading and writing NITF files.
Updated extensively in version 1.3.0.
"""
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
import logging
import os
from typing import Union, List, Tuple, BinaryIO, Sequence, Optional
from tempfile import mkstemp
from... | 165,241 | 38.541039 | 120 | py |
sarpy | sarpy-master/sarpy/io/general/format_function.py | """
Stateful functions for use in format operations for data segments.
This module introduced in version 1.3.0.
"""
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
import logging
from typing import Union, Tuple, Optional
import numpy
from sarpy.io.general.slice_parsing import get_subscript_re... | 41,501 | 38.45057 | 113 | py |
sarpy | sarpy-master/sarpy/io/general/data_segment.py | """
The object definitions for reading and writing data in single conceptual units
using an interface based on slicing definitions and numpy arrays with formatting
operations.
This module introduced in version 1.3.0.
"""
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
import logging
import os
fr... | 89,754 | 34.773216 | 120 | py |
sarpy | sarpy-master/sarpy/io/general/converter.py | """
This module provides utilities for attempting to open other image files not
opened by the sicd, sidd, cphd, or crsd reader collections.
"""
import os
from typing import Callable
from sarpy.io.general.base import SarpyIOError, BaseReader, check_for_openers
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas M... | 2,051 | 22.318182 | 85 | py |
sarpy | sarpy-master/sarpy/io/general/__init__.py | """
This package mostly centered on base implementations for reader architecture.
"""
__classification__ = 'UNCLASSIFIED'
def open(*args, **kwargs):
from .converter import open_general
return open_general(*args, **kwargs)
| 233 | 20.272727 | 77 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/base.py | """
Base NITF Header functionality definition.
"""
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
import logging
from weakref import WeakKeyDictionary
from typing import Union, List, Tuple
from collections import OrderedDict
import struct
import numpy
from sarpy.compliance import bytes_to_stri... | 38,243 | 30.143322 | 119 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/image.py | """
The image subheader definitions.
"""
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
import logging
import struct
from collections import OrderedDict
from typing import Union
import numpy
from .base import NITFElement, NITFLoop, UserHeaderType, _IntegerDescriptor,\
_StringDescriptor, _... | 57,993 | 44.237129 | 120 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/symbol.py | """
The symbol header element definition - only applies to NITF 2.0
"""
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
import struct
import numpy
from .base import NITFElement, UserHeaderType, _IntegerDescriptor,\
_StringDescriptor, _StringEnumDescriptor, _NITFElementDescriptor
from .secur... | 4,818 | 34.696296 | 106 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/nitf_head.py | """
The main NITF header definitions.
"""
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
import logging
from .base import NITFElement, UserHeaderType, _IntegerDescriptor,\
_StringDescriptor, _StringEnumDescriptor, _NITFElementDescriptor, _RawDescriptor, \
_ItemArrayHeaders
from .securit... | 14,973 | 38.718833 | 108 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/graphics.py | """
The graphics header element definition.
"""
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
from .base import NITFElement, UserHeaderType, _IntegerDescriptor,\
_StringDescriptor, _StringEnumDescriptor, _NITFElementDescriptor
from .security import NITFSecurityTags
class GraphicsSegmentHe... | 5,334 | 55.755319 | 117 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/text.py | """
The text extension subheader definitions.
"""
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
from .base import NITFElement, UserHeaderType, _IntegerDescriptor,\
_StringDescriptor, _StringEnumDescriptor, _NITFElementDescriptor
from .security import NITFSecurityTags, NITFSecurityTags0
#... | 5,243 | 45.821429 | 98 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/security.py | """
The security tags definitions, which are used in each NITF subheader element.
"""
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
from .base import NITFElement, _StringDescriptor, _StringEnumDescriptor, _parse_str
#########
# NITF 2.1 version
class NITFSecurityTags(NITFElement):
"""
... | 10,274 | 53.078947 | 116 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/label.py | """
The label extension subheader definitions - applies only to NITF version 2.0
"""
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
from .base import NITFElement, UserHeaderType, _IntegerDescriptor, _RawDescriptor, \
_StringDescriptor, _StringEnumDescriptor, _NITFElementDescriptor
from .secu... | 2,056 | 40.979592 | 88 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/des.py | """
The data extension header element definition.
"""
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
import logging
from typing import Union
from .base import BaseNITFElement, NITFElement, Unstructured, _IntegerDescriptor,\
_StringDescriptor, _StringEnumDescriptor, _NITFElementDescriptor, ... | 19,830 | 38.741483 | 102 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/__init__.py |
__classification__ = "UNCLASSIFIED"
| 37 | 11.666667 | 35 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/res.py | """
The reserved extension subheader definitions.
"""
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
from .base import BaseNITFElement, NITFElement, Unstructured, _IntegerDescriptor,\
_StringDescriptor, _StringEnumDescriptor, _NITFElementDescriptor, \
_parse_nitf_element
from .security ... | 5,073 | 33.517007 | 105 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/tres/tre_elements.py | """
Module contained elements for defining TREs - really intended as read only objects.
"""
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
import logging
from collections import OrderedDict
from typing import Union, List
from ..base import TRE
logger = logging.getLogger(__name__)
def _parse_... | 9,519 | 27 | 111 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/tres/registration.py | """
Module for maintaining the TRE registry
"""
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas Mccullough"
import logging
import pkgutil
from importlib import import_module
import inspect
from sarpy.compliance import bytes_to_string
logger = logging.getLogger(__name__)
###############
# module variables... | 3,710 | 27.328244 | 99 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/tres/__init__.py |
__classification__ = "UNCLASSIFIED"
| 37 | 11.666667 | 35 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/tres/unclass/SNSRA.py |
from ..tre_elements import TREExtension, TREElement
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
class SENBAND1(TREElement):
def __init__(self, value):
super(SENBAND1, self).__init__()
self.add_field('SENBAND', 's', 10, value)
self.add_field('SEN_BANDWL', 's', 3, ... | 3,042 | 39.573333 | 72 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/tres/unclass/ACFTA.py |
from ..tre_elements import TREExtension, TREElement
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
class ACFTA_132Type(TREElement):
def __init__(self, value):
super(ACFTA_132Type, self).__init__()
self.add_field('AC_MSN_ID', 's', 10, value)
self.add_field('SCTYPE', ... | 5,101 | 35.442857 | 94 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/tres/unclass/GEOLOB.py |
from ..tre_elements import TREExtension, TREElement
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
class GEOLOBType(TREElement):
def __init__(self, value):
super(GEOLOBType, self).__init__()
self.add_field('ARV', 's', 9, value)
self.add_field('BRV', 's', 9, value)
... | 495 | 23.8 | 51 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/tres/unclass/HISTOA.py |
from ..tre_elements import TREExtension, TREElement
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
class IPCOM(TREElement):
def __init__(self, value):
super(IPCOM, self).__init__()
self.add_field('IPCOM', 's', 80, value)
class EVENT(TREElement):
def __init__(self, val... | 2,630 | 36.585714 | 59 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/tres/unclass/RSMPIA.py |
from ..tre_elements import TREExtension, TREElement
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
class RSMPIAType(TREElement):
def __init__(self, value):
super(RSMPIAType, self).__init__()
self.add_field('IID', 's', 80, value)
self.add_field('EDITION', 's', 40, va... | 1,555 | 35.186047 | 51 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/tres/unclass/PIAPRC.py |
from ..tre_elements import TREExtension, TREElement
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
class ST(TREElement):
def __init__(self, value):
super(ST, self).__init__()
self.add_field('SECTITLE', 's', 40, value)
self.add_field('PPNUM', 's', 5, value)
s... | 2,074 | 29.514706 | 51 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/tres/unclass/BNDPLB.py |
from ..tre_elements import TREExtension, TREElement
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
class PT(TREElement):
def __init__(self, value):
super(PT, self).__init__()
self.add_field('LON', 's', 15, value)
self.add_field('LAT', 's', 15, value)
class BNDPLBT... | 596 | 22.88 | 52 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/tres/unclass/SNSPSB.py |
from ..tre_elements import TREExtension, TREElement
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
class PT(TREElement):
def __init__(self, value):
super(PT, self).__init__()
self.add_field('LON', 's', 15, value)
self.add_field('LAT', 's', 15, value)
class BP(TREE... | 3,271 | 33.808511 | 55 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/tres/unclass/SENSRA.py |
from ..tre_elements import TREExtension, TREElement
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
class SENSRAType(TREElement):
def __init__(self, value):
super(SENSRAType, self).__init__()
self.add_field('REFROW', 's', 8, value)
self.add_field('REFCOL', 's', 8, va... | 1,502 | 36.575 | 51 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/tres/unclass/PIAEVA.py |
from ..tre_elements import TREExtension, TREElement
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
class PIAEVAType(TREElement):
def __init__(self, value):
super(PIAEVAType, self).__init__()
self.add_field('EVENTNAME', 's', 38, value)
self.add_field('EVENTTYPE', 's'... | 416 | 22.166667 | 51 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/tres/unclass/ACFTB.py |
from ..tre_elements import TREExtension, TREElement
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
class ACFTBType(TREElement):
def __init__(self, value):
super(ACFTBType, self).__init__()
self.add_field('AC_MSN_ID', 's', 20, value)
self.add_field('AC_TAIL_NO', 's',... | 1,732 | 38.386364 | 58 | py |
sarpy | sarpy-master/sarpy/io/general/nitf_elements/tres/unclass/SECTGA.py |
from ..tre_elements import TREExtension, TREElement
__classification__ = "UNCLASSIFIED"
__author__ = "Thomas McCullough"
class SECTGAType(TREElement):
def __init__(self, value):
super(SECTGAType, self).__init__()
self.add_field('SEC_ID', 's', 12, value)
self.add_field('SEC_BE', 's', 15, ... | 461 | 23.315789 | 51 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.