Giter VIP home page Giter VIP logo

Comments (1)

thomasmccullough avatar thomasmccullough commented on June 4, 2024

Hi, thanks for your message. Just to be clear, how old was the previous version that you were using? I refactored almost everything before about Mar 2020, to make it all more robust. I tried to do it in a way that was transparent to "standard" usage, but there are substantial differences.

To directly answer your question - the various components for the sicd object use the descriptor pattern for all the attributes. Descriptors are sort of indirect properties, and they preclude a few things. You definitely can't use the copy module to make a copy (there is a copy() method of the sicd object). It wouldn't surprise me that pickling doesn't work, and that may be the reason why.

I would suggest that you don't use pickle, which is kind of fragile anyways - you can't use it across different Python versions, for instance. I'd suggest serializing to either json (using the to_dict() method of the sicd object) or xml (using the to_xml_bytes() method of the sicd object).

To reconstruct from json, you use the from_dict class method. Reconstructing from xml is a bit more annoying, because of xml junk - see here https://github.com/ngageoint/sarpy/blob/master/sarpy/io/complex/sicd.py#L158. You parse the xml to etree structure using a method, then pass the etree node info to a from_node class method.

There is documentation on readthedocs - see here for the main sicd object.

Using xml is probably generally preferable - it includes the urn/version information and is generally used, whereas the json is a sarpy only serialization of the SICD structure. The SICD standard uses xml particular structures (like xml attributes), so it's not really xml/json agnostic.

I'll verify that pickling doesn't work, although your code fairly clearly shows that it doesn't. After I verify this, I'll insert a warning in the README - about copy not working either. Please let me know if you need anything else. For questions, feel free to email me at [email protected] or [email protected].

from sarpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.