idx
int64
0
63k
question
stringlengths
61
4.03k
target
stringlengths
6
1.23k
58,800
def mequg ( m1 , nr , nc ) : m1 = stypes . toDoubleMatrix ( m1 ) mout = stypes . emptyDoubleMatrix ( x = nc , y = nr ) nc = ctypes . c_int ( nc ) nr = ctypes . c_int ( nr ) libspice . mequg_c ( m1 , nc , nr , mout ) return stypes . cMatrixToNumpy ( mout )
Set one double precision matrix of arbitrary size equal to another .
58,801
def mtxm ( m1 , m2 ) : m1 = stypes . toDoubleMatrix ( m1 ) m2 = stypes . toDoubleMatrix ( m2 ) mout = stypes . emptyDoubleMatrix ( ) libspice . mtxm_c ( m1 , m2 , mout ) return stypes . cMatrixToNumpy ( mout )
Multiply the transpose of a 3x3 matrix and a 3x3 matrix .
58,802
def mtxmg ( m1 , m2 , ncol1 , nr1r2 , ncol2 ) : m1 = stypes . toDoubleMatrix ( m1 ) m2 = stypes . toDoubleMatrix ( m2 ) mout = stypes . emptyDoubleMatrix ( x = ncol2 , y = ncol1 ) ncol1 = ctypes . c_int ( ncol1 ) nr1r2 = ctypes . c_int ( nr1r2 ) ncol2 = ctypes . c_int ( ncol2 ) libspice . mtxmg_c ( m1 , m2 , ncol1 , nr1r2 , ncol2 , mout ) return stypes . cMatrixToNumpy ( mout )
Multiply the transpose of a matrix with another matrix both of arbitrary size .
58,803
def mtxv ( m1 , vin ) : m1 = stypes . toDoubleMatrix ( m1 ) vin = stypes . toDoubleVector ( vin ) vout = stypes . emptyDoubleVector ( 3 ) libspice . mtxv_c ( m1 , vin , vout ) return stypes . cVectorToPython ( vout )
Multiplies the transpose of a 3x3 matrix on the left with a vector on the right .
58,804
def mtxvg ( m1 , v2 , ncol1 , nr1r2 ) : m1 = stypes . toDoubleMatrix ( m1 ) v2 = stypes . toDoubleVector ( v2 ) ncol1 = ctypes . c_int ( ncol1 ) nr1r2 = ctypes . c_int ( nr1r2 ) vout = stypes . emptyDoubleVector ( ncol1 . value ) libspice . mtxvg_c ( m1 , v2 , ncol1 , nr1r2 , vout ) return stypes . cVectorToPython ( vout )
Multiply the transpose of a matrix and a vector of arbitrary size .
58,805
def mxm ( m1 , m2 ) : m1 = stypes . toDoubleMatrix ( m1 ) m2 = stypes . toDoubleMatrix ( m2 ) mout = stypes . emptyDoubleMatrix ( ) libspice . mxm_c ( m1 , m2 , mout ) return stypes . cMatrixToNumpy ( mout )
Multiply two 3x3 matrices .
58,806
def mxmg ( m1 , m2 , nrow1 , ncol1 , ncol2 ) : m1 = stypes . toDoubleMatrix ( m1 ) m2 = stypes . toDoubleMatrix ( m2 ) mout = stypes . emptyDoubleMatrix ( x = ncol2 , y = nrow1 ) nrow1 = ctypes . c_int ( nrow1 ) ncol1 = ctypes . c_int ( ncol1 ) ncol2 = ctypes . c_int ( ncol2 ) libspice . mxmg_c ( m1 , m2 , nrow1 , ncol1 , ncol2 , mout ) return stypes . cMatrixToNumpy ( mout )
Multiply two double precision matrices of arbitrary size .
58,807
def mxmt ( m1 , m2 ) : m1 = stypes . toDoubleMatrix ( m1 ) m2 = stypes . toDoubleMatrix ( m2 ) mout = stypes . emptyDoubleMatrix ( ) libspice . mxmt_c ( m1 , m2 , mout ) return stypes . cMatrixToNumpy ( mout )
Multiply a 3x3 matrix and the transpose of another 3x3 matrix .
58,808
def mxmtg ( m1 , m2 , nrow1 , nc1c2 , nrow2 ) : m1 = stypes . toDoubleMatrix ( m1 ) m2 = stypes . toDoubleMatrix ( m2 ) mout = stypes . emptyDoubleMatrix ( x = nrow2 , y = nrow1 ) nrow1 = ctypes . c_int ( nrow1 ) nc1c2 = ctypes . c_int ( nc1c2 ) nrow2 = ctypes . c_int ( nrow2 ) libspice . mxmtg_c ( m1 , m2 , nrow1 , nc1c2 , nrow2 , mout ) return stypes . cMatrixToNumpy ( mout )
Multiply a matrix and the transpose of a matrix both of arbitrary size .
58,809
def mxv ( m1 , vin ) : m1 = stypes . toDoubleMatrix ( m1 ) vin = stypes . toDoubleVector ( vin ) vout = stypes . emptyDoubleVector ( 3 ) libspice . mxv_c ( m1 , vin , vout ) return stypes . cVectorToPython ( vout )
Multiply a 3x3 double precision matrix with a 3 - dimensional double precision vector .
58,810
def mxvg ( m1 , v2 , nrow1 , nc1r2 ) : m1 = stypes . toDoubleMatrix ( m1 ) v2 = stypes . toDoubleVector ( v2 ) nrow1 = ctypes . c_int ( nrow1 ) nc1r2 = ctypes . c_int ( nc1r2 ) vout = stypes . emptyDoubleVector ( nrow1 . value ) libspice . mxvg_c ( m1 , v2 , nrow1 , nc1r2 , vout ) return stypes . cVectorToPython ( vout )
Multiply a matrix and a vector of arbitrary size .
58,811
def namfrm ( frname ) : frname = stypes . stringToCharP ( frname ) frcode = ctypes . c_int ( ) libspice . namfrm_c ( frname , ctypes . byref ( frcode ) ) return frcode . value
Look up the frame ID code associated with a string .
58,812
def ncpos ( string , chars , start ) : string = stypes . stringToCharP ( string ) chars = stypes . stringToCharP ( chars ) start = ctypes . c_int ( start ) return libspice . ncpos_c ( string , chars , start )
Find the first occurrence in a string of a character NOT belonging to a collection of characters starting at a specified location searching forward .
58,813
def ncposr ( string , chars , start ) : string = stypes . stringToCharP ( string ) chars = stypes . stringToCharP ( chars ) start = ctypes . c_int ( start ) return libspice . ncposr_c ( string , chars , start )
Find the first occurrence in a string of a character NOT belonging to a collection of characters starting at a specified location searching in reverse .
58,814
def nearpt ( positn , a , b , c ) : positn = stypes . toDoubleVector ( positn ) a = ctypes . c_double ( a ) b = ctypes . c_double ( b ) c = ctypes . c_double ( c ) npoint = stypes . emptyDoubleVector ( 3 ) alt = ctypes . c_double ( ) libspice . nearpt_c ( positn , a , b , c , npoint , ctypes . byref ( alt ) ) return stypes . cVectorToPython ( npoint ) , alt . value
locates the point on the surface of an ellipsoid that is nearest to a specified position . It also returns the altitude of the position above the ellipsoid .
58,815
def npedln ( a , b , c , linept , linedr ) : a = ctypes . c_double ( a ) b = ctypes . c_double ( b ) c = ctypes . c_double ( c ) linept = stypes . toDoubleVector ( linept ) linedr = stypes . toDoubleVector ( linedr ) pnear = stypes . emptyDoubleVector ( 3 ) dist = ctypes . c_double ( ) libspice . npedln_c ( a , b , c , linept , linedr , pnear , ctypes . byref ( dist ) ) return stypes . cVectorToPython ( pnear ) , dist . value
Find nearest point on a triaxial ellipsoid to a specified line and the distance from the ellipsoid to the line .
58,816
def nplnpt ( linpt , lindir , point ) : linpt = stypes . toDoubleVector ( linpt ) lindir = stypes . toDoubleVector ( lindir ) point = stypes . toDoubleVector ( point ) pnear = stypes . emptyDoubleVector ( 3 ) dist = ctypes . c_double ( ) libspice . nplnpt_c ( linpt , lindir , point , pnear , ctypes . byref ( dist ) ) return stypes . cVectorToPython ( pnear ) , dist . value
Find the nearest point on a line to a specified point and find the distance between the two points .
58,817
def nvc2pl ( normal , constant ) : plane = stypes . Plane ( ) normal = stypes . toDoubleVector ( normal ) constant = ctypes . c_double ( constant ) libspice . nvc2pl_c ( normal , constant , ctypes . byref ( plane ) ) return plane
Make a plane from a normal vector and a constant .
58,818
def nvp2pl ( normal , point ) : normal = stypes . toDoubleVector ( normal ) point = stypes . toDoubleVector ( point ) plane = stypes . Plane ( ) libspice . nvp2pl_c ( normal , point , ctypes . byref ( plane ) ) return plane
Make a plane from a normal vector and a point .
58,819
def ordc ( item , inset ) : assert isinstance ( inset , stypes . SpiceCell ) assert inset . is_char ( ) assert isinstance ( item , str ) item = stypes . stringToCharP ( item ) return libspice . ordc_c ( item , ctypes . byref ( inset ) )
The function returns the ordinal position of any given item in a character set . If the item does not appear in the set the function returns - 1 .
58,820
def ordd ( item , inset ) : assert isinstance ( inset , stypes . SpiceCell ) assert inset . is_double ( ) item = ctypes . c_double ( item ) return libspice . ordd_c ( item , ctypes . byref ( inset ) )
The function returns the ordinal position of any given item in a double precision set . If the item does not appear in the set the function returns - 1 .
58,821
def ordi ( item , inset ) : assert isinstance ( inset , stypes . SpiceCell ) assert inset . is_int ( ) assert isinstance ( item , int ) item = ctypes . c_int ( item ) return libspice . ordi_c ( item , ctypes . byref ( inset ) )
The function returns the ordinal position of any given item in an integer set . If the item does not appear in the set the function returns - 1 .
58,822
def orderc ( array , ndim = None ) : if ndim is None : ndim = ctypes . c_int ( len ( array ) ) else : ndim = ctypes . c_int ( ndim ) lenvals = ctypes . c_int ( len ( max ( array , key = len ) ) + 1 ) iorder = stypes . emptyIntVector ( ndim ) array = stypes . listToCharArray ( array , lenvals , ndim ) libspice . orderc_c ( lenvals , array , ndim , iorder ) return stypes . cVectorToPython ( iorder )
Determine the order of elements in an array of character strings .
58,823
def orderd ( array , ndim = None ) : if ndim is None : ndim = ctypes . c_int ( len ( array ) ) else : ndim = ctypes . c_int ( ndim ) array = stypes . toDoubleVector ( array ) iorder = stypes . emptyIntVector ( ndim ) libspice . orderd_c ( array , ndim , iorder ) return stypes . cVectorToPython ( iorder )
Determine the order of elements in a double precision array .
58,824
def orderi ( array , ndim = None ) : if ndim is None : ndim = ctypes . c_int ( len ( array ) ) else : ndim = ctypes . c_int ( ndim ) array = stypes . toIntVector ( array ) iorder = stypes . emptyIntVector ( ndim ) libspice . orderi_c ( array , ndim , iorder ) return stypes . cVectorToPython ( iorder )
Determine the order of elements in an integer array .
58,825
def pckcov ( pck , idcode , cover ) : pck = stypes . stringToCharP ( pck ) idcode = ctypes . c_int ( idcode ) assert isinstance ( cover , stypes . SpiceCell ) assert cover . dtype == 1 libspice . pckcov_c ( pck , idcode , ctypes . byref ( cover ) )
Find the coverage window for a specified reference frame in a specified binary PCK file .
58,826
def pckfrm ( pck , ids ) : pck = stypes . stringToCharP ( pck ) assert isinstance ( ids , stypes . SpiceCell ) assert ids . dtype == 2 libspice . pckfrm_c ( pck , ctypes . byref ( ids ) )
Find the set of reference frame class ID codes of all frames in a specified binary PCK file .
58,827
def pcklof ( filename ) : filename = stypes . stringToCharP ( filename ) handle = ctypes . c_int ( ) libspice . pcklof_c ( filename , ctypes . byref ( handle ) ) return handle . value
Load a binary PCK file for use by the readers . Return the handle of the loaded file which is used by other PCK routines to refer to the file .
58,828
def pcpool ( name , cvals ) : name = stypes . stringToCharP ( name ) lenvals = ctypes . c_int ( len ( max ( cvals , key = len ) ) + 1 ) n = ctypes . c_int ( len ( cvals ) ) cvals = stypes . listToCharArray ( cvals , lenvals , n ) libspice . pcpool_c ( name , n , lenvals , cvals )
This entry point provides toolkit programmers a method for programmatically inserting character data into the kernel pool .
58,829
def pdpool ( name , dvals ) : name = stypes . stringToCharP ( name ) n = ctypes . c_int ( len ( dvals ) ) dvals = stypes . toDoubleVector ( dvals ) libspice . pdpool_c ( name , n , dvals )
This entry point provides toolkit programmers a method for programmatically inserting double precision data into the kernel pool .
58,830
def pgrrec ( body , lon , lat , alt , re , f ) : body = stypes . stringToCharP ( body ) lon = ctypes . c_double ( lon ) lat = ctypes . c_double ( lat ) alt = ctypes . c_double ( alt ) re = ctypes . c_double ( re ) f = ctypes . c_double ( f ) rectan = stypes . emptyDoubleVector ( 3 ) libspice . pgrrec_c ( body , lon , lat , alt , re , f , rectan ) return stypes . cVectorToPython ( rectan )
Convert planetographic coordinates to rectangular coordinates .
58,831
def phaseq ( et , target , illmn , obsrvr , abcorr ) : et = ctypes . c_double ( et ) target = stypes . stringToCharP ( target ) illmn = stypes . stringToCharP ( illmn ) obsrvr = stypes . stringToCharP ( obsrvr ) abcorr = stypes . stringToCharP ( abcorr ) return libspice . phaseq_c ( et , target , illmn , obsrvr , abcorr )
Compute the apparent phase angle for a target observer illuminator set of ephemeris objects .
58,832
def pipool ( name , ivals ) : name = stypes . stringToCharP ( name ) n = ctypes . c_int ( len ( ivals ) ) ivals = stypes . toIntVector ( ivals ) libspice . pipool_c ( name , n , ivals )
This entry point provides toolkit programmers a method for programmatically inserting integer data into the kernel pool .
58,833
def pjelpl ( elin , plane ) : assert ( isinstance ( elin , stypes . Ellipse ) ) assert ( isinstance ( plane , stypes . Plane ) ) elout = stypes . Ellipse ( ) libspice . pjelpl_c ( ctypes . byref ( elin ) , ctypes . byref ( plane ) , ctypes . byref ( elout ) ) return elout
Project an ellipse onto a plane orthogonally .
58,834
def pl2nvc ( plane ) : assert ( isinstance ( plane , stypes . Plane ) ) normal = stypes . emptyDoubleVector ( 3 ) constant = ctypes . c_double ( ) libspice . pl2nvc_c ( ctypes . byref ( plane ) , normal , ctypes . byref ( constant ) ) return stypes . cVectorToPython ( normal ) , constant . value
Return a unit normal vector and constant that define a specified plane .
58,835
def pl2nvp ( plane ) : assert ( isinstance ( plane , stypes . Plane ) ) normal = stypes . emptyDoubleVector ( 3 ) point = stypes . emptyDoubleVector ( 3 ) libspice . pl2nvp_c ( ctypes . byref ( plane ) , normal , point ) return stypes . cVectorToPython ( normal ) , stypes . cVectorToPython ( point )
Return a unit normal vector and point that define a specified plane .
58,836
def pl2psv ( plane ) : assert ( isinstance ( plane , stypes . Plane ) ) point = stypes . emptyDoubleVector ( 3 ) span1 = stypes . emptyDoubleVector ( 3 ) span2 = stypes . emptyDoubleVector ( 3 ) libspice . pl2psv_c ( ctypes . byref ( plane ) , point , span1 , span2 ) return stypes . cVectorToPython ( point ) , stypes . cVectorToPython ( span1 ) , stypes . cVectorToPython ( span2 )
Return a point and two orthogonal spanning vectors that generate a specified plane .
58,837
def pos ( string , substr , start ) : string = stypes . stringToCharP ( string ) substr = stypes . stringToCharP ( substr ) start = ctypes . c_int ( start ) return libspice . pos_c ( string , substr , start )
Find the first occurrence in a string of a substring starting at a specified location searching forward .
58,838
def posr ( string , substr , start ) : string = stypes . stringToCharP ( string ) substr = stypes . stringToCharP ( substr ) start = ctypes . c_int ( start ) return libspice . posr_c ( string , substr , start )
Find the first occurrence in a string of a substring starting at a specified location searching backward .
58,839
def prop2b ( gm , pvinit , dt ) : gm = ctypes . c_double ( gm ) pvinit = stypes . toDoubleVector ( pvinit ) dt = ctypes . c_double ( dt ) pvprop = stypes . emptyDoubleVector ( 6 ) libspice . prop2b_c ( gm , pvinit , dt , pvprop ) return stypes . cVectorToPython ( pvprop )
Given a central mass and the state of massless body at time t_0 this routine determines the state as predicted by a two - body force model at time t_0 + dt .
58,840
def prsdp ( string ) : string = stypes . stringToCharP ( string ) dpval = ctypes . c_double ( ) libspice . prsdp_c ( string , ctypes . byref ( dpval ) ) return dpval . value
Parse a string as a double precision number encapsulating error handling .
58,841
def prsint ( string ) : string = stypes . stringToCharP ( string ) intval = ctypes . c_int ( ) libspice . prsint_c ( string , ctypes . byref ( intval ) ) return intval . value
Parse a string as an integer encapsulating error handling .
58,842
def psv2pl ( point , span1 , span2 ) : point = stypes . toDoubleVector ( point ) span1 = stypes . toDoubleVector ( span1 ) span2 = stypes . toDoubleVector ( span2 ) plane = stypes . Plane ( ) libspice . psv2pl_c ( point , span1 , span2 , ctypes . byref ( plane ) ) return plane
Make a CSPICE plane from a point and two spanning vectors .
58,843
def pxform ( fromstr , tostr , et ) : et = ctypes . c_double ( et ) tostr = stypes . stringToCharP ( tostr ) fromstr = stypes . stringToCharP ( fromstr ) rotatematrix = stypes . emptyDoubleMatrix ( ) libspice . pxform_c ( fromstr , tostr , et , rotatematrix ) return stypes . cMatrixToNumpy ( rotatematrix )
Return the matrix that transforms position vectors from one specified frame to another at a specified epoch .
58,844
def pxfrm2 ( frame_from , frame_to , etfrom , etto ) : frame_from = stypes . stringToCharP ( frame_from ) frame_to = stypes . stringToCharP ( frame_to ) etfrom = ctypes . c_double ( etfrom ) etto = ctypes . c_double ( etto ) outmatrix = stypes . emptyDoubleMatrix ( ) libspice . pxfrm2_c ( frame_from , frame_to , etfrom , etto , outmatrix ) return stypes . cMatrixToNumpy ( outmatrix )
Return the 3x3 matrix that transforms position vectors from one specified frame at a specified epoch to another specified frame at another specified epoch .
58,845
def q2m ( q ) : q = stypes . toDoubleVector ( q ) mout = stypes . emptyDoubleMatrix ( ) libspice . q2m_c ( q , mout ) return stypes . cMatrixToNumpy ( mout )
Find the rotation matrix corresponding to a specified unit quaternion .
58,846
def qcktrc ( tracelen = _default_len_out ) : tracestr = stypes . stringToCharP ( tracelen ) tracelen = ctypes . c_int ( tracelen ) libspice . qcktrc_c ( tracelen , tracestr ) return stypes . toPythonString ( tracestr )
Return a string containing a traceback .
58,847
def qdq2av ( q , dq ) : q = stypes . toDoubleVector ( q ) dq = stypes . toDoubleVector ( dq ) vout = stypes . emptyDoubleVector ( 3 ) libspice . qdq2av_c ( q , dq , vout ) return stypes . cVectorToPython ( vout )
Derive angular velocity from a unit quaternion and its derivative with respect to time .
58,848
def qxq ( q1 , q2 ) : q1 = stypes . toDoubleVector ( q1 ) q2 = stypes . toDoubleVector ( q2 ) vout = stypes . emptyDoubleVector ( 4 ) libspice . qxq_c ( q1 , q2 , vout ) return stypes . cVectorToPython ( vout )
Multiply two quaternions .
58,849
def radrec ( inrange , re , dec ) : inrange = ctypes . c_double ( inrange ) re = ctypes . c_double ( re ) dec = ctypes . c_double ( dec ) rectan = stypes . emptyDoubleVector ( 3 ) libspice . radrec_c ( inrange , re , dec , rectan ) return stypes . cVectorToPython ( rectan )
Convert from range right ascension and declination to rectangular coordinates .
58,850
def rav2xf ( rot , av ) : rot = stypes . toDoubleMatrix ( rot ) av = stypes . toDoubleVector ( av ) xform = stypes . emptyDoubleMatrix ( x = 6 , y = 6 ) libspice . rav2xf_c ( rot , av , xform ) return stypes . cMatrixToNumpy ( xform )
This routine determines a state transformation matrix from a rotation matrix and the angular velocity of the rotation .
58,851
def raxisa ( matrix ) : matrix = stypes . toDoubleMatrix ( matrix ) axis = stypes . emptyDoubleVector ( 3 ) angle = ctypes . c_double ( ) libspice . raxisa_c ( matrix , axis , ctypes . byref ( angle ) ) return stypes . cVectorToPython ( axis ) , angle . value
Compute the axis of the rotation given by an input matrix and the angle of the rotation about that axis .
58,852
def rdtext ( file , lenout = _default_len_out ) : file = stypes . stringToCharP ( file ) line = stypes . stringToCharP ( lenout ) lenout = ctypes . c_int ( lenout ) eof = ctypes . c_int ( ) libspice . rdtext_c ( file , lenout , line , ctypes . byref ( eof ) ) return stypes . toPythonString ( line ) , bool ( eof . value )
Read the next line of text from a text file .
58,853
def reccyl ( rectan ) : rectan = stypes . toDoubleVector ( rectan ) radius = ctypes . c_double ( 0 ) lon = ctypes . c_double ( 0 ) z = ctypes . c_double ( 0 ) libspice . reccyl_c ( rectan , ctypes . byref ( radius ) , ctypes . byref ( lon ) , ctypes . byref ( z ) ) return radius . value , lon . value , z . value
Convert from rectangular to cylindrical coordinates .
58,854
def recgeo ( rectan , re , f ) : rectan = stypes . toDoubleVector ( rectan ) re = ctypes . c_double ( re ) f = ctypes . c_double ( f ) longitude = ctypes . c_double ( 0 ) latitude = ctypes . c_double ( 0 ) alt = ctypes . c_double ( 0 ) libspice . recgeo_c ( rectan , re , f , ctypes . byref ( longitude ) , ctypes . byref ( latitude ) , ctypes . byref ( alt ) ) return longitude . value , latitude . value , alt . value
Convert from rectangular coordinates to geodetic coordinates .
58,855
def reclat ( rectan ) : rectan = stypes . toDoubleVector ( rectan ) radius = ctypes . c_double ( 0 ) longitude = ctypes . c_double ( 0 ) latitude = ctypes . c_double ( 0 ) libspice . reclat_c ( rectan , ctypes . byref ( radius ) , ctypes . byref ( longitude ) , ctypes . byref ( latitude ) ) return radius . value , longitude . value , latitude . value
Convert from rectangular coordinates to latitudinal coordinates .
58,856
def recpgr ( body , rectan , re , f ) : body = stypes . stringToCharP ( body ) rectan = stypes . toDoubleVector ( rectan ) re = ctypes . c_double ( re ) f = ctypes . c_double ( f ) lon = ctypes . c_double ( ) lat = ctypes . c_double ( ) alt = ctypes . c_double ( ) libspice . recpgr_c ( body , rectan , re , f , ctypes . byref ( lon ) , ctypes . byref ( lat ) , ctypes . byref ( alt ) ) return lon . value , lat . value , alt . value
Convert rectangular coordinates to planetographic coordinates .
58,857
def recrad ( rectan ) : rectan = stypes . toDoubleVector ( rectan ) outrange = ctypes . c_double ( ) ra = ctypes . c_double ( ) dec = ctypes . c_double ( ) libspice . recrad_c ( rectan , ctypes . byref ( outrange ) , ctypes . byref ( ra ) , ctypes . byref ( dec ) ) return outrange . value , ra . value , dec . value
Convert rectangular coordinates to range right ascension and declination .
58,858
def recsph ( rectan ) : rectan = stypes . toDoubleVector ( rectan ) r = ctypes . c_double ( ) colat = ctypes . c_double ( ) lon = ctypes . c_double ( ) libspice . recsph_c ( rectan , ctypes . byref ( r ) , ctypes . byref ( colat ) , ctypes . byref ( lon ) ) return r . value , colat . value , lon . value
Convert from rectangular coordinates to spherical coordinates .
58,859
def removc ( item , inset ) : assert isinstance ( inset , stypes . SpiceCell ) assert inset . dtype == 0 item = stypes . stringToCharP ( item ) libspice . removc_c ( item , ctypes . byref ( inset ) )
Remove an item from a character set .
58,860
def removd ( item , inset ) : assert isinstance ( inset , stypes . SpiceCell ) assert inset . dtype == 1 item = ctypes . c_double ( item ) libspice . removd_c ( item , ctypes . byref ( inset ) )
Remove an item from a double precision set .
58,861
def removi ( item , inset ) : assert isinstance ( inset , stypes . SpiceCell ) assert inset . dtype == 2 item = ctypes . c_int ( item ) libspice . removi_c ( item , ctypes . byref ( inset ) )
Remove an item from an integer set .
58,862
def reordc ( iorder , ndim , lenvals , array ) : iorder = stypes . toIntVector ( iorder ) ndim = ctypes . c_int ( ndim ) lenvals = ctypes . c_int ( lenvals + 1 ) array = stypes . listToCharArray ( array , xLen = lenvals , yLen = ndim ) libspice . reordc_c ( iorder , ndim , lenvals , array ) return [ stypes . toPythonString ( x . value ) for x in array ]
Re - order the elements of an array of character strings according to a given order vector .
58,863
def reordd ( iorder , ndim , array ) : iorder = stypes . toIntVector ( iorder ) ndim = ctypes . c_int ( ndim ) array = stypes . toDoubleVector ( array ) libspice . reordd_c ( iorder , ndim , array ) return stypes . cVectorToPython ( array )
Re - order the elements of a double precision array according to a given order vector .
58,864
def reordi ( iorder , ndim , array ) : iorder = stypes . toIntVector ( iorder ) ndim = ctypes . c_int ( ndim ) array = stypes . toIntVector ( array ) libspice . reordi_c ( iorder , ndim , array ) return stypes . cVectorToPython ( array )
Re - order the elements of an integer array according to a given order vector .
58,865
def repmc ( instr , marker , value , lenout = None ) : if lenout is None : lenout = ctypes . c_int ( len ( instr ) + len ( value ) + len ( marker ) + 15 ) instr = stypes . stringToCharP ( instr ) marker = stypes . stringToCharP ( marker ) value = stypes . stringToCharP ( value ) out = stypes . stringToCharP ( lenout ) libspice . repmc_c ( instr , marker , value , lenout , out ) return stypes . toPythonString ( out )
Replace a marker with a character string .
58,866
def repmct ( instr , marker , value , repcase , lenout = None ) : if lenout is None : lenout = ctypes . c_int ( len ( instr ) + len ( marker ) + 15 ) instr = stypes . stringToCharP ( instr ) marker = stypes . stringToCharP ( marker ) value = ctypes . c_int ( value ) repcase = ctypes . c_char ( repcase . encode ( encoding = 'UTF-8' ) ) out = stypes . stringToCharP ( lenout ) libspice . repmct_c ( instr , marker , value , repcase , lenout , out ) return stypes . toPythonString ( out )
Replace a marker with the text representation of a cardinal number .
58,867
def repmd ( instr , marker , value , sigdig ) : lenout = ctypes . c_int ( len ( instr ) + len ( marker ) + 15 ) instr = stypes . stringToCharP ( instr ) marker = stypes . stringToCharP ( marker ) value = ctypes . c_double ( value ) sigdig = ctypes . c_int ( sigdig ) out = stypes . stringToCharP ( lenout ) libspice . repmd_c ( instr , marker , value , sigdig , lenout , out ) return stypes . toPythonString ( out )
Replace a marker with a double precision number .
58,868
def repmf ( instr , marker , value , sigdig , informat , lenout = None ) : if lenout is None : lenout = ctypes . c_int ( len ( instr ) + len ( marker ) + 15 ) instr = stypes . stringToCharP ( instr ) marker = stypes . stringToCharP ( marker ) value = ctypes . c_double ( value ) sigdig = ctypes . c_int ( sigdig ) informat = ctypes . c_char ( informat . encode ( encoding = 'UTF-8' ) ) out = stypes . stringToCharP ( lenout ) libspice . repmf_c ( instr , marker , value , sigdig , informat , lenout , out ) return stypes . toPythonString ( out )
Replace a marker in a string with a formatted double precision value .
58,869
def repmi ( instr , marker , value , lenout = None ) : if lenout is None : lenout = ctypes . c_int ( len ( instr ) + len ( marker ) + 15 ) instr = stypes . stringToCharP ( instr ) marker = stypes . stringToCharP ( marker ) value = ctypes . c_int ( value ) out = stypes . stringToCharP ( lenout ) libspice . repmi_c ( instr , marker , value , lenout , out ) return stypes . toPythonString ( out )
Replace a marker with an integer .
58,870
def rotate ( angle , iaxis ) : angle = ctypes . c_double ( angle ) iaxis = ctypes . c_int ( iaxis ) mout = stypes . emptyDoubleMatrix ( ) libspice . rotate_c ( angle , iaxis , mout ) return stypes . cMatrixToNumpy ( mout )
Calculate the 3x3 rotation matrix generated by a rotation of a specified angle about a specified axis . This rotation is thought of as rotating the coordinate system .
58,871
def rotmat ( m1 , angle , iaxis ) : m1 = stypes . toDoubleMatrix ( m1 ) angle = ctypes . c_double ( angle ) iaxis = ctypes . c_int ( iaxis ) mout = stypes . emptyDoubleMatrix ( ) libspice . rotmat_c ( m1 , angle , iaxis , mout ) return stypes . cMatrixToNumpy ( mout )
Rotmat applies a rotation of angle radians about axis iaxis to a matrix . This rotation is thought of as rotating the coordinate system .
58,872
def rotvec ( v1 , angle , iaxis ) : v1 = stypes . toDoubleVector ( v1 ) angle = ctypes . c_double ( angle ) iaxis = ctypes . c_int ( iaxis ) vout = stypes . emptyDoubleVector ( 3 ) libspice . rotvec_c ( v1 , angle , iaxis , vout ) return stypes . cVectorToPython ( vout )
Transform a vector to a new coordinate system rotated by angle radians about axis iaxis . This transformation rotates v1 by angle radians about the specified axis .
58,873
def rquad ( a , b , c ) : a = ctypes . c_double ( a ) b = ctypes . c_double ( b ) c = ctypes . c_double ( c ) root1 = stypes . emptyDoubleVector ( 2 ) root2 = stypes . emptyDoubleVector ( 2 ) libspice . rquad_c ( a , b , c , root1 , root2 ) return stypes . cVectorToPython ( root1 ) , stypes . cVectorToPython ( root2 )
Find the roots of a quadratic equation .
58,874
def saelgv ( vec1 , vec2 ) : vec1 = stypes . toDoubleVector ( vec1 ) vec2 = stypes . toDoubleVector ( vec2 ) smajor = stypes . emptyDoubleVector ( 3 ) sminor = stypes . emptyDoubleVector ( 3 ) libspice . saelgv_c ( vec1 , vec2 , smajor , sminor ) return stypes . cVectorToPython ( smajor ) , stypes . cVectorToPython ( sminor )
Find semi - axis vectors of an ellipse generated by two arbitrary three - dimensional vectors .
58,875
def scard ( incard , cell ) : assert isinstance ( cell , stypes . SpiceCell ) incard = ctypes . c_int ( incard ) libspice . scard_c ( incard , ctypes . byref ( cell ) ) return cell
Set the cardinality of a SPICE cell of any data type .
58,876
def scdecd ( sc , sclkdp , lenout = _default_len_out , MXPART = None ) : sc = ctypes . c_int ( sc ) sclkdp = ctypes . c_double ( sclkdp ) sclkch = stypes . stringToCharP ( " " * lenout ) lenout = ctypes . c_int ( lenout ) libspice . scdecd_c ( sc , sclkdp , lenout , sclkch ) return stypes . toPythonString ( sclkch )
Convert double precision encoding of spacecraft clock time into a character representation .
58,877
def scencd ( sc , sclkch , MXPART = None ) : sc = ctypes . c_int ( sc ) sclkch = stypes . stringToCharP ( sclkch ) sclkdp = ctypes . c_double ( ) libspice . scencd_c ( sc , sclkch , ctypes . byref ( sclkdp ) ) return sclkdp . value
Encode character representation of spacecraft clock time into a double precision number .
58,878
def scfmt ( sc , ticks , lenout = _default_len_out ) : sc = ctypes . c_int ( sc ) ticks = ctypes . c_double ( ticks ) clkstr = stypes . stringToCharP ( lenout ) lenout = ctypes . c_int ( lenout ) libspice . scfmt_c ( sc , ticks , lenout , clkstr ) return stypes . toPythonString ( clkstr )
Convert encoded spacecraft clock ticks to character clock format .
58,879
def scpart ( sc ) : sc = ctypes . c_int ( sc ) nparts = ctypes . c_int ( ) pstart = stypes . emptyDoubleVector ( 9999 ) pstop = stypes . emptyDoubleVector ( 9999 ) libspice . scpart_c ( sc , nparts , pstart , pstop ) return stypes . cVectorToPython ( pstart ) [ 0 : nparts . value ] , stypes . cVectorToPython ( pstop ) [ 0 : nparts . value ]
Get spacecraft clock partition information from a spacecraft clock kernel file .
58,880
def sctiks ( sc , clkstr ) : sc = ctypes . c_int ( sc ) clkstr = stypes . stringToCharP ( clkstr ) ticks = ctypes . c_double ( ) libspice . sctiks_c ( sc , clkstr , ctypes . byref ( ticks ) ) return ticks . value
Convert a spacecraft clock format string to number of ticks .
58,881
def sdiff ( a , b ) : assert isinstance ( a , stypes . SpiceCell ) assert isinstance ( b , stypes . SpiceCell ) assert a . dtype == b . dtype if a . dtype is 0 : c = stypes . SPICECHAR_CELL ( a . size , a . length ) elif a . dtype is 1 : c = stypes . SPICEDOUBLE_CELL ( a . size ) elif a . dtype is 2 : c = stypes . SPICEINT_CELL ( a . size ) else : raise NotImplementedError libspice . sdiff_c ( ctypes . byref ( a ) , ctypes . byref ( b ) , ctypes . byref ( c ) ) return c
Take the symmetric difference of two sets of any data type to form a third set .
58,882
def set_c ( a , op , b ) : assert isinstance ( a , stypes . SpiceCell ) assert isinstance ( b , stypes . SpiceCell ) assert a . dtype == b . dtype assert isinstance ( op , str ) op = stypes . stringToCharP ( op ) return bool ( libspice . set_c ( ctypes . byref ( a ) , op , ctypes . byref ( b ) ) )
Given a relational operator compare two sets of any data type .
58,883
def shellc ( ndim , lenvals , array ) : array = stypes . listToCharArray ( array , xLen = lenvals , yLen = ndim ) ndim = ctypes . c_int ( ndim ) lenvals = ctypes . c_int ( lenvals ) libspice . shellc_c ( ndim , lenvals , ctypes . byref ( array ) ) return stypes . cVectorToPython ( array )
Sort an array of character strings according to the ASCII collating sequence using the Shell Sort algorithm .
58,884
def shelld ( ndim , array ) : array = stypes . toDoubleVector ( array ) ndim = ctypes . c_int ( ndim ) libspice . shelld_c ( ndim , ctypes . cast ( array , ctypes . POINTER ( ctypes . c_double ) ) ) return stypes . cVectorToPython ( array )
Sort a double precision array using the Shell Sort algorithm .
58,885
def shelli ( ndim , array ) : array = stypes . toIntVector ( array ) ndim = ctypes . c_int ( ndim ) libspice . shelli_c ( ndim , ctypes . cast ( array , ctypes . POINTER ( ctypes . c_int ) ) ) return stypes . cVectorToPython ( array )
Sort an integer array using the Shell Sort algorithm .
58,886
def sincpt ( method , target , et , fixref , abcorr , obsrvr , dref , dvec ) : method = stypes . stringToCharP ( method ) target = stypes . stringToCharP ( target ) et = ctypes . c_double ( et ) fixref = stypes . stringToCharP ( fixref ) abcorr = stypes . stringToCharP ( abcorr ) obsrvr = stypes . stringToCharP ( obsrvr ) dref = stypes . stringToCharP ( dref ) dvec = stypes . toDoubleVector ( dvec ) spoint = stypes . emptyDoubleVector ( 3 ) trgepc = ctypes . c_double ( 0 ) srfvec = stypes . emptyDoubleVector ( 3 ) found = ctypes . c_int ( 0 ) libspice . sincpt_c ( method , target , et , fixref , abcorr , obsrvr , dref , dvec , spoint , ctypes . byref ( trgepc ) , srfvec , ctypes . byref ( found ) ) return stypes . cVectorToPython ( spoint ) , trgepc . value , stypes . cVectorToPython ( srfvec ) , bool ( found . value )
Given an observer and a direction vector defining a ray compute the surface intercept of the ray on a target body at a specified epoch optionally corrected for light time and stellar aberration .
58,887
def sphcyl ( radius , colat , slon ) : radius = ctypes . c_double ( radius ) colat = ctypes . c_double ( colat ) slon = ctypes . c_double ( slon ) r = ctypes . c_double ( ) lon = ctypes . c_double ( ) z = ctypes . c_double ( ) libspice . sphcyl_c ( radius , colat , slon , ctypes . byref ( r ) , ctypes . byref ( lon ) , ctypes . byref ( z ) ) return r . value , lon . value , z . value
This routine converts from spherical coordinates to cylindrical coordinates .
58,888
def sphlat ( r , colat , lons ) : r = ctypes . c_double ( r ) colat = ctypes . c_double ( colat ) lons = ctypes . c_double ( lons ) radius = ctypes . c_double ( ) lon = ctypes . c_double ( ) lat = ctypes . c_double ( ) libspice . sphcyl_c ( r , colat , lons , ctypes . byref ( radius ) , ctypes . byref ( lon ) , ctypes . byref ( lat ) ) return radius . value , lon . value , lat . value
Convert from spherical coordinates to latitudinal coordinates .
58,889
def sphrec ( r , colat , lon ) : r = ctypes . c_double ( r ) colat = ctypes . c_double ( colat ) lon = ctypes . c_double ( lon ) rectan = stypes . emptyDoubleVector ( 3 ) libspice . sphrec_c ( r , colat , lon , rectan ) return stypes . cVectorToPython ( rectan )
Convert from spherical coordinates to rectangular coordinates .
58,890
def spkapo ( targ , et , ref , sobs , abcorr ) : targ = ctypes . c_int ( targ ) et = ctypes . c_double ( et ) ref = stypes . stringToCharP ( ref ) abcorr = stypes . stringToCharP ( abcorr ) sobs = stypes . toDoubleVector ( sobs ) ptarg = stypes . emptyDoubleVector ( 3 ) lt = ctypes . c_double ( ) libspice . spkapo_c ( targ , et , ref , sobs , abcorr , ptarg , ctypes . byref ( lt ) ) return stypes . cVectorToPython ( ptarg ) , lt . value
Return the position of a target body relative to an observer optionally corrected for light time and stellar aberration .
58,891
def spkcov ( spk , idcode , cover = None ) : spk = stypes . stringToCharP ( spk ) idcode = ctypes . c_int ( idcode ) if cover is None : cover = stypes . SPICEDOUBLE_CELL ( 2000 ) else : assert isinstance ( cover , stypes . SpiceCell ) assert cover . is_double ( ) libspice . spkcov_c ( spk , idcode , ctypes . byref ( cover ) ) return cover
Find the coverage window for a specified ephemeris object in a specified SPK file .
58,892
def spkcpo ( target , et , outref , refloc , abcorr , obspos , obsctr , obsref ) : target = stypes . stringToCharP ( target ) et = ctypes . c_double ( et ) outref = stypes . stringToCharP ( outref ) refloc = stypes . stringToCharP ( refloc ) abcorr = stypes . stringToCharP ( abcorr ) obspos = stypes . toDoubleVector ( obspos ) obsctr = stypes . stringToCharP ( obsctr ) obsref = stypes . stringToCharP ( obsref ) state = stypes . emptyDoubleVector ( 6 ) lt = ctypes . c_double ( ) libspice . spkcpo_c ( target , et , outref , refloc , abcorr , obspos , obsctr , obsref , state , ctypes . byref ( lt ) ) return stypes . cVectorToPython ( state ) , lt . value
Return the state of a specified target relative to an observer where the observer has constant position in a specified reference frame . The observer s position is provided by the calling program rather than by loaded SPK files .
58,893
def spkcpt ( trgpos , trgctr , trgref , et , outref , refloc , abcorr , obsrvr ) : trgpos = stypes . toDoubleVector ( trgpos ) trgctr = stypes . stringToCharP ( trgctr ) trgref = stypes . stringToCharP ( trgref ) et = ctypes . c_double ( et ) outref = stypes . stringToCharP ( outref ) refloc = stypes . stringToCharP ( refloc ) abcorr = stypes . stringToCharP ( abcorr ) obsrvr = stypes . stringToCharP ( obsrvr ) state = stypes . emptyDoubleVector ( 6 ) lt = ctypes . c_double ( ) libspice . spkcpt_c ( trgpos , trgctr , trgref , et , outref , refloc , abcorr , obsrvr , state , ctypes . byref ( lt ) ) return stypes . cVectorToPython ( state ) , lt . value
Return the state relative to a specified observer of a target having constant position in a specified reference frame . The target s position is provided by the calling program rather than by loaded SPK files .
58,894
def spkcvo ( target , et , outref , refloc , abcorr , obssta , obsepc , obsctr , obsref ) : target = stypes . stringToCharP ( target ) et = ctypes . c_double ( et ) outref = stypes . stringToCharP ( outref ) refloc = stypes . stringToCharP ( refloc ) abcorr = stypes . stringToCharP ( abcorr ) obssta = stypes . toDoubleVector ( obssta ) obsepc = ctypes . c_double ( obsepc ) obsctr = stypes . stringToCharP ( obsctr ) obsref = stypes . stringToCharP ( obsref ) state = stypes . emptyDoubleVector ( 6 ) lt = ctypes . c_double ( ) libspice . spkcvo_c ( target , et , outref , refloc , abcorr , obssta , obsepc , obsctr , obsref , state , ctypes . byref ( lt ) ) return stypes . cVectorToPython ( state ) , lt . value
Return the state of a specified target relative to an observer where the observer has constant velocity in a specified reference frame . The observer s state is provided by the calling program rather than by loaded SPK files .
58,895
def spkcvt ( trgsta , trgepc , trgctr , trgref , et , outref , refloc , abcorr , obsrvr ) : trgpos = stypes . toDoubleVector ( trgsta ) trgepc = ctypes . c_double ( trgepc ) trgctr = stypes . stringToCharP ( trgctr ) trgref = stypes . stringToCharP ( trgref ) et = ctypes . c_double ( et ) outref = stypes . stringToCharP ( outref ) refloc = stypes . stringToCharP ( refloc ) abcorr = stypes . stringToCharP ( abcorr ) obsrvr = stypes . stringToCharP ( obsrvr ) state = stypes . emptyDoubleVector ( 6 ) lt = ctypes . c_double ( ) libspice . spkcvt_c ( trgpos , trgepc , trgctr , trgref , et , outref , refloc , abcorr , obsrvr , state , ctypes . byref ( lt ) ) return stypes . cVectorToPython ( state ) , lt . value
Return the state relative to a specified observer of a target having constant velocity in a specified reference frame . The target s state is provided by the calling program rather than by loaded SPK files .
58,896
def spkgps ( targ , et , ref , obs ) : targ = ctypes . c_int ( targ ) et = ctypes . c_double ( et ) ref = stypes . stringToCharP ( ref ) obs = ctypes . c_int ( obs ) position = stypes . emptyDoubleVector ( 3 ) lt = ctypes . c_double ( ) libspice . spkgps_c ( targ , et , ref , obs , position , ctypes . byref ( lt ) ) return stypes . cVectorToPython ( position ) , lt . value
Compute the geometric position of a target body relative to an observing body .
58,897
def spklef ( filename ) : filename = stypes . stringToCharP ( filename ) handle = ctypes . c_int ( ) libspice . spklef_c ( filename , ctypes . byref ( handle ) ) return handle . value
Load an ephemeris file for use by the readers . Return that file s handle to be used by other SPK routines to refer to the file .
58,898
def spkobj ( spk , outCell = None ) : spk = stypes . stringToCharP ( spk ) if not outCell : outCell = stypes . SPICEINT_CELL ( 1000 ) assert isinstance ( outCell , stypes . SpiceCell ) assert outCell . dtype == 2 libspice . spkobj_c ( spk , ctypes . byref ( outCell ) ) return outCell
Find the set of ID codes of all objects in a specified SPK file .
58,899
def spkopa ( filename ) : filename = stypes . stringToCharP ( filename ) handle = ctypes . c_int ( ) libspice . spkopa_c ( filename , ctypes . byref ( handle ) ) return handle . value
Open an existing SPK file for subsequent write .