Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIDD 2.0 Compression Schema Reading Bug #578

Open
ktopolov opened this issue Jan 18, 2025 · 0 comments
Open

SIDD 2.0 Compression Schema Reading Bug #578

ktopolov opened this issue Jan 18, 2025 · 0 comments

Comments

@ktopolov
Copy link

It seems there might be a bug in XML metadata reading for SIDD2.0+ for the "Compression" field. It seems from the specification that this is the expected formatting:

    <Compression>
        <J2K>
            <Original>
                <NumWaveletLevels>6</NumWaveletLevels>
                <NumBands>1</NumBands>
                <LayerInfo numLayers="2">
                    <Layer index="1">
                        <Bitrate>2.00000000000000000E01</Bitrate>
                    </Layer>
                    <Layer index="2">
                        <Bitrate>2.00000000000000000E01</Bitrate>
                    </Layer>
                </LayerInfo>
            </Original>
        </J2K>
    </Compression>

and C++ Six library writes it this way, but sarpy fails to read with the error:

Attribute Custom of class FilterKernelType received <Element '{urn:SIDD:2.0.0}Custom' at 0x7f101f671b20>,
	but values ARE REQUIRED to be one of ('GENERAL', 'FILTER BANK')
Failed converting <Element '{urn:SIDD:2.0.0}Original' at 0x7f101f6997b0> of type <class 'xml.etree.ElementTree.Element'> to Serializable type <class 'sarpy.io.product.sidd2_elements.Compression.J2KSubtype'>
	for field Original of class J2KType with exception <class 'KeyError'> - 'size'.
	Setting value to None, which may be against the standard.

It seems that sarpy is instead expecting numLayers to instead be size, or it may use the wrong "descriptor" type altogether - it appears to simply want an array of bitrates rather than these individual indexed layers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant