Code
stringlengths
103
85.9k
Summary
listlengths
0
94
Please provide a description of the function:def tisbod(ref, body, et): ref = stypes.stringToCharP(ref) body = ctypes.c_int(body) et = ctypes.c_double(et) retmatrix = stypes.emptyDoubleMatrix(x=6, y=6) libspice.tisbod_c(ref, body, et, retmatrix) return stypes.cMatrixToNumpy(retmatrix)
[ "\n Return a 6x6 matrix that transforms states in inertial coordinates to\n states in body-equator-and-prime-meridian coordinates.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/tisbod_c.html\n\n :param ref: ID of inertial reference frame to transform from.\n :type ref: str\n :param b...
Please provide a description of the function:def tkvrsn(item): item = stypes.stringToCharP(item) return stypes.toPythonString(libspice.tkvrsn_c(item))
[ "\n Given an item such as the Toolkit or an entry point name, return\n the latest version string.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/tkvrsn_c.html\n\n :param item: Item for which a version string is desired.\n :type item: str\n :return: the latest version string.\n :rty...
Please provide a description of the function:def tparse(instring, lenout=_default_len_out): errmsg = stypes.stringToCharP(lenout) lenout = ctypes.c_int(lenout) instring = stypes.stringToCharP(instring) sp2000 = ctypes.c_double() libspice.tparse_c(instring, lenout, ctypes.byref(sp2000), errmsg) ...
[ "\n Parse a time string and return seconds past the J2000\n epoch on a formal calendar.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/tparse_c.html\n\n :param instring: Input time string, UTC.\n :type instring: str\n :param lenout: Available space in output error message string.\n ...
Please provide a description of the function:def tpictr(sample, lenout=_default_len_out, lenerr=_default_len_out): sample = stypes.stringToCharP(sample) pictur = stypes.stringToCharP(lenout) errmsg = stypes.stringToCharP(lenerr) lenout = ctypes.c_int(lenout) lenerr = ctypes.c_int(lenerr) ok...
[ "\n Given a sample time string, create a time format picture\n suitable for use by the routine timout.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/tpictr_c.html\n\n :param sample: A sample time string.\n :type sample: str\n :param lenout: The length for the output picture string.\n...
Please provide a description of the function:def trcdep(): depth = ctypes.c_int() libspice.trcdep_c(ctypes.byref(depth)) return depth.value
[ "\n Return the number of modules in the traceback representation.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/trcdep_c.html\n\n :return: The number of modules in the traceback.\n :rtype: int\n " ]
Please provide a description of the function:def trcnam(index, namlen=_default_len_out): index = ctypes.c_int(index) name = stypes.stringToCharP(namlen) namlen = ctypes.c_int(namlen) libspice.trcnam_c(index, namlen, name) return stypes.toPythonString(name)
[ "\n Return the name of the module having the specified position in\n the trace representation. The first module to check in is at\n index 0.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/trcnam_c.html\n\n :param index: The position of the requested module name.\n :type index: int\n ...
Please provide a description of the function:def twovec(axdef, indexa, plndef, indexp): axdef = stypes.toDoubleVector(axdef) indexa = ctypes.c_int(indexa) plndef = stypes.toDoubleVector(plndef) indexp = ctypes.c_int(indexp) mout = stypes.emptyDoubleMatrix() libspice.twovec_c(axdef, indexa, ...
[ "\n Find the transformation to the right-handed frame having a\n given vector as a specified axis and having a second given\n vector lying in a specified coordinate plane.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/twovec_c.html\n\n :param axdef: Vector defining a principal axis.\n ...
Please provide a description of the function:def txtopn(fname): fnameP = stypes.stringToCharP(fname) unit_out = ctypes.c_int() fname_len = ctypes.c_int(len(fname)) libspice.txtopn_(fnameP, ctypes.byref(unit_out), fname_len) return unit_out.value
[ "\n Internal undocumented command for opening a new text file for\n subsequent write access.\n\n https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ftncls_c.html#Files\n https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ftncls_c.html#Examples\n\n :param fname: name of the new text file t...
Please provide a description of the function:def ucase(inchar, lenout=None): if lenout is None: lenout = len(inchar) + 1 inchar = stypes.stringToCharP(inchar) outchar = stypes.stringToCharP(" " * lenout) lenout = ctypes.c_int(lenout) libspice.ucase_c(inchar, lenout, outchar) return ...
[ "\n Convert the characters in a string to uppercase.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ucase_c.html\n\n :param inchar: Input string.\n :type inchar: str\n :param lenout: Optional Maximum length of output string.\n :type lenout: int\n :return: Output string, all upperca...
Please provide a description of the function:def ucrss(v1, v2): v1 = stypes.toDoubleVector(v1) v2 = stypes.toDoubleVector(v2) vout = stypes.emptyDoubleVector(3) libspice.ucrss_c(v1, v2, vout) return stypes.cVectorToPython(vout)
[ "\n Compute the normalized cross product of two 3-vectors.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ucrss_c.html\n\n :param v1: Left vector for cross product.\n :type v1: 3-Element Array of floats\n :param v2: Right vector for cross product.\n :type v2: 3-Element Array of floats...
Please provide a description of the function:def uddc(udfunc, x, dx): x = ctypes.c_double(x) dx = ctypes.c_double(dx) isdescr = ctypes.c_int() libspice.uddc_c(udfunc, x, dx, ctypes.byref(isdescr)) return bool(isdescr.value)
[ "\n SPICE private routine intended solely for the support of SPICE\n routines. Users should not call this routine directly due to the\n volatile nature of this routine.\n\n This routine calculates the derivative of 'udfunc' with respect\n to time for 'et', then determines if the derivative has a\n ...
Please provide a description of the function:def uddf(udfunc, x, dx): x = ctypes.c_double(x) dx = ctypes.c_double(dx) deriv = ctypes.c_double() libspice.uddf_c(udfunc, x, dx, ctypes.byref(deriv)) return deriv.value
[ "\n Routine to calculate the first derivative of a caller-specified\n function using a three-point estimation.\n\n Use the @spiceypy.utils.callbacks.SpiceUDFUNS dectorator to wrap\n a given python function that takes one parameter (float) and\n returns a float. For example::\n\n @spiceypy.util...
Please provide a description of the function:def udf(x): x = ctypes.c_double(x) value = ctypes.c_double() libspice.udf_c(x, ctypes.byref(value)) return value.value
[ "\n No-op routine for with an argument signature matching udfuns.\n Allways returns 0.0 .\n\n https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/udf_c.html\n\n :param x: Double precision value, unused.\n :type x: float\n :return: Double precision value, unused.\n :rtype: float\n " ]
Please provide a description of the function:def unitim(epoch, insys, outsys): epoch = ctypes.c_double(epoch) insys = stypes.stringToCharP(insys) outsys = stypes.stringToCharP(outsys) return libspice.unitim_c(epoch, insys, outsys)
[ "\n Transform time from one uniform scale to another. The uniform\n time scales are TAI, TDT, TDB, ET, JED, JDTDB, JDTDT.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/unitim_c.html\n\n :param epoch: An epoch to be converted.\n :type epoch: float\n :param insys: The time scale assoc...
Please provide a description of the function:def unload(filename): if isinstance(filename, list): for f in filename: libspice.unload_c(stypes.stringToCharP(f)) return filename = stypes.stringToCharP(filename) libspice.unload_c(filename)
[ "\n Unload a SPICE kernel.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/unload_c.html\n\n :param filename: The name of a kernel to unload.\n :type filename: str\n " ]
Please provide a description of the function:def unorm(v1): v1 = stypes.toDoubleVector(v1) vout = stypes.emptyDoubleVector(3) vmag = ctypes.c_double() libspice.unorm_c(v1, vout, ctypes.byref(vmag)) return stypes.cVectorToPython(vout), vmag.value
[ "\n Normalize a double precision 3-vector and return its magnitude.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/unorm_c.html\n\n :param v1: Vector to be normalized. \n :type v1: 3-Element Array of floats\n :return: Unit vector of v1, Magnitude of v1.\n :rtype: tuple\n " ]
Please provide a description of the function:def unormg(v1, ndim): v1 = stypes.toDoubleVector(v1) vout = stypes.emptyDoubleVector(ndim) vmag = ctypes.c_double() ndim = ctypes.c_int(ndim) libspice.unormg_c(v1, ndim, vout, ctypes.byref(vmag)) return stypes.cVectorToPython(vout), vmag.value
[ "\n Normalize a double precision vector of arbitrary dimension and\n return its magnitude.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/unormg_c.html\n\n :param v1: Vector to be normalized. \n :type v1: Array of floats\n :param ndim: This is the dimension of v1 and vout. \n :type...
Please provide a description of the function:def utc2et(utcstr): utcstr = stypes.stringToCharP(utcstr) et = ctypes.c_double() libspice.utc2et_c(utcstr, ctypes.byref(et)) return et.value
[ "\n Convert an input time from Calendar or Julian Date format, UTC,\n to ephemeris seconds past J2000.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/utc2et_c.html\n\n :param utcstr: Input time string, UTC. \n :type utcstr: str\n :return: Output epoch, ephemeris seconds past J2000.\n ...
Please provide a description of the function:def vadd(v1, v2): v1 = stypes.toDoubleVector(v1) v2 = stypes.toDoubleVector(v2) vout = stypes.emptyDoubleVector(3) libspice.vadd_c(v1, v2, vout) return stypes.cVectorToPython(vout)
[ " Add two 3 dimensional vectors.\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vadd_c.html\n\n :param v1: First vector to be added. \n :type v1: 3-Element Array of floats\n :param v2: Second vector to be added. \n :type v2: 3-Element Array of floats\n :return: v1+v2\n :rtype: 3-Elem...
Please provide a description of the function:def vaddg(v1, v2, ndim): v1 = stypes.toDoubleVector(v1) v2 = stypes.toDoubleVector(v2) vout = stypes.emptyDoubleVector(ndim) ndim = ctypes.c_int(ndim) libspice.vaddg_c(v1, v2, ndim, vout) return stypes.cVectorToPython(vout)
[ " Add two n-dimensional vectors\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vaddg_c.html\n\n :param v1: First vector to be added. \n :type v1: list[ndim]\n :param v2: Second vector to be added. \n :type v2: list[ndim]\n :param ndim: Dimension of v1 and v2. \n :type ndim: int\n ...
Please provide a description of the function:def valid(insize, n, inset): assert isinstance(inset, stypes.SpiceCell) insize = ctypes.c_int(insize) n = ctypes.c_int(n) libspice.valid_c(insize, n, inset) return inset
[ "\n Create a valid CSPICE set from a CSPICE Cell of any data type.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/valid_c.html\n\n :param insize: Size (maximum cardinality) of the set. \n :type insize: int\n :param n: Initial no. of (possibly non-distinct) elements. \n :type n: int\n ...
Please provide a description of the function:def vcrss(v1, v2): v1 = stypes.toDoubleVector(v1) v2 = stypes.toDoubleVector(v2) vout = stypes.emptyDoubleVector(3) libspice.vcrss_c(v1, v2, vout) return stypes.cVectorToPython(vout)
[ "\n Compute the cross product of two 3-dimensional vectors.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vcrss_c.html\n\n :param v1: Left hand vector for cross product. \n :type v1: 3-Element Array of floats\n :param v2: Right hand vector for cross product. \n :type v2: 3-Element Ar...
Please provide a description of the function:def vdist(v1, v2): v1 = stypes.toDoubleVector(v1) v2 = stypes.toDoubleVector(v2) return libspice.vdist_c(v1, v2)
[ "\n Return the distance between two three-dimensional vectors.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vdist_c.html\n\n :param v1: First vector in the dot product. \n :type v1: 3-Element Array of floats\n :param v2: Second vector in the dot product. \n :type v2: 3-Element Array...
Please provide a description of the function:def vdistg(v1, v2, ndim): v1 = stypes.toDoubleVector(v1) v2 = stypes.toDoubleVector(v2) ndim = ctypes.c_int(ndim) return libspice.vdistg_c(v1, v2, ndim)
[ "\n Return the distance between two vectors of arbitrary dimension.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vdistg_c.html\n\n :param v1: ndim-dimensional double precision vector. \n :type v1: list[ndim]\n :param v2: ndim-dimensional double precision vector. \n :type v2: list[nd...
Please provide a description of the function:def vdot(v1, v2): v1 = stypes.toDoubleVector(v1) v2 = stypes.toDoubleVector(v2) return libspice.vdot_c(v1, v2)
[ "\n Compute the dot product of two double precision, 3-dimensional vectors.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vdot_c.html\n\n :param v1: First vector in the dot product. \n :type v1: 3-Element Array of floats\n :param v2: Second vector in the dot product. \n :type v2: 3-E...
Please provide a description of the function:def vdotg(v1, v2, ndim): v1 = stypes.toDoubleVector(v1) v2 = stypes.toDoubleVector(v2) ndim = ctypes.c_int(ndim) return libspice.vdotg_c(v1, v2, ndim)
[ "\n Compute the dot product of two double precision vectors of\n arbitrary dimension.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vdotg_c.html\n\n :param v1: First vector in the dot product. \n :type v1: list[ndim]\n :param v2: Second vector in the dot product. \n :type v2: list...
Please provide a description of the function:def vequ(v1): v1 = stypes.toDoubleVector(v1) vout = stypes.emptyDoubleVector(3) libspice.vequ_c(v1, vout) return stypes.cVectorToPython(vout)
[ "\n Make one double precision 3-dimensional vector equal to another.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vequ_c.html\n\n :param v1: 3-dimensional double precision vector. \n :type v1: 3-Element Array of floats\n :return: 3-dimensional double precision vector set equal to vin.\...
Please provide a description of the function:def vequg(v1, ndim): v1 = stypes.toDoubleVector(v1) vout = stypes.emptyDoubleVector(ndim) ndim = ctypes.c_int(ndim) libspice.vequg_c(v1, ndim, vout) return stypes.cVectorToPython(vout)
[ "\n Make one double precision vector of arbitrary dimension equal to another.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vequg_c.html\n\n :param v1: ndim-dimensional double precision vector. \n :type v1: list[ndim]\n :param ndim: Dimension of vin (and also vout). \n :type ndim: in...
Please provide a description of the function:def vhat(v1): v1 = stypes.toDoubleVector(v1) vout = stypes.emptyDoubleVector(3) libspice.vhat_c(v1, vout) return stypes.cVectorToPython(vout)
[ "\n Find the unit vector along a double precision 3-dimensional vector.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vhat_c.html\n\n :param v1: Vector to be unitized. \n :type v1: 3-Element Array of floats\n :return: Unit vector v / abs(v).\n :rtype: 3-Element Array of floats\n "...
Please provide a description of the function:def vhatg(v1, ndim): v1 = stypes.toDoubleVector(v1) vout = stypes.emptyDoubleVector(ndim) ndim = ctypes.c_int(ndim) libspice.vhatg_c(v1, ndim, vout) return stypes.cVectorToPython(vout)
[ "\n Find the unit vector along a double precision vector of arbitrary dimension.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vhatg_c.html\n\n :param v1: Vector to be normalized. \n :type v1: list[ndim]\n :param ndim: Dimension of v1 (and also vout). \n :type ndim: int\n :return:...
Please provide a description of the function:def vlcom(a, v1, b, v2): v1 = stypes.toDoubleVector(v1) v2 = stypes.toDoubleVector(v2) sumv = stypes.emptyDoubleVector(3) a = ctypes.c_double(a) b = ctypes.c_double(b) libspice.vlcom_c(a, v1, b, v2, sumv) return stypes.cVectorToPython(sumv)
[ "\n Compute a vector linear combination of two double precision,\n 3-dimensional vectors.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vlcom_c.html\n\n :param a: Coefficient of v1 \n :type a: float\n :param v1: Vector in 3-space \n :type v1: 3-Element Array of floats\n :param ...
Please provide a description of the function:def vlcom3(a, v1, b, v2, c, v3): v1 = stypes.toDoubleVector(v1) v2 = stypes.toDoubleVector(v2) v3 = stypes.toDoubleVector(v3) sumv = stypes.emptyDoubleVector(3) a = ctypes.c_double(a) b = ctypes.c_double(b) c = ctypes.c_double(c) libspice...
[ "\n This subroutine computes the vector linear combination\n a*v1 + b*v2 + c*v3 of double precision, 3-dimensional vectors.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vlcom3_c.html\n\n :param a: Coefficient of v1 \n :type a: float\n :param v1: Vector in 3-space \n :type v1: 3-E...
Please provide a description of the function:def vminug(vin, ndim): vin = stypes.toDoubleVector(vin) vout = stypes.emptyDoubleVector(ndim) ndim = ctypes.c_int(ndim) libspice.vminug_c(vin, ndim, vout) return stypes.cVectorToPython(vout)
[ "\n Negate a double precision vector of arbitrary dimension.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vminug_c.html\n\n :param vin: ndim-dimensional double precision vector to be negated. \n :type vin: Array of floats\n :param ndim: Dimension of vin. \n :type ndim: int\n :ret...
Please provide a description of the function:def vminus(vin): vin = stypes.toDoubleVector(vin) vout = stypes.emptyDoubleVector(3) libspice.vminus_c(vin, vout) return stypes.cVectorToPython(vout)
[ "\n Negate a double precision 3-dimensional vector.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vminus_c.html\n\n :param vin: Vector to be negated. \n :type vin: 3-Element Array of floats\n :return: Negated vector -v1.\n :rtype: 3-Element Array of floats\n " ]
Please provide a description of the function:def vnormg(v, ndim): v = stypes.toDoubleVector(v) ndim = ctypes.c_int(ndim) return libspice.vnormg_c(v, ndim)
[ "\n Compute the magnitude of a double precision vector of arbitrary dimension.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vnormg_c.html\n\n :param v: Vector whose magnitude is to be found. \n :type v: Array of floats\n :param ndim: Dimension of v \n :type ndim: int\n :return: m...
Please provide a description of the function:def vpack(x, y, z): x = ctypes.c_double(x) y = ctypes.c_double(y) z = ctypes.c_double(z) vout = stypes.emptyDoubleVector(3) libspice.vpack_c(x, y, z, vout) return stypes.cVectorToPython(vout)
[ "\n Pack three scalar components into a vector.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vpack_c.html\n\n :param x: first scalar component \n :type x: float\n :param y: second scalar component \n :type y: float\n :param z: third scalar component \n :type z: float\n :ret...
Please provide a description of the function:def vperp(a, b): a = stypes.toDoubleVector(a) b = stypes.toDoubleVector(b) vout = stypes.emptyDoubleVector(3) libspice.vperp_c(a, b, vout) return stypes.cVectorToPython(vout)
[ "\n Find the component of a vector that is perpendicular to a second\n vector. All vectors are 3-dimensional.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vperp_c.html\n\n :param a: The vector whose orthogonal component is sought. \n :type a: 3-Element Array of floats\n :param b: Th...
Please provide a description of the function:def vprjp(vin, plane): vin = stypes.toDoubleVector(vin) vout = stypes.emptyDoubleVector(3) libspice.vprjp_c(vin, ctypes.byref(plane), vout) return stypes.cVectorToPython(vout)
[ "\n Project a vector onto a specified plane, orthogonally.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vprjp_c.html\n\n :param vin: The projected vector. \n :type vin: 3-Element Array of floats\n :param plane: Plane containing vin. \n :type plane: spiceypy.utils.support_types.Plane...
Please provide a description of the function:def vprjpi(vin, projpl, invpl): vin = stypes.toDoubleVector(vin) vout = stypes.emptyDoubleVector(3) found = ctypes.c_int() libspice.vprjpi_c(vin, ctypes.byref(projpl), ctypes.byref(invpl), vout, ctypes.byref(found)) return stype...
[ "\n Find the vector in a specified plane that maps to a specified\n vector in another plane under orthogonal projection.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vprjpi_c.html\n\n :param vin: The projected vector. \n :type vin: 3-Element Array of floats\n :param projpl: Plane co...
Please provide a description of the function:def vproj(a, b): a = stypes.toDoubleVector(a) b = stypes.toDoubleVector(b) vout = stypes.emptyDoubleVector(3) libspice.vproj_c(a, b, vout) return stypes.cVectorToPython(vout)
[ "\n Find the projection of one vector onto another vector.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vproj_c.html\n\n :param a: The vector to be projected. \n :type a: 3-Element Array of floats\n :param b: The vector onto which a is to be projected. \n :type b: 3-Element Array of...
Please provide a description of the function:def vrel(v1, v2): v1 = stypes.toDoubleVector(v1) v2 = stypes.toDoubleVector(v2) return libspice.vrel_c(v1, v2)
[ "\n Return the relative difference between two 3-dimensional vectors.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vrel_c.html\n\n :param v1: First vector \n :type v1: 3-Element Array of floats\n :param v2: Second vector \n :type v2: 3-Element Array of floats\n :return: the relat...
Please provide a description of the function:def vrelg(v1, v2, ndim): v1 = stypes.toDoubleVector(v1) v2 = stypes.toDoubleVector(v2) ndim = ctypes.c_int(ndim) return libspice.vrelg_c(v1, v2, ndim)
[ "\n Return the relative difference between two vectors of general dimension.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vrelg_c.html\n\n :param v1: First vector \n :type v1: Array of floats\n :param v2: Second vector \n :type v2: Array of floats\n :param ndim: Dimension of v1 a...
Please provide a description of the function:def vrotv(v, axis, theta): v = stypes.toDoubleVector(v) axis = stypes.toDoubleVector(axis) theta = ctypes.c_double(theta) r = stypes.emptyDoubleVector(3) libspice.vrotv_c(v, axis, theta, r) return stypes.cVectorToPython(r)
[ "\n Rotate a vector about a specified axis vector by a\n specified angle and return the rotated vector.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vrotv_c.html\n\n :param v: Vector to be rotated. \n :type v: 3-Element Array of floats\n :param axis: Axis of the rotation. \n :typ...
Please provide a description of the function:def vscl(s, v1): s = ctypes.c_double(s) v1 = stypes.toDoubleVector(v1) vout = stypes.emptyDoubleVector(3) libspice.vscl_c(s, v1, vout) return stypes.cVectorToPython(vout)
[ "\n Multiply a scalar and a 3-dimensional double precision vector.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vscl_c.html\n\n :param s: Scalar to multiply a vector \n :type s: float\n :param v1: Vector to be multiplied \n :type v1: 3-Element Array of floats\n :return: Product v...
Please provide a description of the function:def vsclg(s, v1, ndim): s = ctypes.c_double(s) v1 = stypes.toDoubleVector(v1) vout = stypes.emptyDoubleVector(ndim) ndim = ctypes.c_int(ndim) libspice.vsclg_c(s, v1, ndim, vout) return stypes.cVectorToPython(vout)
[ "\n Multiply a scalar and a double precision vector of arbitrary dimension.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vsclg_c.html\n\n :param s: Scalar to multiply a vector \n :type s: float\n :param v1: Vector to be multiplied \n :type v1: Array of floats\n :param ndim: Dimen...
Please provide a description of the function:def vsep(v1, v2): v1 = stypes.toDoubleVector(v1) v2 = stypes.toDoubleVector(v2) return libspice.vsep_c(v1, v2)
[ "\n Find the separation angle in radians between two double\n precision, 3-dimensional vectors. This angle is defined as zero\n if either vector is zero.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vsep_c.html\n\n :param v1: First vector \n :type v1: 3-Element Array of floats\n ...
Please provide a description of the function:def vsepg(v1, v2, ndim): v1 = stypes.toDoubleVector(v1) v2 = stypes.toDoubleVector(v2) ndim = ctypes.c_int(ndim) return libspice.vsepg_c(v1, v2, ndim)
[ "\n Find the separation angle in radians between two double\n precision vectors of arbitrary dimension. This angle is defined\n as zero if either vector is zero.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vsepg_c.html\n\n :param v1: First vector \n :type v1: Array of floats\n :...
Please provide a description of the function:def vsub(v1, v2): v1 = stypes.toDoubleVector(v1) v2 = stypes.toDoubleVector(v2) vout = stypes.emptyDoubleVector(3) libspice.vsub_c(v1, v2, vout) return stypes.cVectorToPython(vout)
[ "\n Compute the difference between two 3-dimensional,\n double precision vectors.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vsub_c.html\n\n :param v1: First vector (minuend). \n :type v1: 3-Element Array of floats\n :param v2: Second vector (subtrahend). \n :type v2: 3-Element...
Please provide a description of the function:def vsubg(v1, v2, ndim): v1 = stypes.toDoubleVector(v1) v2 = stypes.toDoubleVector(v2) vout = stypes.emptyDoubleVector(ndim) ndim = ctypes.c_int(ndim) libspice.vsubg_c(v1, v2, ndim, vout) return stypes.cVectorToPython(vout)
[ "\n Compute the difference between two double precision\n vectors of arbitrary dimension.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vsubg_c.html\n\n :param v1: First vector (minuend). \n :type v1: Array of floats\n :param v2: Second vector (subtrahend). \n :type v2: Array of f...
Please provide a description of the function:def vtmv(v1, matrix, v2): v1 = stypes.toDoubleVector(v1) matrix = stypes.toDoubleMatrix(matrix) v2 = stypes.toDoubleVector(v2) return libspice.vtmv_c(v1, matrix, v2)
[ "\n Multiply the transpose of a 3-dimensional column vector\n a 3x3 matrix, and a 3-dimensional column vector.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vtmv_c.html\n\n :param v1: 3 dimensional double precision column vector. \n :type v1: 3-Element Array of floats\n :param matrix...
Please provide a description of the function:def vtmvg(v1, matrix, v2, nrow, ncol): v1 = stypes.toDoubleVector(v1) matrix = stypes.toDoubleMatrix(matrix) v2 = stypes.toDoubleVector(v2) nrow = ctypes.c_int(nrow) ncol = ctypes.c_int(ncol) return libspice.vtmvg_c(v1, matrix, v2, nrow, ncol)
[ "\n Multiply the transpose of a n-dimensional\n column vector a nxm matrix,\n and a m-dimensional column vector.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vtmvg_c.html\n\n :param v1: n-dimensional double precision column vector. \n :type v1: Array of floats\n :param matrix: nx...
Please provide a description of the function:def vupack(v): v1 = stypes.toDoubleVector(v) x = ctypes.c_double() y = ctypes.c_double() z = ctypes.c_double() libspice.vupack_c(v1, ctypes.byref(x), ctypes.byref(y), ctypes.byref(z)) return x.value, y.value, z.value
[ "\n Unpack three scalar components from a vector.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vupack_c.html\n\n :param v: Vector \n :type v: 3-Element Array of floats\n :return: (x, y, z)\n :rtype: tuple\n " ]
Please provide a description of the function:def vzero(v): v = stypes.toDoubleVector(v) return bool(libspice.vzero_c(v))
[ "\n Indicate whether a 3-vector is the zero vector.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vzero_c.html\n\n :param v: Vector to be tested \n :type v: 3-Element Array of floats\n :return: true if and only if v is the zero vector\n :rtype: bool\n " ]
Please provide a description of the function:def vzerog(v, ndim): v = stypes.toDoubleVector(v) ndim = ctypes.c_int(ndim) return bool(libspice.vzerog_c(v, ndim))
[ "\n Indicate whether a general-dimensional vector is the zero vector.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vzerog_c.html\n\n :param v: Vector to be tested \n :type v: Array of floats\n :param ndim: Dimension of v \n :type ndim: int\n :return: true if and only if v is the ...
Please provide a description of the function:def wncomd(left, right, window): assert isinstance(window, stypes.SpiceCell) assert window.dtype == 1 left = ctypes.c_double(left) right = ctypes.c_double(right) result = stypes.SpiceCell.double(window.size) libspice.wncomd_c(left, right, ctypes....
[ "\n Determine the complement of a double precision window with\n respect to a specified interval.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/wncomd_c.html\n\n :param left: left endpoints of complement interval. \n :type left: float\n :param right: right endpoints of complement int...
Please provide a description of the function:def wncond(left, right, window): assert isinstance(window, stypes.SpiceCell) assert window.dtype == 1 left = ctypes.c_double(left) right = ctypes.c_double(right) libspice.wncond_c(left, right, ctypes.byref(window)) return window
[ "\n Contract each of the intervals of a double precision window.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/wncond_c.html\n\n :param left: Amount added to each left endpoint. \n :type left: float\n :param right: Amount subtracted from each right endpoint. \n :type right: float\n ...
Please provide a description of the function:def wndifd(a, b): assert isinstance(a, stypes.SpiceCell) assert isinstance(b, stypes.SpiceCell) assert a.dtype == 1 assert b.dtype == 1 c = stypes.SpiceCell.double(a.size + b.size) libspice.wndifd_c(ctypes.byref(a), ctypes.byref(b), ctypes.byref(...
[ "\n Place the difference of two double precision windows into\n a third window.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/wndifd_c.html\n\n :param a: Input window A. \n :type a: spiceypy.utils.support_types.SpiceCell\n :param b: Input window B. \n :type b: spiceypy.utils.suppo...
Please provide a description of the function:def wnelmd(point, window): assert isinstance(window, stypes.SpiceCell) assert window.dtype == 1 point = ctypes.c_double(point) return bool(libspice.wnelmd_c(point, ctypes.byref(window)))
[ "\n Determine whether a point is an element of a double precision\n window.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/wnelmd_c.html\n\n :param point: Input point. \n :type point: float\n :param window: Input window \n :type window: spiceypy.utils.support_types.SpiceCell\n :...
Please provide a description of the function:def wnexpd(left, right, window): assert isinstance(window, stypes.SpiceCell) assert window.dtype == 1 left = ctypes.c_double(left) right = ctypes.c_double(right) libspice.wnexpd_c(left, right, ctypes.byref(window)) return window
[ "\n Expand each of the intervals of a double precision window.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/wnexpd_c.html\n\n :param left: Amount subtracted from each left endpoint. \n :type left: float\n :param right: Amount added to each right endpoint. \n :type right: float\n ...
Please provide a description of the function:def wnextd(side, window): assert isinstance(window, stypes.SpiceCell) assert window.dtype == 1 assert side == 'L' or side == 'R' side = ctypes.c_char(side.encode(encoding='UTF-8')) libspice.wnextd_c(side, ctypes.byref(window)) return window
[ "\n Extract the left or right endpoints from a double precision\n window.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/wnextd_c.html\n\n :param side: Extract left \"L\" or right \"R\" endpoints. \n :type side: str\n :param window: Window to be extracted. \n :type window: spiceypy...
Please provide a description of the function:def wnfetd(window, n): assert isinstance(window, stypes.SpiceCell) assert window.dtype == 1 n = ctypes.c_int(n) left = ctypes.c_double() right = ctypes.c_double() libspice.wnfetd_c(ctypes.byref(window), n, ctypes.byref(left), ...
[ "\n Fetch a particular interval from a double precision window.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/wnfetd_c.html\n\n :param window: Input window \n :type window: spiceypy.utils.support_types.SpiceCell\n :param n: Index of interval to be fetched. \n :type n: int\n :retur...
Please provide a description of the function:def wnfild(small, window): assert isinstance(window, stypes.SpiceCell) assert window.dtype == 1 small = ctypes.c_double(small) libspice.wnfild_c(small, ctypes.byref(window)) return window
[ "\n Fill small gaps between adjacent intervals of a double precision window.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/wnfild_c.html\n\n :param small: Limiting measure of small gaps. \n :type small: float\n :param window: Window to be filled \n :type window: spiceypy.utils.suppor...
Please provide a description of the function:def wnfltd(small, window): assert isinstance(window, stypes.SpiceCell) assert window.dtype == 1 small = ctypes.c_double(small) libspice.wnfltd_c(small, ctypes.byref(window)) return window
[ "\n Filter (remove) small intervals from a double precision window.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/wnfltd_c.html\n\n :param small: Limiting measure of small intervals. \n :type small: float\n :param window: Window to be filtered. \n :type window: spiceypy.utils.support...
Please provide a description of the function:def wnincd(left, right, window): assert isinstance(window, stypes.SpiceCell) assert window.dtype == 1 left = ctypes.c_double(left) right = ctypes.c_double(right) return bool(libspice.wnincd_c(left, right, ctypes.byref(window)))
[ "\n Determine whether an interval is included in a double precision window.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/wnincd_c.html\n\n :param left: Left interval \n :type left: float\n :param right: Right interval \n :type right: float\n :param window: Input window \n :typ...
Please provide a description of the function:def wninsd(left, right, window): assert isinstance(window, stypes.SpiceCell) assert window.dtype == 1 left = ctypes.c_double(left) right = ctypes.c_double(right) libspice.wninsd_c(left, right, ctypes.byref(window))
[ "\n Insert an interval into a double precision window.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/wninsd_c.html\n\n :param left: Left endpoints of new interval. \n :type left: float\n :param right: Right endpoints of new interval. \n :type right: float\n :param window: Input wi...
Please provide a description of the function:def wnintd(a, b): assert isinstance(a, stypes.SpiceCell) assert b.dtype == 1 assert isinstance(b, stypes.SpiceCell) assert a.dtype == 1 c = stypes.SpiceCell.double(b.size + a.size) libspice.wnintd_c(ctypes.byref(a), ctypes.byref(b), ctypes.byref(...
[ "\n Place the intersection of two double precision windows into\n a third window.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/wnintd_c.html\n\n\n :param a: Input window A. \n :type a: spiceypy.utils.support_types.SpiceCell\n :param b: Input window B. \n :type b: spiceypy.utils.s...
Please provide a description of the function:def wnreld(a, op, b): assert isinstance(a, stypes.SpiceCell) assert b.dtype == 1 assert isinstance(b, stypes.SpiceCell) assert a.dtype == 1 assert isinstance(op, str) op = stypes.stringToCharP(op.encode(encoding='UTF-8')) return bool(libspice...
[ "\n Compare two double precision windows.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/wnreld_c.html\n\n :param a: First window. \n :type a: spiceypy.utils.support_types.SpiceCell\n :param op: Comparison operator. \n :type op: str\n :param b: Second window. \n :type b: spiceyp...
Please provide a description of the function:def wnsumd(window): assert isinstance(window, stypes.SpiceCell) assert window.dtype == 1 meas = ctypes.c_double() avg = ctypes.c_double() stddev = ctypes.c_double() shortest = ctypes.c_int() longest = ctypes.c_int() libspice.wnsumd_c(ctyp...
[ "\n Summarize the contents of a double precision window.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/wnsumd_c.html\n\n :param window: Window to be summarized. \n :type window: spiceypy.utils.support_types.SpiceCell\n :return:\n Total measure of intervals in window,\n ...
Please provide a description of the function:def wnunid(a, b): assert isinstance(a, stypes.SpiceCell) assert b.dtype == 1 assert isinstance(b, stypes.SpiceCell) assert a.dtype == 1 c = stypes.SpiceCell.double(b.size + a.size) libspice.wnunid_c(ctypes.byref(a), ctypes.byref(b), ctypes.byref(...
[ "\n Place the union of two double precision windows into a third window.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/wnunid_c.html\n\n :param a: Input window A. \n :type a: spiceypy.utils.support_types.SpiceCell\n :param b: Input window B. \n :type b: spiceypy.utils.support_types.S...
Please provide a description of the function:def wnvald(insize, n, window): assert isinstance(window, stypes.SpiceCell) assert window.dtype == 1 insize = ctypes.c_int(insize) n = ctypes.c_int(n) libspice.wnvald_c(insize, n, ctypes.byref(window)) return window
[ "\n Form a valid double precision window from the contents\n of a window array.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/wnvald_c.html\n\n :param insize: Size of window. \n :type insize: int\n :param n: Original number of endpoints. \n :type n: int\n :param window: Input w...
Please provide a description of the function:def writln(line, unit): lineP = stypes.stringToCharP(line) unit = ctypes.c_int(unit) line_len = ctypes.c_int(len(line)) libspice.writln_(lineP, ctypes.byref(unit), line_len)
[ "\n Internal undocumented command for writing a text line to a logical unit\n\n No URL available; relevant lines from SPICE source:\n\n FORTRAN SPICE, writln.f::\n\n C$Procedure WRITLN ( Write a text line to a logical unit )\n SUBROUTINE WRITLN ( LINE, UNIT )\n CHARACT...
Please provide a description of the function:def xf2eul(xform, axisa, axisb, axisc): xform = stypes.toDoubleMatrix(xform) axisa = ctypes.c_int(axisa) axisb = ctypes.c_int(axisb) axisc = ctypes.c_int(axisc) eulang = stypes.emptyDoubleVector(6) unique = ctypes.c_int() libspice.xf2eul_c(xf...
[ "\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/xf2eul_c.html\n\n :param xform: state transformation matrix \n :type xform: list[6][6]\n :param axisa: Axis A of the Euler angle factorization. \n :type axisa: int\n :param axisb: Axis B of the Euler angle factorization. \n :type axisb...
Please provide a description of the function:def xf2rav(xform): xform = stypes.toDoubleMatrix(xform) rot = stypes.emptyDoubleMatrix() av = stypes.emptyDoubleVector(3) libspice.xf2rav_c(xform, rot, av) return stypes.cMatrixToNumpy(rot), stypes.cVectorToPython(av)
[ "\n This routine determines the rotation matrix and angular velocity\n of the rotation from a state transformation matrix.\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/xf2rav_c.html\n\n :param xform: state transformation matrix \n :type xform: list[6][6]\n :return:\n rotati...
Please provide a description of the function:def xfmsta(input_state, input_coord_sys, output_coord_sys, body): input_state = stypes.toDoubleVector(input_state) input_coord_sys = stypes.stringToCharP(input_coord_sys) output_coord_sys = stypes.stringToCharP(output_coord_sys) body = stypes.stringToCha...
[ "\n Transform a state between coordinate systems.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/xfmsta_c.html\n\n :param input_state: Input state. \n :type input_state: 6-Element Array of floats\n :param input_coord_sys: Current (input) coordinate system. \n :type input_coord_sys: st...
Please provide a description of the function:def xpose(m): m = stypes.toDoubleMatrix(m) mout = stypes.emptyDoubleMatrix(x=3, y=3) libspice.xpose_c(m, mout) return stypes.cMatrixToNumpy(mout)
[ "\n Transpose a 3x3 matrix\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/xpose_c.html\n\n :param m: Matrix to be transposed \n :type m: 3x3-Element Array of floats\n :return: Transposed matrix\n :rtype: 3x3-Element Array of floats\n " ]
Please provide a description of the function:def xpose6(m): m = stypes.toDoubleMatrix(m) mout = stypes.emptyDoubleMatrix(x=6, y=6) libspice.xpose6_c(m, mout) return stypes.cMatrixToNumpy(mout)
[ "\n Transpose a 6x6 matrix\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/xpose6_c.html\n\n :param m: Matrix to be transposed \n :type m: list[6][6]\n :return: Transposed matrix\n :rtype: list[6][6]\n " ]
Please provide a description of the function:def xposeg(matrix, nrow, ncol): matrix = stypes.toDoubleMatrix(matrix) mout = stypes.emptyDoubleMatrix(x=ncol, y=nrow) ncol = ctypes.c_int(ncol) nrow = ctypes.c_int(nrow) libspice.xposeg_c(matrix, nrow, ncol, mout) return stypes.cMatrixToNumpy(mo...
[ "\n Transpose a matrix of arbitrary size\n in place, the matrix need not be square.\n\n http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/xposeg_c.html\n\n :param matrix: Matrix to be transposed \n :type matrix: NxM-Element Array of floats\n :param nrow: Number of rows of input matrix.\n ...
Please provide a description of the function:def SpiceUDFUNS(f): @functools.wraps(f) def wrapping_udfuns(x, value): result = f(x) value[0] = c_double(result) return UDFUNS(wrapping_udfuns)
[ "\n Decorator for wrapping python functions in spice udfuns callback type\n :param f: function that has one argument of type float, and returns a float\n :type f: builtins.function\n :return: wrapped udfunc function\n :rtype: builtins.function\n " ]
Please provide a description of the function:def SpiceUDFUNB(f): @functools.wraps(f) def wrapping_udfunb(udf, et, xbool): result = f(udf, et) # the function takes a udffunc as a argument xbool[0] = c_int(result) return UDFUNB(wrapping_udfunb)
[ "\n Decorator for wrapping python functions in spice udfunb callback type\n :param f: function to be wrapped\n :type f: builtins.function\n :return: wrapped udfunb function\n :rtype: builtins.function\n " ]
Please provide a description of the function:def SpiceUDSTEP(f): @functools.wraps(f) def wrapping_udstep(x, value): result = f(x) value[0] = c_double(result) return UDSTEP(wrapping_udstep)
[ "\n Decorator for wrapping python functions in spice udstep callback type\n :param f: function to be wrapped\n :type f: builtins.function\n :return: wrapped udstep function\n :rtype: builtins.function\n " ]
Please provide a description of the function:def SpiceUDREFN(f): @functools.wraps(f) def wrapping_udrefn(t1, t2, s1, s2, t): result = f(t1, t2, s1, s2) t[0] = c_double(result) return UDREFN(wrapping_udrefn)
[ "\n Decorator for wrapping python functions in spice udrefn callback type\n :param f: function to be wrapped\n :type f: builtins.function\n :return: wrapped udrefn function\n :rtype: builtins.function\n " ]
Please provide a description of the function:def SpiceUDREPI(f): @functools.wraps(f) def wrapping_udrepi(cnfine, srcpre, srcsurf): f(cnfine, srcpre, srcsurf) return UDREPI(wrapping_udrepi)
[ "\n Decorator for wrapping python functions in spice udfrepi callback type\n :param f: function to be wrapped\n :type f: builtins.function\n :return: wrapped udrepi function\n :rtype: builtins.function\n " ]
Please provide a description of the function:def SpiceUDREPU(f): @functools.wraps(f) def wrapping_udrepu(beg, end, et): f(beg, end, et) return UDREPU(wrapping_udrepu)
[ "\n Decorator for wrapping python functions in spice udrepu callback type\n :param f: function to be wrapped\n :type f: builtins.function\n :return: wrapped udrepu function\n :rtype: builtins.function\n " ]
Please provide a description of the function:def SpiceUDBAIL(f): @functools.wraps(f) def wrapping_udbail(): result = f() return int(result) return UDBAIL(wrapping_udbail)
[ "\n Decorator for wrapping python functions in spice udbail callback type\n :param f: function to be wrapped\n :type f: builtins.function\n :return: wrapped udbail function\n :rtype: builtins.function\n " ]
Please provide a description of the function:def CallUDFUNS(f, x): value = c_double() f(x, byref(value)) return value.value
[ "\n We are given a UDF CFUNCTYPE and want to call it in python\n\n :param f: SpiceUDFUNS\n :type f: CFUNCTYPE\n :param x: some scalar\n :type x: float\n :return: value\n :rtype: float\n " ]
Please provide a description of the function:def cVectorToPython(x): if isinstance(x[0], bool): return numpy.frombuffer(x, dtype=numpy.bool).copy() elif isinstance(x[0], int): return numpy.frombuffer(x, dtype=numpy.int32).copy() elif isinstance(x[0], float): return numpy.frombuf...
[ "\n Convert the c vector data into the correct python data type\n (numpy arrays or strings)\n :param x:\n :return:\n " ]
Please provide a description of the function:def stringToCharP(inobject, inlen=None): if inlen and isinstance(inobject, str): return create_string_buffer(inobject.encode(encoding='UTF-8'), inlen) if isinstance(inobject, bytes): return inobject if isinstance(inobject, c_int): re...
[ "\n :param inobject: input string, int for getting null string of length of int\n :param inlen: optional parameter, length of a given string can be specified\n :return:\n " ]
Please provide a description of the function:def asalsan(X, rank, **kwargs): # init options ainit = kwargs.pop('init', _DEF_INIT) proj = kwargs.pop('proj', _DEF_PROJ) maxIter = kwargs.pop('maxIter', _DEF_MAXITER) conv = kwargs.pop('conv', _DEF_CONV) nne = kwargs.pop('nne', _DEF_NNE) opt...
[ "\n ASALSAN algorithm to compute the three-way DEDICOM decomposition\n of a tensor\n\n See\n ---\n .. [1] Brett W. Bader, Richard A. Harshman, Tamara G. Kolda\n \"Temporal analysis of semantic graphs using ASALSAN\"\n 7th International Conference on Data Mining, 2007\n\n .. [2] Brett W...
Please provide a description of the function:def updateD_G(self, x): self.precompute(x) g = zeros(len(x)) Ai = zeros(self.A.shape[0]) for i in range(len(g)): Ai = self.A[:, i] g[i] = (self.E * (dot(self.AD, outer(self.R[:, i], Ai)) + d...
[ "\n Compute Gradient for update of D\n\n See [2] for derivation of Gradient\n " ]
Please provide a description of the function:def updateD_H(self, x): self.precompute(x) H = zeros((len(x), len(x))) Ai = zeros(self.A.shape[0]) Aj = zeros(Ai.shape) for i in range(len(x)): Ai = self.A[:, i] ti = dot(self.AD, outer(self.R[:, i], Ai...
[ "\n Compute Hessian for update of D\n\n See [2] for derivation of Hessian\n " ]
Please provide a description of the function:def is_sequence(obj): try: from collections import Sequence except ImportError: from operator import isSequenceType return isSequenceType(obj) else: return isinstance(obj, Sequence)
[ "\n Helper function to determine sequences\n across Python 2.x and 3.x\n " ]
Please provide a description of the function:def is_number(obj): try: from numbers import Number except ImportError: from operator import isNumberType return isNumberType(obj) else: return isinstance(obj, Number)
[ "\n Helper function to determine numbers\n across Python 2.x and 3.x\n " ]
Please provide a description of the function:def func_attr(f, attr): if hasattr(f, 'func_%s' % attr): return getattr(f, 'func_%s' % attr) elif hasattr(f, '__%s__' % attr): return getattr(f, '__%s__' % attr) else: raise ValueError('Object %s has no attr' % (str(f), attr))
[ "\n Helper function to get the attribute of a function\n like, name, code, defaults across Python 2.x and 3.x\n " ]
Please provide a description of the function:def from_to_without(frm, to, without, step=1, skip=1, reverse=False, separate=False): if reverse: frm, to = (to - 1), (frm - 1) step *= -1 skip *= -1 a = list(range(frm, without, step)) b = list(range(without + skip, to, step)) if...
[ "\n Helper function to create ranges with missing entries\n " ]
Please provide a description of the function:def _ttv_compute(self, v, dims, vidx, remdims): if not isinstance(v, tuple): raise ValueError('v must be a tuple of vectors') ndim = self.ndim order = list(remdims) + list(dims) if ndim > 1: T = self.transpose(...
[ "\n Tensor times vector product\n\n Parameter\n ---------\n " ]
Please provide a description of the function:def unfold(self, mode): sz = array(self.shape) N = len(sz) order = ([mode], from_to_without(N - 1, -1, mode, step=-1, skip=-1)) newsz = (sz[order[0]][0], prod(sz[order[1]])) arr = self.transpose(axes=(order[0] + order[1])) ...
[ "\n Unfolds a dense tensor in mode n.\n\n Parameters\n ----------\n mode : int\n Mode in which tensor is unfolded\n\n Returns\n -------\n unfolded_dtensor : unfolded_dtensor object\n Tensor unfolded along mode\n\n Examples\n ------...
Please provide a description of the function:def accum(subs, vals, func=np.sum, issorted=False, with_subs=False): # sort accmap for ediff if not sorted if not issorted: sidx = lexsort(subs, axis=0) subs = [sub[sidx] for sub in subs] vals = vals[sidx] idx = np.where(np.diff(subs)...
[ "\n NumPy implementation for Matlab's accumarray\n " ]
Please provide a description of the function:def hooi(X, rank, **kwargs): # init options ainit = kwargs.pop('init', __DEF_INIT) maxIter = kwargs.pop('maxIter', __DEF_MAXITER) conv = kwargs.pop('conv', __DEF_CONV) dtype = kwargs.pop('dtype', X.dtype) if not len(kwargs) == 0: raise Va...
[ "\n Compute Tucker decomposition of a tensor using Higher-Order Orthogonal\n Iterations.\n\n Parameters\n ----------\n X : tensor_mixin\n The tensor to be decomposed\n rank : array_like\n The rank of the decomposition for each mode of the tensor.\n The length of ``rank`` must ...
Please provide a description of the function:def uttkrp(self, U, mode): N = self.ndim if mode == 1: R = U[1].shape[1] else: R = U[0].shape[1] W = np.tile(self.lmbda, 1, R) for i in range(mode) + range(mode + 1, N): W = W * dot(self.U[...
[ "\n Unfolded tensor times Khatri-Rao product for Kruskal tensors\n\n Parameters\n ----------\n X : tensor_mixin\n Tensor whose unfolding should be multiplied.\n U : list of array_like\n Matrices whose Khatri-Rao product should be multiplied.\n mode : i...
Please provide a description of the function:def norm(self): N = len(self.shape) coef = outer(self.lmbda, self.lmbda) for i in range(N): coef = coef * dot(self.U[i].T, self.U[i]) return np.sqrt(coef.sum())
[ "\n Efficient computation of the Frobenius norm for ktensors\n\n Returns\n -------\n norm : float\n Frobenius norm of the ktensor\n " ]