Giter VIP home page Giter VIP logo

Comments (8)

asylvest avatar asylvest commented on June 12, 2024

Matt - that is correct... when we put in the CPHD bindings, at the time we only needed reading support. Do you have a current need for writing support? If so, let me know the urgency and timeframe and we'll try to prioritize it appropriately on our end.

from six-library.

darkstar007 avatar darkstar007 commented on June 12, 2024

Hi,

I was wanting to write a simple simulator to test the processing chain of our new LF SAR system. So it would be really good if it could be done in the next 6 weeks or so.

Thanks,

Matt

from six-library.

asylvest avatar asylvest commented on June 12, 2024

Thanks for the timeframe Matt. We'll see what we can do and will keep you posted...

from six-library.

asylvest avatar asylvest commented on June 12, 2024

@darkstar007 - see @JonathanMeans's updates in #153. This has been merged into master... let us know if it meets your needs.

from six-library.

darkstar007 avatar darkstar007 commented on June 12, 2024

OK, cool. I'll pull and check over the weekend.

from six-library.

darkstar007 avatar darkstar007 commented on June 12, 2024

Hi.

I've spent some time on this in the last week or so, and have to say its been a hugely frustrating experience. This is mainly due to the lowlevel nature of the API, the lack of documentation and the poor error reporting.

I've yet to actually write out a CPHD file. My current issue is:

Traceback (most recent call last):
  File "./sim.py", line 255, in <module>
    writer.writeCPHD(sys.argv[1], vdata, coda_types.RowColSizeT(vdata.shape[0], vdata.shape[1]), vbm.toBuffer(0))
  File "/usr/local/lib/python2.7/dist-packages/pysix/cphd.py", line 2047, in write
    self.write(pathname)
  File "/usr/local/lib/python2.7/dist-packages/pysix/cphd.py", line 2009, in write
    return _cphd.CPHDWriter_write(self, *args)
RuntimeError: Attempted use of uninitialized double value

Which suggests I'm missing a variable in a metadata class, but no hints as to which one. So I now need to go through the spec and see what I've missed off.

Can I suggest changing the CPHDWriter.writeCPHD function to be something along the lines of:

def write(self, pathname, vph_data, vbm, channel):
   """
    Function to write out video phase history data to a given filename.
        pathname - the filename (a string) to write the data to
        vph_data - a 2D numpy array (numpy.complex64 type) of size [npulse, nsamps]
        vbm - a pysix.cphd.VBM() like object that describes this data
        channel - the channel number this VPH data is associated with

   Nothing is returned by this function.

   The following exceptions are raised:
           ???
   """
    vphPointer, _ = vph_data.__array_interface__['data']
    
    vbm_raw = vbm.toBuffer(channel)
    vbmPointer, _ = vbm_raw.__array_interface__['data']
    
    if data.dtype != numpy.dtype('complex64'):
        raise TypeError('Python CPHDWriter only supports complex float data')

    # Should we now check that the VPH data we have supplied is the same size that
    # we said it was going to be when we created the CPHDWriter? Similarly for
    # vbm - does it match the metadata and vph_data?

    self.addImageImpl(vphPointer,
                      coda_types.RowColSizeT(vph_data.shape[0], vph_data.shape[1]),
                      vbmPointer)
    self.write(pathname)

Obviously I don't know if that's correct, as I've not managed to write a file out yet!
(Also, why does the API talk about addImage - the data isn't an image).

Thanks,

Matt

from six-library.

JonathanMeans avatar JonathanMeans commented on June 12, 2024

@darkstar007 With #160, you should better be able to tell which fields the writer is complaining about.

from six-library.

darkstar007 avatar darkstar007 commented on June 12, 2024

Yep, the error message is much more helpful now. Thanks.

from six-library.

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.