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

Bad wrapping of gfoclt_c #4

Open
paulray opened this issue May 23, 2012 · 1 comment
Open

Bad wrapping of gfoclt_c #4

paulray opened this issue May 23, 2012 · 1 comment

Comments

@paulray
Copy link

paulray commented May 23, 2012

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.
@michaelaye
Copy link
Collaborator

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).

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

2 participants