PySPICE icon indicating copy to clipboard operation
PySPICE copied to clipboard

Bad wrapping of gfoclt_c

Open paulray opened this issue 13 years ago • 1 comments

The wrapper code for gfoclt_c is broken. The argument cnfine is actually supposed to be BOTH an input and an output. The wrapper considers it only an input and thus when the routine is called it tries to read a null pointer and segfaults.

I don't know if PySPICE has a preferred method for handling arguments that are both Input and Output.

The help text correctly lists it as I-O:

In [106]: spice.gfoclt?

Type:             builtin_function_or_method
Base Class:       <type 'builtin_function_or_method'>
String Form:   <built-in function gfoclt>
Namespace:        Interactive
Docstring:
    -Abstract

       Determine time intervals when an observer sees one target
       occulted by, or in transit across, another.

    -Brief_I/O

       VARIABLE        I/O  DESCRIPTION
       --------------- ---  -------------------------------------------------
       SPICE_GF_CNVTOL  P   Convergence tolerance.
       occtyp           I   Type of occultation.
       front            I   Name of body occulting the other.
       fshape           I   Type of shape model used for front body.
       fframe           I   Body-fixed, body-centered frame for front body.
       back             I   Name of body occulted by the other.
       bshape           I   Type of shape model used for back body.
       bframe           I   Body-fixed, body-centered frame for back body.
       abcorr           I   Aberration correction flag.
       obsrvr           I   Name of the observing body.
       step             I   Step size in seconds for finding occultation
                            events.
       cnfine          I-O  SPICE window to which the search is restricted.
       result           O   SPICE window containing results.

paulray avatar May 23 '12 20:05 paulray

no, indeed it hasn't, the original design had a strict separation between in and output, because Roberto wanted Python-style return values, so to decide want to have as function parameter and what to return he had to separate. thanks for the bug report. Will need to think a bit about how to solve this. It might be cleaned up together for the functions that have unallocated array sizes as output. Those as well are not implemented as of yet (apart from my hardcoding hack for getfov).

michaelaye avatar May 25 '12 12:05 michaelaye