diff --git a/.gitignore b/.gitignore index a2667a7..ef30f33 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ -spicemodule.c +_spice.so +spicemodule.c* build *.pyc cspice +SMAP_ref_150529_180529.bsp +makespk05 diff --git a/getnaifspicetoolkit.py b/getnaifspicetoolkit.py index 63478ee..1821b8c 100755 --- a/getnaifspicetoolkit.py +++ b/getnaifspicetoolkit.py @@ -100,7 +100,7 @@ def getnstkurl(force=None,log=False): ### SUNOS and SUN4U => SunSPARC_Solaris ### - dSys1 = dict( OSX=dict( I386='MacIntel', PPC='MacPPC', sis2='OSX', zSfx='tar.Z' ) + dSys1 = dict( OSX=dict( X86_64='MacIntel', I386='MacIntel', PPC='MacPPC', sis2='OSX', zSfx='tar.Z' ) , LINUX=dict( I386='PC', X86_64='PC', sis2='Linux', zSfx='tar.Z' ) , CYGWIN=dict( I386='PC', X86_64='PC', sis2='Cygwin', zSfx='tar.Z' ) , WINDOWS=dict( I386='PC', X86_64='PC', sis2='Windows', zSfx='zip' ) diff --git a/mkwrapper.py b/mkwrapper.py index 43673c2..8111c36 100644 --- a/mkwrapper.py +++ b/mkwrapper.py @@ -14,8 +14,13 @@ # $Id$ import os, sys +import traceback +import pprint from cStringIO import StringIO +spiceintType = 'BAD' +spiceintType1 = 'B' + # This is a parameter class that is used to hold all the information about a # parameter. Initially there is nothing in it. The object is populated with # arbritrary information as the items are needed. This is controlled using @@ -34,11 +39,28 @@ def __setattr__(self, key, val): # generate the wrappers. function_types = ('ConstSpiceChar', 'SpiceBoolean', 'SpiceChar', 'SpiceDouble', 'SpiceInt', 'void') +### fix for output arguments mislabeled as inputs in source files +### - Key is variable name (e.g. 'c') +### - Value is tuple of toolkit routine names (e.g. 'whtevr_c') where that +### variable name should be an output but is labeled as an input +### in the -Brief_I/O sections of the source file +mislabeled_outputs = dict( c=('wndifd_c','wnintd_c','wnunid_c',) + , mout=('xpose_c','xpose6_c',) + ) + +fixparam = dict( cvals=dict( gcpool_c='SpiceChar * cvals') + ) + +### Rename these to something else RESERVED_NAMES = ('free',) # Reasons for excluding the following functions -# appnd*, etc. - not looked into translating a SpiceCell to a python object yet. -# axisar_c - haven't written code to parse arrays +### N0065 +# edterm_c - TEMPORARY: new function in N0065, can't handle [ ] +# illumg_c - no .c in V0065? +# spkw20_c - problem with cdata[] +# utf_c - for internal use by GF system only +### # bodvar_c - deprecated # bschoc_c, etc. - how to support const void * array # ckw05_c - how to support SpiceCK05Subtype @@ -48,16 +70,20 @@ def __setattr__(self, key, val): # dasec_c - how to handle void types in parameter list # dafgh_c - does function actually exist? I found no C file ... # ucase_c - not needed for python -# gfevnt_c, gffove_c, gfocce_c, gfuds_c, uddc_c, uddf_c - how to support callbacks +# gfevnt_c, gffove_c, gfocce_c, gfudb_c, gfuds_c, uddc_c, uddf_c - how to support callbacks exclude_list = ( - 'cnames', - 'appndc_c', 'appndd_c', 'appndi_c', 'zzsynccl_c', + ### N0065 + 'edterm_c', 'illumg_c', 'spkw20_c' + , 'udf_c' + , + + 'cnames', 'bodvar_c', 'bschoc_c', 'bsrchc_c', 'dafac_c', 'dafec_c', 'dasac_c', 'ekacec_c', - 'ekaclc_c', 'ekbseg_c', 'zzgetcml_c', 'ekifld_c', 'ekucec_c', 'esrchc_c', + 'ekaclc_c', 'ekbseg_c', 'ekifld_c', 'ekucec_c', 'esrchc_c', 'getelm_c', 'isrchc_c', 'kxtrct_c', 'lmpool_c', 'lstlec_c', 'lstltc_c', 'mequg_c', 'mtxmg_c', 'mtxvg_c', 'mxmg_c', 'mtmtg_c', 'mxmtg_c', 'mxvg_c', 'orderc_c', 'pcpool_c', 'swpool_c', 'vtmvg_c', 'xposeg_c', @@ -72,23 +98,27 @@ def __setattr__(self, key, val): 'ckw01_c', 'ckw02_c', 'ckw03_c', 'spk14a_c', 'spkw02_c', 'spkw03_c', 'spkw05_c', 'spkw08_c', 'spkw09_c', 'spkw10_c', 'spkw12_c', 'spkw13_c', - 'dasec_c', 'ekpsel_c', 'ekrcec_c', 'gcpool_c', 'gnpool_c', + 'dasec_c', 'ekpsel_c', 'ekrcec_c', 'gnpool_c', 'dafgh_c', 'prefix_c', 'lcase_c', 'ucase_c', 'getcml_c', 'lparse_c', 'lparsm_c', 'prompt_c', 'putcml_c', 'reordc_c', 'shellc_c', 'sumad_c', 'sumai_c', - 'gfevnt_c', 'gffove_c', 'gfocce_c', 'gfuds_c', 'uddc_c', 'uddf_c', + 'gfevnt_c', 'gffove_c', 'gfocce_c', 'gfudb_c', 'gfuds_c', 'uddc_c', 'uddf_c', ) module_defs = [] cspice_src = None -DEBUG = 0 # set it on when string is the right one +DEBUG = 'DEBUG_MKWRAPPER' in os.environ # set it on when string is the right one INPUT_TYPE = 0 OUTPUT_TYPE = 1 +INOUTPUT_TYPE = 2 + +IOTYPE = { 'I':INPUT_TYPE, 'O':OUTPUT_TYPE, 'I/O': INOUTPUT_TYPE, 'I-O': INOUTPUT_TYPE, 'I,O': INOUTPUT_TYPE } +IOTYPEkeys = IOTYPE.keys() def debug(string): if DEBUG: sys.stderr.write("%s\n" % str(string)) @@ -110,10 +140,12 @@ def determine_py_type(param_obj): elif type in ('ConstSpiceDouble', 'SpiceDouble'): param_obj.py_string = 'd' elif type in ('ConstSpiceBoolean', 'SpiceBoolean'): - param_obj.py_string = 'i' + param_obj.py_string = 'O' + param_obj.get_py_fn = 'get_py_boolean' elif type in ('ConstSpiceInt', 'SpiceInt'): - # put a long for a spice int since they are long integers - param_obj.py_string = 'l' + # Use an "l" or an "i" from the SpiceInt typedef + global spiceintType1 + param_obj.py_string = spiceintType1 elif type == 'SpiceCell': param_obj.py_string = 'O' param_obj.spice_obj = 'Cell' @@ -139,6 +171,9 @@ def determine_py_type(param_obj): param_obj.spice_obj = 'Plane' param_obj.get_py_fn = 'get_py_plane' param_obj.get_spice_fn = 'get_spice_plane' + elif type in ('int'): + param_obj.py_string = 'i' + sys.stderr.write('Warning: suspect type: %s for %s\n' % (type,param_obj.name,)) elif type in ('void'): param_obj.py_string = '' else: @@ -155,7 +190,10 @@ def get_doc(function_name): '-Detailed_Output', ] - src_file = "%s/%s.c" % (cspice_src, function_name) + if function_name[-1:]=='_': + src_file = "%s/%s.c" % (cspice_src, function_name[:-1]) + else: + src_file = "%s/%s.c" % (cspice_src, function_name) if os.path.exists(src_file): f = open(src_file, 'r') @@ -218,16 +256,140 @@ def gen_wrapper(prototype, buffer): # returns a container object with all the information parsed up. prototype_obj = parse_prototype(prototype) + ### Save function name to shorter local variable + funcnm = prototype_obj.function_name + + ### Do not make interfaces for + ### - FORTRAN-replacement f2c routines, named *_ + ### - CSPICE private routines, named zz* + if funcnm[-1:]=='_': return False + if funcnm[:2]=='zz': return False + # check the exclude list before continuing - if prototype_obj.function_name in exclude_list: return False + if funcnm in exclude_list: return False + + # dig out the document string from the source file + doc = get_doc(funcnm) + + ### From doc string, get I, I/O or O for each argument + ### from text between lines containing -Brief_I/O and + ### -Detailed_Input + + ### E.g. with the following sample text, populate the + ### dictionary as follows: + + ### ioDict = dict(keywd='I', string='I/O', substr='O') + + ###... + ###-Brief_I/O + ### + ### VARIABLE I/O DESCRIPTION + ### -------- --- -------------------------------------------------- + ### center, + ### vec1, + ### vec2 I Center and two generating vectors for an ellipse. + ### v1, v2 I Input vectors. + ### keywd I Word that marks the beginning of text of interest. + ### string I/O String containing a sequence of words, and + ### this is a line that starts with more than 10 spaces + ### substr O String from end of keywd to beginning of first + ### + ### The function returns ... + ### + ###-Detailed_Input + ###... + + ioDict = Container() + ioDict.defArgSequence = [] + + sentinelStart = '-Brief_I/O' + sentinelEnd = '-Detailed_Input' + sentinels = [ sentinelStart, sentinelEnd ] + toks = doc.split('\\n') ### + sentinels + toks.reverse() + + try: + + for sentinel in sentinels: + + bridesmaids = [] + + for lin in iter( lambda: toks.pop().rstrip(' \r '), sentinel ): + + ### Skip if + + ### - this is not between the Start and End sentinels + if sentinel!=sentinelEnd: continue + + ### - line starts with 10 spaces + if not lin[:10].split(): + bridesmaids = [] + continue + + ### - line has fewer than three tokens + lintoks = lin.split() + if len(lintoks)<3: + + ### For single-token lines, if token ends with a continuation comma, + ### then add it to bridesmaids for addition to ioDict with next + ### line that has I, O or I/O defined + if len(lintoks)==1 and lintoks[0][-1:]==',': + bridesmaids += [ lintoks[0][:-1].lower() ] + + continue + + argnames, io = lintoks[:2] + + toks2 = argnames.split(',') + while len(toks2)>1: bridesmaids += [ toks2.pop(0) ] + argname = toks2[0] + + ### - argname is empty (should not be possible) + if len(argname)<1: + bridesmaids = [] + continue + + if not ( io.upper() in IOTYPEkeys ): + bridesmaids = [] + continue + + argname = argname.lower() + io = io.upper() + + ### - argname has uppercase in it + if argname != lintoks[0]: + if argname=='variable': continue + fmt = "### %%s case argument: %s? [%s]" % (lintoks[0], str(dict(func=funcnm,lin=lin,sentinel=sentinel)),) + if argname.upper() != lintoks[0]: + pass ##print( fmt % "Mixed" ) + else: + pass ##print( fmt % "Upper" ) + + ### If second token (toks[1] == io) is I, I/O or O, + ### then add it to IO dictionary, after bridesmaids + + bridesmaids.append( argname ) + ###print( (bridesmaids,argname,) ) + ioDict.defArgSequence += bridesmaids + while bridesmaids: ioDict[bridesmaids.pop(0)] = io + ###print( (bridesmaids,ioDict,) ) + + ioDict.ioDictStatus = 'success' + + ### Protect against absence of a sentinel when + except: + ioDict['__STATUS__'] = 'failure' + traceback.print_exc() + pass # the string that is passed to PyArg_ParseTuple for getting the # arguments list and Py_BuildValue for returning results parse_tuple_string = "" + extra_parse_tuple_string = "" buildvalue_string = "" # remove the _c suffix for the python function name - python_function_name = prototype_obj.function_name.rsplit('_c',1)[0] + python_function_name = funcnm.rsplit('_c',1)[0] # Add the C function prototype to the source code output. t = '/* %s */' % prototype @@ -242,33 +404,77 @@ def gen_wrapper(prototype, buffer): if t: prototype_comment_list.append(t) - prototype_comment = '\n'.join(prototype_comment_list) + ### Indent comments after the first to make them slightly easier to read + pfx = '\n' + ( ' '*(5 + len(prototype.split('(')[0])) ) + + prototype_comment = pfx.join(prototype_comment_list) # declare the function for this wrapper buffer.write( "\n%s\nstatic PyObject * spice_%s(PyObject *self, PyObject *args)\n{" % \ (prototype_comment, python_function_name)); + + buffer.write( "\n /* %s */\n" % ( str(ioDict),) ) + # split up the inputs from the outputs so that only inputs have to # be provided to the function from python and the outputs are # returned to python, e.g. et = utc2et("SOME DATE") - last_item = None - t_type = None + ###last_item = None + ###t_type = None + t_type = INPUT_TYPE for param in prototype_obj.params: #debug('') - param_info = parse_param(param) + + if param == 'void': + if len(prototype_obj.params)>1: + sys.stderr.write('Warning: void argument in list of more than one argument from %s()\n' % (funcnm,) ) + continue + + debug( "%s: %s" % (funcnm,str(param),) ) + param_info = parse_param(param,funcnm=funcnm) if param_info is None: + sys.stderr.write( "### Could not parse_param: '%s'\n" % ( str(param), ) ) continue - #debug("parsed param: %s" % param_info) - - if param_info.is_array and not param_info.is_const: - t_type = OUTPUT_TYPE - elif param_info.is_const or not param_info.is_pointer: - t_type = INPUT_TYPE - elif param_info.is_pointer: - t_type = OUTPUT_TYPE + #debug("parsed %s() param: %s" % (funcnm,param_info,) ) + + ### New code (BTCarcich, 2012-01): + if True: + try: + + ### Handle nconsistencies in argument names between declarations + ### in CSPICE headers and in CSPICE functions in *_c.c + + ioDictArgName = ioDict.defArgSequence.pop(0) + + override='' + if ioDictArgName in mislabeled_outputs: + if funcnm in mislabeled_outputs[ioDictArgName]: + override = ' /* N.B. OUTPUT MISLABELED AS INPUT IN (-Brief_I/O section)\n of %s.c HAS BEEN OVERRIDDEN: */\n' % funcnm + ioDict[ioDictArgName] = 'O' + + if not (param_info.name in ioDict): + ioDict[param_info.name] = ioDict[ioDictArgName] + + buffer.write( '\n%s /* %s() using param_type ioDict["%s"]=%s for %s */' % ( override, funcnm, ioDictArgName, ioDict[ioDictArgName], param_info.name, ) ) + + t_type = IOTYPE[ioDict[param_info.name]] + + except: + traceback.print_exc() + print( dict(func=funcnm,ioDict=ioDict,param=param) ) + raise Exception("I don't know if %s is an input or output" % param) + + ### Disabled old code: else: - raise Exception("I don't know if %s is an input or output" % param) + if param_info.is_array and not param_info.is_const: + t_type = OUTPUT_TYPE + elif param_info.is_const or not param_info.is_pointer: + t_type = INPUT_TYPE + elif param_info.is_pointer: + t_type = OUTPUT_TYPE + else: + raise Exception("I don't know if %s is an input or output" % param) # tack the parameter type onto the param_info tuple param_info.param_type = t_type @@ -280,20 +486,22 @@ def gen_wrapper(prototype, buffer): # TODO: This is a HUGE hack and would be nice to find an alternate # way of deciding this). - if last_item is not None and \ - t_type == INPUT_TYPE and last_item.param_type == OUTPUT_TYPE: - output_list.remove(last_item) - input_list.append(last_item) + ###if last_item is not None and \ + ### t_type == INPUT_TYPE and last_item.param_type == OUTPUT_TYPE: + ### output_list.remove(last_item) + ### input_list.append(last_item) - if t_type == INPUT_TYPE: + if t_type == INPUT_TYPE or t_type == INOUTPUT_TYPE: input_list.append(param_info) - else: + + if t_type == OUTPUT_TYPE or t_type == INOUTPUT_TYPE: output_list.append(param_info) - last_item = param_info + ###last_item = param_info #debug("param after hack: %s" % param_info) #debug("") + #debug( pprint.pformat( (funcnm,dict(inp=input_list,out=output_list,),) ) ) # parse the outputs if output_list: @@ -307,18 +515,24 @@ def gen_wrapper(prototype, buffer): # # the allocate_memory variable points to the last input variable, which # should be the variable pointing to the max number of items in the array - if prototype_obj.function_name.startswith('bodv'): + if funcnm.startswith('bodv'): output_list[-1].make_pointer = True output_list[-1].allocate_memory = input_list[-1].name manually_build_returnVal = True pass + py_to_c_conversions = []; + extra_inoutput_name_list = [] + for output in output_list: #print output # declare the variable buffer.write("\n %s" % output.type) + if output.type=='SpiceCell': + output.make_pointer = True + if output.make_pointer: buffer.write(" *") @@ -339,6 +553,17 @@ def gen_wrapper(prototype, buffer): buffer.write(";") + # if this output has a get_spice_fn function associated with it, + # and is a SpiceCell, and is an output only, then in reality it + # will need an input argument to define its size, so declare a + # variable for the conversion + if output.type=='SpiceCell' and output.get_spice_fn and output.param_type==OUTPUT_TYPE: + py_output_name = "py_%s" % output.name + buffer.write("\n PyObject * %s = NULL;" % py_output_name) + py_to_c_conversions.append("%s = %s(%s);" % (output.name, output.get_spice_fn, py_output_name)) + extra_inoutput_name_list.append( py_output_name ) + extra_parse_tuple_string += output.py_string + output_name_list.append(output.name) # parse the inputs @@ -348,7 +573,6 @@ def gen_wrapper(prototype, buffer): # in the loop below, the variables are being declared as type # 'reg_type'. this is because python was not properly parsing the # arguments passed in from Python when using SPICE variable types. - py_to_c_conversions = []; for input in input_list: input_name = input.name @@ -359,6 +583,7 @@ def gen_wrapper(prototype, buffer): buffer.write("\n %s %s = STRING_LEN;" % \ (input.reg_type, input_name) ) + else: parse_tuple_string += input.py_string @@ -367,14 +592,16 @@ def gen_wrapper(prototype, buffer): else: pointer_string = " " - buffer.write("\n %s%s%s" % ( - input.reg_type, pointer_string, input_name)) + ### if this is both an input and an output, then do not declare it + if input.param_type == INPUT_TYPE: + buffer.write("\n %s%s%s" % ( + input.reg_type, pointer_string, input_name)) - if input.is_array: - for count in input.num_elements: - buffer.write("[%s]" % count) + if input.is_array: + for count in input.num_elements: + buffer.write("[%s]" % count) - buffer.write(";") + buffer.write(";") # if this input has a get_spice_fn function associated with it, # declare a variable for the conversion @@ -396,10 +623,14 @@ def gen_wrapper(prototype, buffer): buffer.write('\n\n char failed = 0;') if not manually_build_returnVal and output_list: - buffer.write('\n char buildvalue_string[STRING_LEN] = "";') + if len(output_list)!=1 or output_list[0].name!='found': + buffer.write('\n char buildvalue_string[STRING_LEN] = "";') + + if output_list and ( len(output_list) != 1 or output_list[0].name!='found' ): + buffer.write('\n PyObject *returnVal;') # configure the input string list for parsing the args tuple - input_list_string = "&" + ", &".join(input_name_list) + input_list_string = "&" + ", &".join( input_name_list + extra_inoutput_name_list ) # if the function type is not void, declare a variable for the # result. @@ -417,26 +648,29 @@ def gen_wrapper(prototype, buffer): # generate the PyArg_ParseTuple call if there were any inputs to # this function - if input_name_list: + if input_name_list+extra_inoutput_name_list: buffer.write( ('\n PYSPICE_CHECK_RETURN_STATUS(' + 'PyArg_ParseTuple(args, "%s", %s));') % \ - (parse_tuple_string, input_list_string)) + (parse_tuple_string+extra_parse_tuple_string, input_list_string)) # if there are any Python -> C conversions that need to occur, add them here. if py_to_c_conversions: - buffer.write('\n %s\n' % '\n'.join(py_to_c_conversions)) + buffer.write('\n %s\n' % '\n '.join(py_to_c_conversions)) for output in output_list: # see if memory needs to be allocated for this variable if output.allocate_memory: - buffer.write("\n\n %s = malloc(sizeof(%s) * %s);" % \ + buffer.write("\n\n %s = PyMem_Malloc(sizeof(%s) * %s);" % \ (output.name, output.type, output.allocate_memory)) # build the input name list for calling the C function input_name_list = [] for input in input_list: - input_name_list.append(input.name) + + ### if this is both an input and an output, then do not declare it + if input.param_type == INPUT_TYPE: + input_name_list.append(input.name) # combine the input name list and the output name list for the C # function call @@ -450,6 +684,7 @@ def gen_wrapper(prototype, buffer): for output in output_list: if any([output.is_array, output.type == "SpiceChar", + output.make_pointer, output.allocate_memory]): t_list.append(output.name) else: @@ -473,9 +708,9 @@ def gen_wrapper(prototype, buffer): # Call the C function if prototype_obj.type != "void": - buffer.write("\n result = %s(%s);" % (prototype_obj.function_name, param_list_string)) + buffer.write("\n result = %s(%s);" % (funcnm, param_list_string)) else: - buffer.write("\n %s(%s);" % (prototype_obj.function_name, param_list_string)) + buffer.write("\n %s(%s);" % (funcnm, param_list_string)) # run the macro to check to see if an exception was raised. once the # check is made, see if the failed boolean was set. this is an indication @@ -486,7 +721,7 @@ def gen_wrapper(prototype, buffer): for output in output_list: if output.allocate_memory: - buffer.write('\n free(%s);' % output.name) + buffer.write('\n PyMem_Free(%s);' % output.name) buffer.write('\n return NULL;') buffer.write('\n }\n') @@ -504,8 +739,10 @@ def gen_wrapper(prototype, buffer): '"%s", %s);') % (output.py_string, output.name) ) elif output.name != 'found': + if output.is_array==1 and output.py_string=='s': sfx='#' + else : sfx='' buffer.write( - '\n strcat(buildvalue_string, "%s");' % output.py_string + '\n strcat(buildvalue_string, "%s%s");' % (output.py_string,sfx,) ) buffer.write('\n') @@ -533,9 +770,6 @@ def gen_wrapper(prototype, buffer): buffer.write("\n}"); - # dig out the function name from the source file - doc = get_doc(prototype_obj.function_name) - if not doc: buffer.write('\nPyDoc_STRVAR(%s_doc, "");\n' % python_function_name) else: @@ -545,7 +779,9 @@ def gen_wrapper(prototype, buffer): module_defs.append('{"%s", spice_%s, METH_VARARGS, %s_doc},' % \ (python_function_name, python_function_name, python_function_name)) - return buffer.getvalue() + ### Callers only check for True or false; buffer argument is modified in place + return True + ### Old: return buffer.getvalue() def get_array_sizes(list, name): """ @@ -576,7 +812,6 @@ def make_automatic_returnVal(buffer, output_list): # put together the outputs t_list = [] - buildvalue_string = '' # Check_found is used to indicate whether a found variable was # passed along with other output variables. check_found is set to @@ -596,36 +831,43 @@ def make_automatic_returnVal(buffer, output_list): ) else: check_found = True + + # Do not add found to the t_list and output_list_string vars continue # If the output is an array, expand out all the elements in order # to build a python tuple out of them (This seems sub-optimal, I # have to read some more python C documentation). if output.is_array: - t_list += get_array_sizes(output.num_elements, output.name) + if output.is_array==1 and output.py_string=='s': + t_list.append(output.name) + t_list.append(str(output.num_elements[0])) + else: + t_list += get_array_sizes(output.num_elements, output.name) elif(output.get_py_fn): - t_list.append('%s(&%s)' % (output.get_py_fn, output.name)) + if(output.type=='SpiceCell'): + t_list.append('%s(%s)' % (output.get_py_fn, output.name)) + else: + t_list.append('%s(&%s)' % (output.get_py_fn, output.name)) else: t_list.append(output.name) - buildvalue_string += output.py_string - output_list_string = ", ".join(t_list) if output_list_string: if check_found: buffer.write( - '\n if(!found) {\n return Py_None;\n } else {\n ') + '\n if(!found) {\n Py_INCREF(Py_None);\n return Py_None;\n } else {\n ') else: buffer.write('\n ') buffer.write( - 'PyObject *returnVal = Py_BuildValue(buildvalue_string, %s);' % \ + 'returnVal = Py_BuildValue(buildvalue_string, %s);' % \ (output_list_string)) for output in output_list: if output.allocate_memory: - buffer.write('\n free(%s);' % output.name) + buffer.write('\n PyMem_Free(%s);' % output.name) buffer.write('\n return returnVal;'); @@ -640,10 +882,10 @@ def make_manual_returnVal(buffer, output_list): this function can be used. """ - buffer.write('\n int i = 0;') + buffer.write('\n {\n int i = 0;') buffer.write('\n PyObject *t = NULL;') buffer.write( - '\n PyObject *returnVal = PyTuple_New(%d);' % len(output_list)) + '\n returnVal = PyTuple_New(%d);' % len(output_list)) count = 0; for count in range(len(output_list)): @@ -666,7 +908,7 @@ def make_manual_returnVal(buffer, output_list): (count, output.py_string, output.name) ) - buffer.write('\n return returnVal;'); + buffer.write('\n }\n return returnVal;'); def get_type(type): reg_type = type @@ -680,7 +922,8 @@ def get_type(type): reg_type = 'char' elif type in ('ConstSpiceInt', 'SpiceInt'): # put a long for a spice int since they are long integers - reg_type = 'long' + global spiceintType + reg_type = spiceintType return reg_type @@ -718,7 +961,7 @@ def fixNameCollision(name): else: return name -def parse_param(param): +def parse_param(param,funcnm=False): """ Take the given parameter and break it up into the type of variable, the variable name and whether it's a pointer. @@ -816,6 +1059,12 @@ def parse_param(param): name = name[0:name_bracket_pos] param_obj.name = fixNameCollision(name) + + if funcnm and (name in fixparam): + if funcnm in fixparam[name]: + sys.stderr.write("Overriding %s(... %s) with (... %s)" % (funcnm,param,fixparam[name][funcnm],)) + return parse_param( fixparam[name][funcnm]) + param_obj.is_array = len(param_obj.num_elements) determine_py_type(param_obj) @@ -826,11 +1075,13 @@ def parse_param(param): #debug('is_array: %s' % str(param_obj.is_array)) #debug('py_string: %s' % param_obj.py_string) - if param_obj.is_array: + if param_obj.is_array and ( param_obj.is_array>1 or param_obj.py_string!='s' ): param_obj.py_string = get_tuple_py_string(param_obj) return param_obj except Exception, msg: + import traceback + traceback.print_exc() if type == 'void': return None else: @@ -951,7 +1202,6 @@ def main(cspice_toolkit): global cspice_src parsing_prototype = False - curr_prototype = '' module_methods = StringIO() buffer = StringIO() @@ -966,12 +1216,14 @@ def main(cspice_toolkit): # preprocess the header file output = StringIO() - run_command('gcc -E %s' % cspice_header, output) + run_command('gcc -E %s | tee spiceusr.i' % cspice_header, output) output.reset() used_prototypes = 0 total_prototypes = 0; line_no = 0 + import re + rgx = re.compile( '^ *typedef [^ ]* SpiceInt; *$' ) while 1: input = output.readline() line_no +=1 @@ -980,50 +1232,49 @@ def main(cspice_toolkit): break input = input.strip() + ### Ignore blank lines if input == "": continue - # if parsing still false and line does not have opening bracket - elif not parsing_prototype and "(" not in input: + + ### Look for typedef ... SpiceInt; + ### - If found, save the type and format string, and continue + elif rgx.match(input): + global spiceintType + global spiceintType1 + spiceintType = input.split()[1] + spiceintType1 = spiceintType[0] continue - if parsing_prototype: + + ### If already parsing a prototype, append to current prototype + elif parsing_prototype: # #debug("parse_adding: %s" % input) curr_prototype += input # #debug("curr_prototype now: %s" % curr_prototype) - # if the last character is a semi-colon, the prototype is - # complete, pass it along to the wrapper generator and clear - # out the curr_prototype variable - if input.endswith(";"): - parsing_prototype = False - - # gen_wrapper can return False, then don't count it as used - #debug('') - #debug('%s\n' % curr_prototype) - if gen_wrapper(curr_prototype, buffer): - used_prototypes += 1 - total_prototypes += 1 - - curr_prototype = "" - pass - else: + ### If an opening parenthesis is found, and if first word is + ### a type used for functions, then start a new prototype + elif "(" in input: first_word = input[0:input.index(" ")] # #debug('first_word: {0}'.format(first_word)) if first_word in function_types: # #debug("adding %s" % input) - curr_prototype += input + curr_prototype = input + parsing_prototype = True # #debug("curr_prototype now: %s" % curr_prototype) - else: - continue - if input.endswith(";"): - # #debug("prototype to be wrapped: {0}".format(curr_prototype)) - gen_wrapper(curr_prototype, buffer) - curr_prototype = "" - else: - parsing_prototype = True + + + # if the last character is a semi-colon, the prototype is + # complete, pass it along to the wrapper generator + if parsing_prototype and input.endswith(";"): + # #debug("prototype to be wrapped: {0}".format(curr_prototype)) + if gen_wrapper(curr_prototype, buffer): used_prototypes += 1 + total_prototypes += 1 + parsing_prototype = False + sys.stderr.write("prototypes used: %d, total: %d\n" % (used_prototypes, total_prototypes)) # put together the methods array @@ -1059,7 +1310,7 @@ def main(cspice_toolkit): /* Don't allow an exception to stop execution */ erract_c("SET", 0, "RETURN"); - errdev_c("SET", 0, "NULL"); + //errdev_c("SET", 0, "NULL"); SpiceException = \ PyErr_NewException("_spice.SpiceException", PyExc_Exception, NULL); diff --git a/pyspice.c b/pyspice.c index 4b855b6..79bebc8 100644 --- a/pyspice.c +++ b/pyspice.c @@ -40,6 +40,11 @@ static PyObject * get_double_list(double *array, const int count) return list; } +PyObject * get_py_boolean(SpiceBoolean* spicebool) +{ + return Py_BuildValue( "O", *spicebool ? Py_True : Py_False); +} + /** * Create a Python Ellipse object from a SpiceEllipse object */ @@ -65,11 +70,121 @@ PyObject * get_py_ellipse(SpiceEllipse *spice_obj) return py_obj; } -PyObject * get_py_cell(SpiceCell *cell) +#define XCLEAN(PYO) if ( PYO ) { Py_DECREF(PYO); PYO = NULL; } + +#define ALLCLEAN \ + XCLEAN( pymodule ) \ + XCLEAN( py_cls ) \ + XCLEAN( pytooplArgs ) \ + XCLEAN( pydiktKw ) \ + XCLEAN( pybase ) \ + XCLEAN( pydata ) \ + XCLEAN( pyitem ) \ + if ( cell && dofree) PyMem_Free( cell ) + +#define RTNNULL \ + { XCLEAN( py_obj ) \ + ALLCLEAN; \ + return NULL; \ + } + +PyObject * get_py_cell_freeopt(SpiceCell *cell, int dofree) { PyObject *py_obj = NULL; + PyObject *pymodule = NULL; + PyObject *py_cls = NULL; + PyObject *pytooplArgs = NULL; + PyObject *pydiktKw = NULL; + PyObject *pybase = NULL; + PyObject *pydata = NULL; + PyObject *pyitem = NULL; + + Py_ssize_t i; + int itemLen; + + switch (cell->dtype) { + case SPICE_CHR: itemLen = cell->length * sizeof(SpiceChar); break; + case SPICE_INT: itemLen = sizeof(SpiceInt); break; + case SPICE_DP: itemLen = sizeof(SpiceDouble); break; + + case SPICE_TIME: //itemLen = sizeof(SpiceDouble); break; + case SPICE_BOOL: //itemLen = sizeof(SpiceBoolean); break; + default: RTNNULL + } + + if ( !(pymodule = PyImport_ImportModule("spice")) ) RTNNULL + if ( !(py_cls = PyObject_GetAttrString(pymodule, "Cell")) ) RTNNULL + if ( !(pytooplArgs = Py_BuildValue( "(ii)", (int)cell->dtype, (int)cell->size)) ) RTNNULL + if ( !(pydiktKw = Py_BuildValue( "{s:i}", "lenArg", cell->length)) ) RTNNULL + if ( !(py_obj = PyObject_Call(py_cls, pytooplArgs, pydiktKw)) ) RTNNULL + if ( !(pybase = PyObject_GetAttrString( py_obj, "base")) ) RTNNULL + if ( !(pydata = PyObject_GetAttrString( py_obj, "data")) ) RTNNULL + +# define XI(ATTR) PyObject_SetAttrString(py_obj, #ATTR, PyInt_FromLong((long)cell->ATTR)); +# define XB(ATTR) PyObject_SetAttrString(py_obj, #ATTR, get_py_boolean(&cell->ATTR) ); + XI(dtype) + XI(length) + XI(size) + XI(card) + XB(isSet) + XB(adjust) + XB(init) + //printf( " after:" ); + //printf( "Cell.card=%ld", PyInt_AsLong( PyObject_GetAttrString(py_obj, "card") ) ); + //printf( "; Cell.init=%s", PyObject_GetAttrString(py_obj,"init")==Py_True?" True":"False" ); + //printf( "; cell->card=%ld", (long)cell->card); + //printf( "; cell->init=%s", cell->init?"True ":"False"); + //printf( "; err=%s\n", PyErr_Occurred() ? "Yes" : "No " ); +# undef XI +# undef XB + + switch( cell->dtype ) { + + case SPICE_CHR: + + for ( i=0; i<(SPICE_CELL_CTRLSZ+cell->size); ++i ) { + if ( !(pyitem = PyString_FromStringAndSize( cell->base+(i*itemLen), (Py_ssize_t)cell->length)) ) RTNNULL + if ( -1==PyList_SetItem( isize); ++i ) { + if ( !(pyitem = PyInt_FromLong( (long) ((SpiceInt*)cell->base)[i] ) ) ) RTNNULL + if ( -1==PyList_SetItem( isize); ++i ) { + if ( !(pyitem = PyFloat_FromDouble( (double) ((SpiceDouble*)cell->base)[i] )) ) RTNNULL + if ( -1==PyList_SetItem( icenter, spice_ellipse->semiMajor, spice_ellipse->semiMinor}; @@ -171,7 +430,7 @@ SpiceEllipse * get_spice_ellipse(PyObject *ellipse) } if(failed) { - free(spice_ellipse); + PyMem_Free(spice_ellipse); spice_ellipse = NULL; } @@ -208,7 +467,7 @@ PyObject * spice_berto(PyObject *self, PyObject *args) py_ellipse = get_py_ellipse(spice_ellipse); - free(spice_ellipse); + PyMem_Free(spice_ellipse); return py_ellipse; } @@ -223,7 +482,7 @@ PyObject * spice_test(PyObject *self, PyObject *args) plane = get_spice_plane(py_obj); PyObject *py_obj2 = get_py_plane(plane); - free(plane); + PyMem_Free(plane); return py_obj2; } diff --git a/pyspice.h b/pyspice.h index 5c2dbcd..40013ac 100644 --- a/pyspice.h +++ b/pyspice.h @@ -33,9 +33,9 @@ extern PyObject *SpiceException; /* Stuff for getting the short error message #define SPICE_MESSAGE_LEN 25 char *spice_msg = NULL; \ -spice_msg = (char *)malloc(sizeof(char) * SPICE_MESSAGE_LEN); \ +spice_msg = (char *)PyMem_Malloc(sizeof(char) * SPICE_MESSAGE_LEN); \ getmsg_c("short", SPICE_MESSAGE_LEN, spice_msg); \ -free(spice_msg); \ +PyMem_Free(spice_msg); \ */ #define PYSPICE_CHECK_FAILED { \ @@ -44,7 +44,7 @@ free(spice_msg); \ \ /* check if the function call failed */ \ if(failed_c()) { \ - spice_detail = (char *)malloc(sizeof(char) * SPICE_DETAIL_LEN); \ + spice_detail=(char *)PyMem_Malloc(sizeof(char)*SPICE_DETAIL_LEN); \ \ getmsg_c("long", SPICE_DETAIL_LEN, spice_detail); \ \ @@ -52,13 +52,14 @@ free(spice_msg); \ \ PYSPICE_MAKE_EXCEPTION(spice_detail); \ \ - free(spice_detail); \ + PyMem_Free(spice_detail); \ \ failed = 1; \ } \ } /* Functions defined in the implementation file */ +PyObject * get_py_boolean(SpiceBoolean* spicebool); PyObject * get_py_ellipse(SpiceEllipse *spice_obj); PyObject * get_py_cell(SpiceCell *cell); PyObject * get_py_ekattdsc(SpiceEKAttDsc *spice_obj); diff --git a/setup.py b/setup.py index 3649d97..7b3656a 100644 --- a/setup.py +++ b/setup.py @@ -77,7 +77,7 @@ def set_build_paths(): for flag, dirname in (('-I', 'include'), ('-L', 'lib')): path = os.path.join(CSPICE_SRC, dirname) - sys.argv.append('%s%s' % (flag, path)) + #sys.argv.append('%s%s' % (flag, path)) try: build_cspice() @@ -88,6 +88,8 @@ def set_build_paths(): module1 = Extension( '_spice', sources = ['pyspice.c', 'spicemodule.c'], + include_dirs = [os.path.join(CSPICE_SRC,'include')], + library_dirs = [os.path.join(CSPICE_SRC,'lib')], libraries = ['cspice'], ) diff --git a/spice/objects.py b/spice/objects.py index 3bbcbae..36383cd 100644 --- a/spice/objects.py +++ b/spice/objects.py @@ -1,27 +1,49 @@ # Released under the BSD license, see LICENSE for details class DataType(object): + """ + SPICE_* and * quantities must match enumeration _SpiceDataType from + cspice/include/SpiceZdf.h + """ + SPICE_CHR = 0 + SPICE_DP = 1 + SPICE_INT = 2 + SPICE_TIME = 3 + SPICE_BOOL = 4 + CHR = 0 + DP = 1 + INT = 2 + TIME = 3 + BOOL = 4 def __init__(self): - self.SPICE_CHR = 0 - self.SPICE_DP = 1 - self.SPICE_INT = 2 - self.SPICE_TIME = 3 - self.SPICE_BOOL = 4 + pass class Cell(object): - CellDataType = DataType - - def __init__(self, arg): - self.dtype = self.CellDataType() - self.length = 0 - self.size = 0 + baseSize = 6 + minCharLen = 6 + def __init__(self, dtArg, szArg, lenArg=minCharLen): + dtLcl = int(dtArg) + lenLcl = 0 + if dtLcl==DataType.SPICE_CHR: + lenLcl = int(lenArg) + if lenLcl',timeout=3 ) + + sl( 'PAGE' ) + rtn = ex( ['PAGING toggled OFF','PAGING toggled ON',pexpect.TIMEOUT], timeout=3) + + if rtn>0: + sl( 'PAGE' ) + rtn = ex( ['PAGING toggled OFF','PAGING toggled ON',pexpect.TIMEOUT], timeout=3) + + if rtn == 2: return rtn,pe.before + + sl( target+nl ) + rtn = ex( ['\[S]PK', pexpect.TIMEOUT], timeout=3) + if rtn > 0: return rtn,pe.before + + sl( 'SPK' ) + rtn = ex( ['e-mail address', pexpect.TIMEOUT], timeout=3) + if rtn > 0: return rtn,pe.before + + sl( 'pexpect@python.org'+nl ) + rtn = ex( ['text transfer.*YES, NO,', pexpect.TIMEOUT], timeout=3) + if rtn > 0: return rtn,pe.before + + sl( 'NO' ) + rtn = ex( ['START', pexpect.TIMEOUT], timeout=3) + if rtn > 0: return rtn,pe.before + + sl( '2000-01-01' ) + rtn = ex( ['STOP', pexpect.TIMEOUT], timeout=3) + if rtn > 0: return rtn,pe.before + + sl( '2020-01-01' ) + rtn = ex( ['Add more objects to file', pexpect.TIMEOUT], timeout=3) + if rtn > 0: return rtn,pe.before + + sl( 'NO' ) + rtn = ex( [nl+' *Full path *:', pexpect.TIMEOUT], timeout=3) + if rtn > 0: return rtn,pe.before + + rtn = ex( ['[\r\n]', pexpect.TIMEOUT], timeout=3) + if rtn > 0: return rtn,pe.before + + url = pe.before.strip('\n\r ') + + rtn = ex( ['\n *Select ', pexpect.TIMEOUT], timeout=3) + if rtn > 0: return -1,url + + sl( '' ) + rtn = ex( ['Horizons>', pexpect.TIMEOUT], timeout=3) + if rtn > 0: return -2,url + + sl( 'quit' ) + rtn = ex( ['Connection closed', pexpect.TIMEOUT], timeout=3) + if rtn > 0: return -3,url + + return rtn,url + +def brief(fn): + pe = pexpect.spawn( 'brief -n -t -c %s' % (fn,) ) + ex = pe.expect + rtn = ex( ['\n-+ +-+ +-+\r*\n',pexpect.TIMEOUT], timeout=1) + if rtn > 0: return 1,pe.before + rtn = ex( [' w[.]r[.]t[.] ',pexpect.TIMEOUT], timeout=1) + if rtn > 0: return 1,pe.before + return int(pe.before),'SUCCESS' + +def gomain(target): + fn = '_'.join( re.split('[^-a-zA-Z0-9]',target) )+'_pexpect.bsp' + spiceId = 0 + msgs = ['Horizons lookup FAILED' + ,'SPK retrieval not attempted' + ,'SPICE Body ID not attempted' + ] + + try: + + r,url = horizons(target) + + if r>0: + msgs[0] = 'Horizons lookup FAILED status=%d, URL=%s' % (r,url,) + else: + msgs[0] = 'Horizons lookup status=%d, URL=%s' % (r,url,) + + msgs[1] = 'SPK retrieval FAILED' + msgs[1] = '### Retrieved SPK (URL=%s) as %s' % (url, urllib.urlretrieve(url,fn)[0],) + + msgs[2] = 'SPICE Body ID FAILED' + spiceId,status = brief(fn) + msgs[2] = '### Retrieved SPICEID %d; status=%s' % (spiceId,status,) + + except: + pass + + return fn,spiceId,msgs + +if __name__=="__main__": + for itarget in sys.argv[1:]: + itarget = itarget.strip() + print( gomain(itarget) ) + diff --git a/tests/kernels/makespk05.c b/tests/kernels/makespk05.c new file mode 100644 index 0000000..b0cbb8e --- /dev/null +++ b/tests/kernels/makespk05.c @@ -0,0 +1,61 @@ +// Create SMAP SPK smap_test.c + +// Requires LSK and smap_v00.tf with EARTH_SUN_ORBIT reference frame + +// build command assumes this file is in PySPICE/tests/kernels/, +// and that ../../cspice/ has CSPICE + +// gcc -I../../cspice/include makespk05.c ../../cspice/lib/cspice.a -lm -o makespk05 + +#include +#include "SpiceUsr.h" + +int +main() { +SpiceChar body[] = { "SMAP" }; +SpiceDouble a = 7058.0; +SpiceDouble ecc = .0142; +SpiceDouble rp = a * (1.0 - ecc); +SpiceDouble inc = 0.0; +SpiceDouble lnode = 0.0; +SpiceDouble argp = 0.0; +SpiceDouble m0 = 0.0; +SpiceDouble mu = 398600.4418; +SpiceDouble gm = mu; +SpiceDouble elts[8] = { rp,ecc,inc,lnode,argp,m0,0.0,mu }; +SpiceInt iBody; +SpiceInt iCenter; +SpiceInt n = 2; +SpiceChar frame[] = { "EARTH_SUN_ORBIT" }; +SpiceChar segid[] = { "SMAP test SPK; requires EARTH_SUN_ORBIT" }; +SpiceChar ifname[] = { "SMAP test SPK; requires frame EARTH_SUN_ORBIT (1420599)" }; +SpiceChar filename[] = { "smap_test.bsp" }; +SpiceInt handle; +SpiceBoolean found; +SpiceDouble epochs[2]; +SpiceDouble *first = epochs; +SpiceDouble *last = epochs+1; +SpiceDouble states[2][6]; + + furnsh_c( "naif0010.tls" ); + furnsh_c( "smap_v00.tf" ); + + bodn2c_c(body,&iBody,&found); + bodn2c_c("EARTH",&iCenter,&found); + + utc2et_c( "2015-01-01T12:00:00", first ); + utc2et_c( "2020-01-01T12:00:00", last ); + + elts[6] = *first; + + conics_c( elts, *first, states[0]); + conics_c( elts, *last, states[1]); + + spkopn_c( filename, ifname, 0, &handle ); + spkw05_c( handle, iBody, iCenter, frame, *first, *last, segid, gm, n, states, epochs ); + spkcls_c( handle ); + + unload_c( "tests/kernels/naif00010.tls" ); + unload_c( "tests/kernels/smap_v00.tf" ); + return 0; +} diff --git a/tests/kernels/naif0010.tls b/tests/kernels/naif0010.tls new file mode 100644 index 0000000..89372b0 --- /dev/null +++ b/tests/kernels/naif0010.tls @@ -0,0 +1,144 @@ +KPL/LSK + + +LEAPSECONDS KERNEL FILE +=========================================================================== + +Modifications: +-------------- + +2012, Jan. 5 NJB Modified file to account for the leapsecond that + will occur on June 30, 2012. + +2008, Jul. 7 NJB Modified file to account for the leapsecond that + will occur on December 31, 2008. + +2005, Aug. 3 NJB Modified file to account for the leapsecond that + will occur on December 31, 2005. + +1998, Jul 17 WLT Modified file to account for the leapsecond that + will occur on December 31, 1998. + +1997, Feb 22 WLT Modified file to account for the leapsecond that + will occur on June 30, 1997. + +1995, Dec 14 KSZ Corrected date of last leapsecond from 1-1-95 + to 1-1-96. + +1995, Oct 25 WLT Modified file to account for the leapsecond that + will occur on Dec 31, 1995. + +1994, Jun 16 WLT Modified file to account for the leapsecond on + June 30, 1994. + +1993, Feb. 22 CHA Modified file to account for the leapsecond on + June 30, 1993. + +1992, Mar. 6 HAN Modified file to account for the leapsecond on + June 30, 1992. + +1990, Oct. 8 HAN Modified file to account for the leapsecond on + Dec. 31, 1990. + + +Explanation: +------------ + +The contents of this file are used by the routine DELTET to compute the +time difference + +[1] DELTA_ET = ET - UTC + +the increment to be applied to UTC to give ET. + +The difference between UTC and TAI, + +[2] DELTA_AT = TAI - UTC + +is always an integral number of seconds. The value of DELTA_AT was 10 +seconds in January 1972, and increases by one each time a leap second +is declared. Combining [1] and [2] gives + +[3] DELTA_ET = ET - (TAI - DELTA_AT) + + = (ET - TAI) + DELTA_AT + +The difference (ET - TAI) is periodic, and is given by + +[4] ET - TAI = DELTA_T_A + K sin E + +where DELTA_T_A and K are constant, and E is the eccentric anomaly of the +heliocentric orbit of the Earth-Moon barycenter. Equation [4], which ignores +small-period fluctuations, is accurate to about 0.000030 seconds. + +The eccentric anomaly E is given by + +[5] E = M + EB sin M + +where M is the mean anomaly, which in turn is given by + +[6] M = M + M t + 0 1 + +where t is the number of ephemeris seconds past J2000. + +Thus, in order to compute DELTA_ET, the following items are necessary. + + DELTA_TA + K + EB + M0 + M1 + DELTA_AT after each leap second. + +The numbers, and the formulation, are taken from the following sources. + + 1) Moyer, T.D., Transformation from Proper Time on Earth to + Coordinate Time in Solar System Barycentric Space-Time Frame + of Reference, Parts 1 and 2, Celestial Mechanics 23 (1981), + 33-56 and 57-68. + + 2) Moyer, T.D., Effects of Conversion to the J2000 Astronomical + Reference System on Algorithms for Computing Time Differences + and Clock Rates, JPL IOM 314.5--942, 1 October 1985. + +The variable names used above are consistent with those used in the +Astronomical Almanac. + +\begindata + +DELTET/DELTA_T_A = 32.184 +DELTET/K = 1.657D-3 +DELTET/EB = 1.671D-2 +DELTET/M = ( 6.239996D0 1.99096871D-7 ) + +DELTET/DELTA_AT = ( 10, @1972-JAN-1 + 11, @1972-JUL-1 + 12, @1973-JAN-1 + 13, @1974-JAN-1 + 14, @1975-JAN-1 + 15, @1976-JAN-1 + 16, @1977-JAN-1 + 17, @1978-JAN-1 + 18, @1979-JAN-1 + 19, @1980-JAN-1 + 20, @1981-JUL-1 + 21, @1982-JUL-1 + 22, @1983-JUL-1 + 23, @1985-JUL-1 + 24, @1988-JAN-1 + 25, @1990-JAN-1 + 26, @1991-JAN-1 + 27, @1992-JUL-1 + 28, @1993-JUL-1 + 29, @1994-JUL-1 + 30, @1996-JAN-1 + 31, @1997-JUL-1 + 32, @1999-JAN-1 + 33, @2006-JAN-1 + 34, @2009-JAN-1 + 35, @2012-JUL-1 ) + +\begintext + + diff --git a/tests/kernels/pck00009.tpc b/tests/kernels/pck00009.tpc new file mode 100644 index 0000000..bfadaab --- /dev/null +++ b/tests/kernels/pck00009.tpc @@ -0,0 +1,3639 @@ +KPL/PCK + + +P_constants (PcK) SPICE kernel file +=========================================================================== + + By: Nat Bachman (NAIF) 2010 March 3 + + +Purpose +-------------------------------------------------------- + + This file makes available for use in SPICE-based application + software orientation and size/shape data for natural bodies. The + principal source of the data is a published report by the IAU/IAG + Working Group on Cartographic Coordinates and Rotational Elements [1]. + + Orientation and size/shape data not provided by this file may be + available in mission-specific PCK files. Such PCKs may be the preferred + data source for mission-related applications. Mission-specific PCKs can + be found in PDS archives or on the NAIF web site at URL: + + http://naif.jpl.nasa.gov + + +File Organization +-------------------------------------------------------- + + The contents of this file are as follows. + + Introductory Information: + + -- Purpose + + -- File Organization + + -- Version description + + -- Disclaimer + + -- Sources + + -- Explanatory notes + + -- Body numbers and names + + + PcK Data: + + + Orientation Data + ---------------- + + -- Orientation constants for the Sun and planets. + Additional items included in this section: + + - Earth north geomagnetic centered dipole values + for epochs 1945-2000 + + - Mars prime meridian offset "lambda_a" + + -- Orientation constants for satellites + + -- Orientation constants for asteroids Eros, Gaspra, Ida, + Itokawa, and Vesta + + -- Orientation constants for comets 19P/Borrelly + and 9P/Tempel 1 + + + Radii of Bodies + --------------- + + -- Radii of Sun and planets + + -- Radii of satellites, where available + + -- Radii of asteroids Ceres, Eros, Gaspra, Ida, Itokawa, + Mathilde, Toutatis, and Vesta. + + -- Radii of comets 19P/Borrelly, Halley, 9P/Tempel 1, + and 81P/Wild 2 + + + +Version Description +-------------------------------------------------------- + + This file was created on March 3, 2010. This version + incorporates data from reference [1]. + + This file contains size, shape, and orientation data for all + objects described by the previous version of the file, except + for Kleopatra: a shape model for this body is not provided in [1] + because, according to this source, it had been "modeled from + low resolution radar data, and cannot be mapped from those + data." + + New objects covered by this file but not the previous + version are: + + 19P/Borrelly + Halley + 9P/Tempel 1 + 81P/Wild 2 + Ceres + Itokawa + Mathilde + Toutatis + + +Disclaimer +-------------------------------------------------------- + +Applicability of Data + + This P_constants file may not contain the parameter values that + you prefer. NAIF suggests that you inspect this file visually + before proceeding with any critical or extended data processing. + +File Modifications by Users + + Note that this file may be readily modified by you to change + values or add/delete parameters. NAIF requests that you update the + "by line," date, and version description section if you modify + this file. + +Known Limitations and Caveats + + Accuracy + -------- + + In general, the orientation models given here are claimed by the + IAU/IAG Working Group Report [1] to be accurate to 0.1 degree + ([1], p.158). However, NAIF notes that orientation models for + natural satellites and asteroids have in some cases changed + substantially with the availability of new observational data, so + users are urged to investigate the suitability for their + applications of the models presented here. + + Earth orientation + ----------------- + + NAIF strongly cautions against using the earth rotation model + (from [1]) for work demanding high accuracy. This model has been + determined by NAIF to have an error in the prime meridian location + of magnitude at least 150 arcseconds, with a local minimum + occurring during the year 1999. Regarding availability of better + earth orientation data for use with the SPICE system: + + Earth orientation data are available from NAIF in the form of + binary earth PCK files. NAIF employs an automated process to + create these files; each time JPL's Tracking Systems and + Applications Section produces a new earth orientation parameter + (EOP) file, a new PCK is produced. These PCKs cover a roughly + 10 year time span starting at Jan. 1, 2000. In these PCK files, + the following effects are accounted for in modeling the earth's + rotation: + + - Precession: 1976 IAU model + + - Nutation: 1980 IAU model, plus interpolated + EOP nutation corrections + + - Polar motion: interpolated from EOP file + + - True sidereal time: + + UT1 - UT1R (if needed): given by analytic formula + + TAI - UT1 (or UT1R): interpolated from EOP file + + UT1 - GMST: given by analytic formula + + equation of equinoxes: given by analytic formula + + where + + TAI = International Atomic Time + UT1 = Greenwich hour angle of computed mean sun - 12h + UT1R = Regularized UT1 + GMST = Greenwich mean sidereal time + + These kernels are available from the NAIF web site + + http://naif.jpl.nasa.gov + + (follow the links to Data, generic_kernels, and PCK data) or + + ftp://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck + + or via anonymous ftp from the server + + naif.jpl.nasa.gov + + The kernels are in the path + + pub/naif/generic_kernels/pck + + At this time, these kernels have file names of the form + + earth_000101_yymmdd_yymmdd.bpc + + The second and third dates are, respectively, the file's + coverage end time and the epoch of the last datum. + + These binary PCK files are very accurate (error < 0.1 + microradian) for epochs preceding the epoch of the last datum. + For later epochs, the error rises to several microradians. + + Binary PCK files giving accurate earth orientation from 1972 to + 2007 and *low accuracy* predicted earth orientation from + 2007 to 2037 are also available in the same location. See the + aareadme.txt file at the "pck" URL above for details. + + Characteristics and names of the binary kernels described here + are subject to change. See the "pck" URL above for information + on current binary earth PCKs. + + + Lunar orientation + ----------------- + + The lunar orientation formula provided by this file is a + trigonometric polynomial approximation yielding the orientation of + the lunar "Mean Earth/Polar Axis" (ME) reference frame. A more + accurate approximation can be obtained by using both the NAIF + lunar frame kernel and the binary lunar orientation PCK file, + which are available on the NAIF web site (see URLS above) + and in the NAIF server's ftp area. The lunar frame kernel + is located in the path + + pub/naif/generic_kernels/fk/satellites + + and has a name of the form + + moon_yymmdd.tf + + The binary lunar PCK is in the path + + pub/naif/generic_kernels/pck + + and has a name of the form + + moon_pa_dennn_yyyy-yyyy.bpc + + See the "aareadme.txt" files in the paths shown above for details + on file contents and versions. We also suggest you refer to the + SPICE tutorial named "lunar_earth_pck-fk," which is available from + the NAIF web site. + + + Earth geomagnetic dipole + ------------------------ + + The SPICE Toolkit doesn't currently contain software to model the + earth's north geomagnetic centered dipole as a function of time. + As a convenience for users, the north dipole location from the + J2000 epoch was selected as a representative datum, and the + planetocentric longitude and latitude of this location have been + associated with the keywords + + BODY399_N_GEOMAG_CTR_DIPOLE_LON + BODY399_N_GEOMAG_CTR_DIPOLE_LAT + + Values for the earth's north geomagnetic centered dipole are + presented in comments as a discrete time series for the time range + 1945-2000. For details concerning the geomagnetic field model from + which these values were derived, including a discussion of the + model's accuracy, see [9]. + + + Mars prime meridian offset + -------------------------- + + The Mars prime meridian offset given by [5] is not used by + SPICE geometry software for computations involving the shape + of Mars (for example, in sub-observer point or surface intercept + computations). The value is provided for informational + purposes only. + + + Software limitations + -------------------- + + SPICE Toolkits prior to version N0057 cannot make use of + trigonometric polynomial terms in the formulas for orientation of + the planets. The only planets for which such terms are used are + Jupiter and Neptune. Use of trigonometric polynomial terms for + natural satellites is and has been supported for all SPICE Toolkit + versions. + + The second nutation precession angle (M2) for Mars is represented + by a quadratic polynomial in the 2006 IAU report. The SPICELIB + subroutine BODEUL can not handle this term (which is extremely + small), so we truncate the polynomial to a linear one. The + resulting orientation error has a maximum magnitude of less + than 0.0032 degrees over the time span 1996-2015 and less than + 0.0082 degrees over the time span 1986-2025. + + +Sources +-------------------------------------------------------- + + The sources for the constants listed in this file are: + + + [1] Seidelmann, P.K., Archinal, B.A., A'Hearn, M.F., + Conrad, A., Consolmagno, G.J., Hestroffer, D., + Hilton, J.L., Krasinsky, G.A., Neumann, G., + Oberst, J., Stooke, P., Tedesco, E.F., Tholen, D.J., + and Thomas, P.C. "Report of the IAU/IAG Working Group + on cartographic coordinates and rotational elements: 2006." + + [2] Seidelmann, P.K., Archinal, B.A., A'Hearn, M.F., + Cruikshank, D.P., Hilton, J.L., Keller, H.U., Oberst, J., + Simon, J.L., Stooke, P., Tholen, D.J., and Thomas, P.C. + "Report of the IAU/IAG Working Group on Cartographic + Coordinates and Rotational Elements of the Planets and + Satellites: 2003." + + [3] Nautical Almanac Office, United States Naval Observatory + and H.M. Nautical Almanac Office, Rutherford Appleton + Laboratory (2010). "The Astronomical Almanac for + the Year 2010," U.S. Government Printing Office, + Washington, D.C.: and The Stationary Office, London. + + [4] Nautical Almanac Office, United States Naval Observatory, + H.M. Nautical Almanac Office, Royal Greenwich + Observatory, Jet Propulsion Laboratory, Bureau des + Longitudes, and The Time Service and Astronomy + Departments, United States Naval Observatory (1992). + "Explanatory Supplement to the Astronomical Almanac," P. + Kenneth Seidelmann, ed. University Science Books, 20 + Edgehill Road, Mill Valley, CA 9494. + + [5] Duxbury, Thomas C. (2001). "IAU/IAG 2000 Mars Cartographic + Conventions," presentation to the Mars Express Data + Archive Working Group, Dec. 14, 2001. + + [6] Russell, C.T. and Luhmann, J.G. (1990). "Earth: Magnetic + Field and Magnetosphere." . Originally + published in "Encyclopedia of Planetary Sciences," J.H. + Shirley and R.W. Fainbridge, eds. Chapman and Hall, + New York, pp 208-211. + + [7] Russell, C.T. (1971). "Geophysical Coordinate + Transformations," Cosmic Electrodynamics 2 184-186. + NAIF document 181.0. + + [8] ESA/ESTEC Space Environment Information System (SPENVIS) + (2003). Web page: "Dipole approximations of the + geomagnetic field." . + + [9] International Association of Geomagnetism and Aeronomy + and International Union of Geodesy and Geophysics (2004). + Web page: "The 9th Generation International Geomagnetic + Reference Field." . + + [10] Davies, M.E., Abalakin, V.K., Bursa, M., Hunt, G.E., + and Lieske, J.H. (1989). "Report of the IAU/IAG/COSPAR + Working Group on Cartographic Coordinates and Rotational + Elements of the Planets and Satellites: 1988," Celestial + Mechanics and Dynamical Astronomy, v.46, no.2, pp. + 187-204. + + + Most values are from [1]. All exceptions are + commented where they occur in this file. The exceptions are: + + + -- Radii for the Sun are from [3]. + + -- The second nutation precession angle (M2) for Mars is + represented by a quadratic polynomial in the 2000 + IAU report. The SPICELIB subroutine BODEUL can not + handle this term (which is extremely small), so we + truncate the polynomial to a linear one. + + -- Earth north geomagnetic centered dipole values are from + [8]. The article [6] was used to check most of + these values, and the values were also re-computed from + the 9th generation IGRF [9] by Nat Bachman. + + -- The Mars prime meridian offset angle is from [5]. + + + "Old values" listed are from the SPICE P_constants file + pck00008.tpc dated September 21, 2004. Most of these values came + from the 2003 IAU report [2]. + + + + +Explanatory Notes +-------------------------------------------------------- + + This file, which is logically part of the SPICE P-kernel, contains + constants used to model the orientation, size and shape of the + Sun, planets, natural satellites, and selected comets and + asteroids. The orientation models express the direction of the + pole and location of the prime meridian of a body as a function of + time. The size/shape models ("shape models" for short) represent + all bodies as ellipsoids, using two equatorial radii and a polar + radius. Spheroids and spheres are obtained when two or all three + radii are equal. + + The SPICE Toolkit routines that use this file are documented in + the SPICE "Required Reading" file pck.req. They are also + documented in the "PCK" SPICE tutorial, which is available on + the NAIF web site. + +File Format + + A terse description of the PCK file format is given here. See the + SPICE "Required Reading" files pck.req and kernel.req for a + detailed explanation of the SPICE text kernel file format. The + files pck.req and kernel.req are included in the documentation + provided with the SPICE Toolkit. + + The file starts out with the ``ID word'' string + + KPL/PCK + + This string identifies the file as a text kernel containing PCK + data. + + This file consists of a series of comment blocks and data blocks. + Comment blocks, which contain free-form descriptive or explanatory + text, are preceded by a \begintext token. Data blocks follow a + \begindata token. In order to be recognized, each of these tokens + must be placed on a line by itself. + + The portion of the file preceding the first data block is treated + as a comment block; it doesn't require an initial \begintext + token. + + This file identifies data using a series of + + KEYWORD = VALUE + + assignments. The left hand side of each assignment is a + "kernel variable" name; the right hand side is an associated value + or list of values. The SPICE subroutine API allows SPICE routines + and user applications to retrieve the set of values associated + with each kernel variable name. + + Kernel variable names are case-sensitive and are limited to + 32 characters in length. + + Numeric values may be integer or floating point. String values + are normally limited to 80 characters in length; however, SPICE + provides a mechanism for identifying longer, "continued" strings. + See the SPICE routine STPOOL for details. + + String values are single quoted. + + When the right hand side of an assignment is a list of values, + the list items may be separated by commas or simply by blanks. + The list must be bracketed by parentheses. Example: + + BODY399_RADII = ( 6378.14 6378.14 6356.75 ) + + Any blanks preceding or following keyword names, values and equal + signs are ignored. + + Assignments may be spread over multiple lines, for example: + + BODY399_RADII = ( 6378.14 + 6378.14 + 6356.75 ) + + This file may contain blank lines anywhere. Non-printing + characters including TAB should not be present in the file: the + presence of such characters may cause formatting errors when the + file is viewed. + +Time systems and reference frames + + The 2006 IAU/IAG Working Group Report [1] states the time scale + used as the independent variable for the rotation formulas is + Barycentric Dynamical Time (TDB) and that the epoch of variable + quantities is J2000 TDB (2000 Jan 1 12:00 TDB). Throughout SPICE + documentation and in this file, we use the names "J2000 TDB" and + "J2000" for this epoch. The name "J2000.0" is equivalent. + + SPICE documentation refers to the time system used in this file + as either "ET" or "TDB." SPICE software makes no distinction + between TDB and the time system associated with the independent + variable of the JPL planetary ephemerides T_eph. + + The inertial reference frame used for the rotational elements in + this file is identified by [1] as the ICRF (International + Celestial Reference Frame). + + The SPICE PCK software that reads this file uses the label "J2000" + to refer to the ICRF; this is actually a mislabeling which has + been retained in the interest of backward compatibility. Using + data from this file, by means of calls to the SPICE frame + transformation routines, will actually compute orientation + relative to the ICRF. + + The difference between the J2000 frame and the ICRF is + on the order of tens of milliarcseconds and is well below the + accuracy level of the formulas in this file. + +Orientation models + + All of the orientation models use three Euler angles to describe + the orientation of the coordinate axes of the "Body Equator and + Prime Meridian" system with respect to an inertial system. By + default, the inertial system is the ICRF (labeled as "J2000"), but + other frames can be specified in the file. See the PCK Required + Reading for details. + + The first two angles, in order, are the ICRF right ascension and + declination (henceforth RA and DEC) of the north pole of a body as + a function of time. The third angle is the prime meridian location + (represented by "W"), which is expressed as a rotation about the + north pole, and is also a function of time. + + For each body, the expressions for the north pole's right + ascension and declination, as well as prime meridian location, are + sums (as far as the models that appear in this file are concerned) + of quadratic polynomials and trigonometric polynomials, where the + independent variable is time. + + In this file, the time arguments in expressions always refer to + Barycentric Dynamical Time (TDB), measured in centuries or days + past a reference epoch. By default, the reference epoch is the + J2000 epoch, which is Julian ephemeris date 2451545.0, but other + epochs can be specified in the file. See the PCK Required Reading + for details. + + Orientation models for satellites and some planets (including + Jupiter) involve both polynomial terms and trigonometric terms. + The arguments of the trigonometric terms are linear polynomials. + In this file, we call the arguments of these trigonometric terms + "nutation precession angles." + + Example: 2006 IAU Model for orientation of Jupiter. Note that + these values are used as an example only; see the data area below + for current values. + + Right ascension + --------------- + + alpha = 268.056595 - 0.006499 T + 0.000117 sin(Ja) + 0 + 0.000938 sin(Jb) + 0.001432 sin(Jc) + + 0.000030 sin(Jd) + 0.002150 sin(Je) + + Declination + ----------- + + delta = 64.495303 + 0.002413 T + 0.000050 cos(Ja) + 0 + 0.000404 cos(Jb) + 0.000617 cos(Jc) + - 0.000013 cos(Jd) + 0.000926 cos(Je) + + Prime meridian + -------------- + + W = 284.95 + 870.5366420 d + + + Here + + T represents centuries past J2000 ( TDB ), + + d represents days past J2000 ( TDB ). + + Ja-Je are nutation precession angles. + + In this file, the polynomials' coefficients above are assigned + to kernel variable names (left-hand-side symbols) as follows + + BODY599_POLE_RA = ( 268.056595 -0.006499 0. ) + BODY599_POLE_DEC = ( 64.495303 0.002413 0. ) + BODY599_PM = ( 284.95 870.5366420 0. ) + + and the trigonometric polynomials' coefficients are assigned + as follows + + BODY599_NUT_PREC_RA = ( 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.000117 + 0.000938 + 0.001432 + 0.000030 + 0.002150 ) + + BODY599_NUT_PREC_DEC = ( 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.000050 + 0.000404 + 0.000617 + -0.000013 + 0.000926 ) + + BODY599_NUT_PREC_PM = ( 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.0 + 0.0 + 0.0 + 0.0 + 0.0 ) + + Note the number "599"; this is the NAIF ID code for Jupiter. + + In this file, the polynomial expressions for the nutation + precession angles are listed along with the planet's RA, DEC, and + prime meridian terms. Below are the 2006 IAU nutation precession + angles for the Jupiter system. + + J1 = 73.32 + 91472.9 T + J2 = 24.62 + 45137.2 T + J3 = 283.90 + 4850.7 T + J4 = 355.80 + 1191.3 T + J5 = 119.90 + 262.1 T + J6 = 229.80 + 64.3 T + J7 = 352.25 + 2382.6 T + J8 = 113.35 + 6070.0 T + + J9 = 146.64 + 182945.8 T + J10 = 49.24 + 90274.4 T + + Ja = 99.360714 + 4850.4046 T + Jb = 175.895369 + 1191.9605 T + Jc = 300.323162 + 262.5475 T + Jd = 114.012305 + 6070.2476 T + Je = 49.511251 + 64.3000 T + + Here + + T represents centuries past J2000 ( TDB ) + + J1-J10 and Ja-Je are the nutation precession angles. The angles + J9 and J10 are equal to 2*J1 and 2*J2, respectively. + + Angles J9 and J10 are not present in [1]; they have been added + to fit the terms 2*J1 and 2*J2, which appear in the orientation + models of several satellites, into a form that can be accepted + by the PCK system. + + The assignment of the nutation precession angles for the + Jupiter system is as follows: + + BODY5_NUT_PREC_ANGLES = ( 73.32 91472.9 + 24.62 45137.2 + 283.90 4850.7 + 355.80 1191.3 + 119.90 262.1 + 229.80 64.3 + 352.25 2382.6 + 113.35 6070.0 + 146.64 182945.8 + 49.24 90274.4 + 99.360714 4850.4046 + 175.895369 1191.9605 + 300.323162 262.5475 + 114.012305 6070.2476 + 49.511251 64.3000 ) + + You'll see an additional symbol grouped with the ones listed + above; it is + + BODY599_LONG_AXIS + + This term is zero for all bodies except Mars. It represents the + angular offset between the meridian containing the longest axis of + the triaxial ellipsoid used to model a body's surface and the + prime meridian of the body. + + The pattern of the formulas for satellite orientation is similar + to that for Jupiter. Example: 2006 IAU values for Io. Again, these + values are used as an example only; see the data area below for + current values. + + Right ascension + --------------- + + alpha = 268.05 - 0.009 T + 0.094 sin(J3) + 0.024 sin(J4) + 0 + + Declination + ----------- + + delta = 64.50 + 0.003 T + 0.040 cos(J3) + 0.011 cos(J4) + 0 + + Prime meridian + -------------- + + W = 200.39 + 203.4889538 d - 0.085 sin(J3) - 0.022 sin(J4) + + + d represents days past J2000. + + J3 and J4 are nutation precession angles. + + The polynomial terms are assigned to symbols by the statements + + BODY501_POLE_RA = ( 268.05 -0.009 0. ) + BODY501_POLE_DEC = ( 64.50 0.003 0. ) + BODY501_PM = ( 200.39 203.4889538 0. ) + + The coefficients of the trigonometric terms are assigned to symbols by + the statements + + BODY501_NUT_PREC_RA = ( 0. 0. 0.094 0.024 ) + BODY501_NUT_PREC_DEC = ( 0. 0. 0.040 0.011 ) + BODY501_NUT_PREC_PM = ( 0. 0. -0.085 -0.022 ) + + 501 is the NAIF ID code for Io. + + SPICE software expects the models for satellite orientation to + follow the form of the model shown here: the polynomial portions of the + RA, DEC, and W expressions are expected to be quadratic, the + trigonometric terms for RA and W (satellite prime meridian) are expected + to be linear combinations of sines of nutation precession angles, the + trigonometric terms for DEC are expected to be linear combinations of + cosines of nutation precession angles, and the polynomials for the + nutation precession angles themselves are expected to be linear. + + Eventually, the software will handle more complex expressions, we + expect. + + +Shape models + + There is only one kind of shape model supported by the SPICE Toolkit + software at present: the triaxial ellipsoid. The 2006 IAU report does + not use any other models, except in the case of Mars, where + separate values are given for the north and south polar radii. + + For each body, three radii are listed: The first number is + the largest equatorial radius (the length of the semi-axis + containing the prime meridian), the second number is the smaller + equatorial radius, and the third is the polar radius. + + Example: Radii of the Earth. + + BODY399_RADII = ( 6378.14 6378.14 6356.75 ) + + +Body Numbers and Names +-------------------------------------------------------- + + + 1 Mercury barycenter + 2 Venus barycenter + 3 Earth barycenter + 4 Mars barycenter + 5 Jupiter barycenter + 6 Saturn barycenter + 7 Uranus barycenter + 8 Neptune barycenter + 9 Pluto barycenter + 10 Sun + + + 199 Mercury + + + 299 Venus + + + 399 Earth + + 301 Moon + + + 499 Mars + + 401 Phobos 402 Deimos + + + 599 Jupiter + + 501 Io 502 Europa 503 Ganymede 504 Callisto + 505 Amalthea 506 Himalia 507 Elara 508 Pasiphae + 509 Sinope 510 Lysithea 511 Carme 512 Ananke + 513 Leda 514 Thebe 515 Adrastea 516 Metis + + + 699 Saturn + + 601 Mimas 602 Enceladus 603 Tethys 604 Dione + 605 Rhea 606 Titan 607 Hyperion 608 Iapetus + 609 Phoebe 610 Janus 611 Epimetheus 612 Helene + 613 Telesto 614 Calypso 615 Atlas 616 Prometheus + 617 Pandora 618 Pan + + + 799 Uranus + + 701 Ariel 702 Umbriel 703 Titania 704 Oberon + 705 Miranda 706 Cordelia 707 Ophelia 708 Bianca + 709 Cressida 710 Desdemona 711 Juliet 712 Portia + 713 Rosalind 714 Belinda 715 Puck + + + 899 Neptune + + 801 Triton 802 Nereid 803 Naiad 804 Thalassa + 805 Despina 806 Galatea 807 Larissa 808 Proteus + + + 999 Pluto + + 901 Charon + + + 1000005 Comet 19P/Borrelly + 1000036 Comet Halley + 1000093 Comet 9P/Tempel 1 + 1000107 Comet 81P/Wild 2 + + 2000001 Asteroid Ceres + 2000004 Asteroid Vesta + 2000216 Asteroid Kleopatra + 2000253 Asteroid Mathilde + 2000433 Asteroid Eros + 2004179 Asteroid Toutatis + 2025143 Asteroid Itokawa + 2431010 Asteroid Ida + 9511010 Asteroid Gaspra + + +Orientation Constants for the Sun and Planets +-------------------------------------------------------- + + +Sun + + Old values: + + Values are from the 2003 IAU report. + + + body10_pole_ra = ( 286.13 0. 0. ) + body10_pole_dec = ( 63.87 0. 0. ) + body10_pm = ( 84.10 14.18440 0. ) + body10_long_axis = ( 0. ) + + Current values: + + \begindata + + BODY10_POLE_RA = ( 286.13 0. 0. ) + BODY10_POLE_DEC = ( 63.87 0. 0. ) + BODY10_PM = ( 84.176 14.18440 0. ) + BODY10_LONG_AXIS = ( 0. ) + + \begintext + +Mercury + + Old values: + + Values are unchanged in the 2006 IAU report. + + + Current values: + + \begindata + + BODY199_POLE_RA = ( 281.01 -0.033 0. ) + BODY199_POLE_DEC = ( 61.45 -0.005 0. ) + BODY199_PM = ( 329.548 6.1385025 0. ) + + BODY199_LONG_AXIS = ( 0. ) + + \begintext + + +Venus + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY299_POLE_RA = ( 272.76 0. 0. ) + BODY299_POLE_DEC = ( 67.16 0. 0. ) + BODY299_PM = ( 160.20 -1.4813688 0. ) + + BODY299_LONG_AXIS = ( 0. ) + + \begintext + + +Earth + + Old values: + + Values are unchanged in the 2006 report. + + + Current values: + + \begindata + + BODY399_POLE_RA = ( 0. -0.641 0. ) + BODY399_POLE_DEC = ( 90. -0.557 0. ) + BODY399_PM = ( 190.147 360.9856235 0. ) + BODY399_LONG_AXIS = ( 0. ) + + \begintext + + + Nutation precession angles for the Earth-Moon system: + + The linear coefficients have been scaled up from degrees/day + to degrees/century, because the SPICELIB PCK reader expects + these units. The original constants were: + + 125.045D0 -0.0529921D0 + 250.089D0 -0.1059842D0 + 260.008D0 13.0120009D0 + 176.625D0 13.3407154D0 + 357.529D0 0.9856003D0 + 311.589D0 26.4057084D0 + 134.963D0 13.0649930D0 + 276.617D0 0.3287146D0 + 34.226D0 1.7484877D0 + 15.134D0 -0.1589763D0 + 119.743D0 0.0036096D0 + 239.961D0 0.1643573D0 + 25.053D0 12.9590088D0 + + + \begindata + + + BODY3_NUT_PREC_ANGLES = ( 125.045 -1935.5364525000 + 250.089 -3871.0729050000 + 260.008 475263.3328725000 + 176.625 487269.6299850000 + 357.529 35999.0509575000 + 311.589 964468.4993100000 + 134.963 477198.8693250000 + 276.617 12006.3007650000 + 34.226 63863.5132425000 + 15.134 -5806.6093575000 + 119.743 131.8406400000 + 239.961 6003.1503825000 + 25.053 473327.7964200000 ) + + + \begintext + + + Earth north geomagnetic centered dipole: + + Old values: + + Values are from [7]. Note the year of publication was 1971. + + body399_mag_north_pole_lon = ( -69.761 ) + body399_mag_north_pole_lat = ( 78.565 ) + + + Current values: + + The north dipole location is time-varying. The values shown + below, taken from [8], represent a discrete sampling of the + north dipole location from 1945 to 2000. The terms DGRF and + IGRF refer to, respectively, "Definitive Geomagnetic + Reference Field" and "International Geomagnetic Reference + Field." See references [6], [8], and [9] for details. + + Coordinates are planetocentric. + + Data source Lat Lon + ----------- ----- ------ + DGRF 1945 78.47 291.47 + DGRF 1950 78.47 291.15 + DGRF 1955 78.46 290.84 + DGRF 1960 78.51 290.53 + DGRF 1965 78.53 290.15 + DGRF 1970 78.59 289.82 + DGRF 1975 78.69 289.53 + DGRF 1980 78.81 289.24 + DGRF 1985 78.97 289.10 + DGRF 1990 79.13 288.89 + IGRF 1995 79.30 288.59 + IGRF 2000 79.54 288.43 + + + Values are given for the epoch 2000 and are from the final row + of the above table, which is from [8]. As shown by the table + these values constitute a low-accuracy approximation for epochs + not close to 2000. + + \begindata + + BODY399_N_GEOMAG_CTR_DIPOLE_LON = ( 288.43 ) + BODY399_N_GEOMAG_CTR_DIPOLE_LAT = ( 79.54 ) + + \begintext + + +Mars + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY499_POLE_RA = ( 317.68143 -0.1061 0. ) + BODY499_POLE_DEC = ( 52.88650 -0.0609 0. ) + BODY499_PM = ( 176.630 350.89198226 0. ) + + \begintext + + Source [5] specifies the following value for the lambda_a term + (BODY499_LONG_AXIS ) for Mars. This term is the POSITIVE EAST + LONGITUDE, measured from the prime meridian, of the meridian + containing the longest axis of the reference ellipsoid. + (CAUTION: previous values were POSITIVE WEST.) + + body499_long_axis = ( 252. ) + + We list this lambda_a value for completeness. The IAU report + [1] gives equal values for both equatorial radii, so the + lambda_a offset does not apply to the IAU model. + + The 2003 IAU report defines M2, the second nutation precession angle, + by: + + 2 + 192.93 + 1128.4096700 d + 8.864 T + + We truncate the M2 series to a linear expression, because the PCK + software cannot handle the quadratic term. + + Again, the linear terms are scaled by 36525.0: + + -0.4357640000000000 --> -15916.28010000000 + 1128.409670000000 --> 41215163.19675000 + -1.8151000000000000E-02 --> -662.9652750000000 + + We also introduce a fourth nutation precession angle, which + is the pi/2-complement of the third angle. This angle is used + in computing the prime meridian location for Deimos. See the + discussion of this angle below in the section containing orientation + constants for Deimos. + + \begindata + + BODY4_NUT_PREC_ANGLES = ( 169.51 -15916.2801 + 192.93 41215163.19675 + 53.47 -662.965275 + 36.53 662.965275 ) + + \begintext + + +Jupiter + + Old values: + + Values are from the 2003 IAU report. + + + body599_pole_ra = ( 268.05 -0.009 0. ) + body599_pole_dec = ( 64.49 0.003 0. ) + body599_pm = ( 284.95 870.5366420 0. ) + body599_long_axis = ( 0. ) + + body5_nut_prec_angles = ( 73.32 91472.9 + 24.62 45137.2 + 283.90 4850.7 + 355.80 1191.3 + 119.90 262.1 + 229.80 64.3 + 352.35 2382.6 + 113.35 6070.0 + 146.64 182945.8 + 49.24 90274.4 ) + + + + Current values: + + The number of nutation precession angles is 15. The ninth and + tenth are twice the first and second, respectively. The + eleventh through fifteenth correspond to angles JA-JE in + the 2006 IAU report; angles JA-JE were not used prior to that + report. + + \begindata + + + BODY599_POLE_RA = ( 268.056595 -0.006499 0. ) + BODY599_POLE_DEC = ( 64.495303 0.002413 0. ) + BODY599_PM = ( 284.95 870.5366420 0. ) + BODY599_LONG_AXIS = ( 0. ) + + BODY599_NUT_PREC_RA = ( 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.000117 + 0.000938 + 0.001432 + 0.000030 + 0.002150 ) + + BODY599_NUT_PREC_DEC = ( 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.000050 + 0.000404 + 0.000617 + -0.000013 + 0.000926 ) + + BODY599_NUT_PREC_PM = ( 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.0 + 0.0 + 0.0 + 0.0 + 0.0 ) + + + BODY5_NUT_PREC_ANGLES = ( 73.32 91472.9 + 24.62 45137.2 + 283.90 4850.7 + 355.80 1191.3 + 119.90 262.1 + 229.80 64.3 + 352.25 2382.6 + 113.35 6070.0 + 146.64 182945.8 + 49.24 90274.4 + 99.360714 4850.4046 + 175.895369 1191.9605 + 300.323162 262.5475 + 114.012305 6070.2476 + 49.511251 64.3000 ) + \begintext + + +Saturn + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY699_POLE_RA = ( 40.589 -0.036 0. ) + BODY699_POLE_DEC = ( 83.537 -0.004 0. ) + BODY699_PM = ( 38.90 810.7939024 0. ) + BODY699_LONG_AXIS = ( 0. ) + + \begintext + + The first seven angles given here are the angles S1 + through S7 from the 2000 report; the eighth and + ninth angles are 2*S1 and 2*S2, respectively. + + + \begindata + + BODY6_NUT_PREC_ANGLES = ( 353.32 75706.7 + 28.72 75706.7 + 177.40 -36505.5 + 300.00 -7225.9 + 316.45 506.2 + 345.20 -1016.3 + 29.80 -52.1 + 706.64 151413.4 + 57.44 151413.4 ) + \begintext + + +Uranus + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY799_POLE_RA = ( 257.311 0. 0. ) + BODY799_POLE_DEC = ( -15.175 0. 0. ) + BODY799_PM = ( 203.81 -501.1600928 0. ) + BODY799_LONG_AXIS = ( 0. ) + + \begintext + + The first 16 angles given here are the angles U1 + through U16 from the 2000 report; the 17th and + 18th angles are 2*U11 and 2*U12, respectively. + + \begindata + + BODY7_NUT_PREC_ANGLES = ( 115.75 54991.87 + 141.69 41887.66 + 135.03 29927.35 + 61.77 25733.59 + 249.32 24471.46 + 43.86 22278.41 + 77.66 20289.42 + 157.36 16652.76 + 101.81 12872.63 + 138.64 8061.81 + 102.23 -2024.22 + 316.41 2863.96 + 304.01 -51.94 + 308.71 -93.17 + 340.82 -75.32 + 259.14 -504.81 + 204.46 -4048.44 + 632.82 5727.92 ) + + \begintext + + + +Neptune + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY899_POLE_RA = ( 299.36 0. 0. ) + BODY899_POLE_DEC = ( 43.46 0. 0. ) + BODY899_PM = ( 253.18 536.3128492 0. ) + BODY899_LONG_AXIS = ( 0. ) + + + BODY899_NUT_PREC_RA = ( 0.70 0. 0. 0. 0. 0. 0. 0. ) + BODY899_NUT_PREC_DEC = ( -0.51 0. 0. 0. 0. 0. 0. 0. ) + BODY899_NUT_PREC_PM = ( -0.48 0. 0. 0. 0. 0. 0. 0. ) + + \begintext + + The 2000 report defines the nutation precession angles + + N, N1, N2, ... , N7 + + and also uses the multiples of N1 and N7 + + 2*N1 + + and + + 2*N7, 3*N7, ..., 9*N7 + + In this file, we treat the angles and their multiples as + separate angles. In the kernel variable + + BODY8_NUT_PREC_ANGLES + + the order of the angles is + + N, N1, N2, ... , N7, 2*N1, 2*N7, 3*N7, ..., 9*N7 + + Each angle is defined by a linear polynomial, so two + consecutive array elements are allocated for each + angle. The first term of each pair is the constant term, + the second is the linear term. + + \begindata + + BODY8_NUT_PREC_ANGLES = ( 357.85 52.316 + 323.92 62606.6 + 220.51 55064.2 + 354.27 46564.5 + 75.31 26109.4 + 35.36 14325.4 + 142.61 2824.6 + 177.85 52.316 + 647.840 125213.200 + 355.700 104.632 + 533.550 156.948 + 711.400 209.264 + 889.250 261.580 + 1067.100 313.896 + 1244.950 366.212 + 1422.800 418.528 + 1600.650 470.844 ) + + \begintext + + + +Pluto + + Old values: + + Values are from the 2003 IAU report. + + BODY999_POLE_RA = ( 313.02 0. 0. ) + BODY999_POLE_DEC = ( 9.09 0. 0. ) + BODY999_PM = ( 236.77 -56.3623195 0. ) + BODY999_LONG_AXIS = ( 0. ) + + + Current values: + + \begindata + + BODY999_POLE_RA = ( 312.993 0. 0. ) + BODY999_POLE_DEC = ( 6.163 0. 0. ) + BODY999_PM = ( 237.305 -56.3625225 0. ) + BODY999_LONG_AXIS = ( 0. ) + + \begintext + + + + +Orientation constants for the satellites +-------------------------------------------------------- + + +Satellites of Earth + + Old values: + + Values are unchanged in the 2006 IAU report. + + + New values: + + \begindata + + + + + + BODY301_POLE_RA = ( 269.9949 0.0031 0. ) + BODY301_POLE_DEC = ( 66.5392 0.0130 0. ) + BODY301_PM = ( 38.3213 13.17635815 -1.4D-12 ) + BODY301_LONG_AXIS = ( 0. ) + + BODY301_NUT_PREC_RA = ( -3.8787 -0.1204 0.0700 -0.0172 + 0.0 0.0072 0.0 0.0 + 0.0 -0.0052 0.0 0.0 + 0.0043 ) + + BODY301_NUT_PREC_DEC = ( 1.5419 0.0239 -0.0278 0.0068 + 0.0 -0.0029 0.0009 0.0 + 0.0 0.0008 0.0 0.0 + -0.0009 ) + + BODY301_NUT_PREC_PM = ( 3.5610 0.1208 -0.0642 0.0158 + 0.0252 -0.0066 -0.0047 -0.0046 + 0.0028 0.0052 0.0040 0.0019 + -0.0044 ) + \begintext + + + +Satellites of Mars + + + Phobos + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + The quadratic prime meridian term is scaled by 1/36525**2: + + 8.864000000000000 ---> 6.6443009930565219E-09 + + \begindata + + BODY401_POLE_RA = ( 317.68 -0.108 0. ) + BODY401_POLE_DEC = ( 52.90 -0.061 0. ) + BODY401_PM = ( 35.06 1128.8445850 6.6443009930565219E-09 ) + + BODY401_LONG_AXIS = ( 0. ) + + BODY401_NUT_PREC_RA = ( 1.79 0. 0. 0. ) + BODY401_NUT_PREC_DEC = ( -1.08 0. 0. 0. ) + BODY401_NUT_PREC_PM = ( -1.42 -0.78 0. 0. ) + + + \begintext + + + Deimos + + Old values: + + Values are unchanged in the 2006 IAU report. + + + New values: + + The Deimos prime meridian expression is: + + + 2 + W = 79.41 + 285.1618970 d - 0.520 T - 2.58 sin M + 3 + + + 0.19 cos M . + 3 + + + At the present time, the PCK kernel software (the routine + BODEUL in particular) cannot handle the cosine term directly, + but we can represent it as + + 0.19 sin M + 4 + + where + + M = 90.D0 - M + 4 3 + + Therefore, the nutation precession angle assignments for Phobos + and Deimos contain four coefficients rather than three. + + The quadratic prime meridian term is scaled by 1/36525**2: + + -0.5200000000000000 ---> -3.8978300049519307E-10 + + \begindata + + BODY402_POLE_RA = ( 316.65 -0.108 0. ) + BODY402_POLE_DEC = ( 53.52 -0.061 0. ) + BODY402_PM = ( 79.41 285.1618970 -3.897830D-10 ) + BODY402_LONG_AXIS = ( 0. ) + + BODY402_NUT_PREC_RA = ( 0. 0. 2.98 0. ) + BODY402_NUT_PREC_DEC = ( 0. 0. -1.78 0. ) + BODY402_NUT_PREC_PM = ( 0. 0. -2.58 0.19 ) + + \begintext + + + + +Satellites of Jupiter + + + Io + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY501_POLE_RA = ( 268.05 -0.009 0. ) + BODY501_POLE_DEC = ( 64.50 0.003 0. ) + BODY501_PM = ( 200.39 203.4889538 0. ) + BODY501_LONG_AXIS = ( 0. ) + + BODY501_NUT_PREC_RA = ( 0. 0. 0.094 0.024 ) + BODY501_NUT_PREC_DEC = ( 0. 0. 0.040 0.011 ) + BODY501_NUT_PREC_PM = ( 0. 0. -0.085 -0.022 ) + + \begintext + + + + Europa + + + Old values: + + Values are from the 2003 IAU report. + + + body502_pole_ra = ( 268.08 -0.009 0. ) + body502_pole_dec = ( 64.51 0.003 0. ) + body502_pm = ( 35.67 101.3747235 0. ) + body502_long_axis = ( 0. ) + + body502_nut_prec_ra = ( 0. 0. 0. 1.086 0.060 0.015 0.009 ) + body502_nut_prec_dec = ( 0. 0. 0. 0.468 0.026 0.007 0.002 ) + body502_nut_prec_pm = ( 0. 0. 0. -0.980 -0.054 -0.014 -0.008 ) + + + Current values: + + \begindata + + BODY502_POLE_RA = ( 268.08 -0.009 0. ) + BODY502_POLE_DEC = ( 64.51 0.003 0. ) + BODY502_PM = ( 36.022 101.3747235 0. ) + BODY502_LONG_AXIS = ( 0. ) + + BODY502_NUT_PREC_RA = ( 0. 0. 0. 1.086 0.060 0.015 0.009 ) + BODY502_NUT_PREC_DEC = ( 0. 0. 0. 0.468 0.026 0.007 0.002 ) + BODY502_NUT_PREC_PM = ( 0. 0. 0. -0.980 -0.054 -0.014 -0.008 ) + + \begintext + + + Ganymede + + Old values: + + Values are unchanged in the 2006 IAU report. + + + Current values: + + \begindata + + BODY503_POLE_RA = ( 268.20 -0.009 0. ) + BODY503_POLE_DEC = ( 64.57 0.003 0. ) + BODY503_PM = ( 44.064 50.3176081 0. ) + BODY503_LONG_AXIS = ( 0. ) + + BODY503_NUT_PREC_RA = ( 0. 0. 0. -0.037 0.431 0.091 ) + BODY503_NUT_PREC_DEC = ( 0. 0. 0. -0.016 0.186 0.039 ) + BODY503_NUT_PREC_PM = ( 0. 0. 0. 0.033 -0.389 -0.082 ) + + \begintext + + + Callisto + + Old values: + + Values are unchanged in the 2006 IAU report. + + + Current values: + + + \begindata + + BODY504_POLE_RA = ( 268.72 -0.009 0. ) + BODY504_POLE_DEC = ( 64.83 0.003 0. ) + BODY504_PM = ( 259.51 21.5710715 0. ) + BODY504_LONG_AXIS = ( 0. ) + + BODY504_NUT_PREC_RA = ( 0. 0. 0. 0. -0.068 0.590 0. 0.010 ) + BODY504_NUT_PREC_DEC = ( 0. 0. 0. 0. -0.029 0.254 0. -0.004 ) + BODY504_NUT_PREC_PM = ( 0. 0. 0. 0. 0.061 -0.533 0. -0.009 ) + + \begintext + + + Amalthea + + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY505_POLE_RA = ( 268.05 -0.009 0. ) + BODY505_POLE_DEC = ( 64.49 0.003 0. ) + BODY505_PM = ( 231.67 722.6314560 0. ) + BODY505_LONG_AXIS = ( 0. ) + + BODY505_NUT_PREC_RA = ( -0.84 0. 0. 0. 0. 0. 0. 0. 0.01 0. ) + BODY505_NUT_PREC_DEC = ( -0.36 0. 0. 0. 0. 0. 0. 0. 0. 0. ) + BODY505_NUT_PREC_PM = ( 0.76 0. 0. 0. 0. 0. 0. 0. -0.01 0. ) + + \begintext + + + Thebe + + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY514_POLE_RA = ( 268.05 -0.009 0. ) + BODY514_POLE_DEC = ( 64.49 0.003 0. ) + BODY514_PM = ( 8.56 533.7004100 0. ) + BODY514_LONG_AXIS = ( 0. ) + + BODY514_NUT_PREC_RA = ( 0. -2.11 0. 0. 0. 0. 0. 0. 0. 0.04 ) + BODY514_NUT_PREC_DEC = ( 0. -0.91 0. 0. 0. 0. 0. 0. 0. 0.01 ) + BODY514_NUT_PREC_PM = ( 0. 1.91 0. 0. 0. 0. 0. 0. 0. -0.04 ) + + \begintext + + + Adrastea + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + + + BODY515_POLE_RA = ( 268.05 -0.009 0. ) + BODY515_POLE_DEC = ( 64.49 0.003 0. ) + BODY515_PM = ( 33.29 1206.9986602 0. ) + BODY515_LONG_AXIS = ( 0. ) + + \begintext + + + Metis + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY516_POLE_RA = ( 268.05 -0.009 0. ) + BODY516_POLE_DEC = ( 64.49 0.003 0. ) + BODY516_PM = ( 346.09 1221.2547301 0. ) + BODY516_LONG_AXIS = ( 0. ) + + \begintext + + + +Satellites of Saturn + + + Mimas + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY601_POLE_RA = ( 40.66 -0.036 0. ) + BODY601_POLE_DEC = ( 83.52 -0.004 0. ) + BODY601_PM = ( 337.46 381.9945550 0. ) + BODY601_LONG_AXIS = ( 0. ) + + BODY601_NUT_PREC_RA = ( 0. 0. 13.56 0. 0. 0. 0. 0. 0. ) + BODY601_NUT_PREC_DEC = ( 0. 0. -1.53 0. 0. 0. 0. 0. 0. ) + BODY601_NUT_PREC_PM = ( 0. 0. -13.48 0. -44.85 0. 0. 0. 0. ) + + \begintext + + + Enceladus + + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY602_POLE_RA = ( 40.66 -0.036 0. ) + BODY602_POLE_DEC = ( 83.52 -0.004 0. ) + BODY602_PM = ( 2.82 262.7318996 0. ) + BODY602_LONG_AXIS = ( 0. ) + + \begintext + + + + Tethys + + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY603_POLE_RA = ( 40.66 -0.036 0. ) + BODY603_POLE_DEC = ( 83.52 -0.004 0. ) + BODY603_PM = ( 10.45 190.6979085 0. ) + BODY603_LONG_AXIS = ( 0. ) + + BODY603_NUT_PREC_RA = ( 0. 0. 0. 9.66 0. 0. 0. 0. 0. ) + BODY603_NUT_PREC_DEC = ( 0. 0. 0. -1.09 0. 0. 0. 0. 0. ) + BODY603_NUT_PREC_PM = ( 0. 0. 0. -9.60 2.23 0. 0. 0. 0. ) + + \begintext + + + Dione + + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY604_POLE_RA = ( 40.66 -0.036 0. ) + BODY604_POLE_DEC = ( 83.52 -0.004 0. ) + BODY604_PM = ( 357.00 131.5349316 0. ) + BODY604_LONG_AXIS = ( 0. ) + + \begintext + + + + Rhea + + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY605_POLE_RA = ( 40.38 -0.036 0. ) + BODY605_POLE_DEC = ( 83.55 -0.004 0. ) + BODY605_PM = ( 235.16 79.6900478 0. ) + BODY605_LONG_AXIS = ( 0. ) + + BODY605_NUT_PREC_RA = ( 0. 0. 0. 0. 0. 3.10 0. 0. 0. ) + BODY605_NUT_PREC_DEC = ( 0. 0. 0. 0. 0. -0.35 0. 0. 0. ) + BODY605_NUT_PREC_PM = ( 0. 0. 0. 0. 0. -3.08 0. 0. 0. ) + + \begintext + + + + Titan + + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY606_POLE_RA = ( 36.41 -0.036 0. ) + BODY606_POLE_DEC = ( 83.94 -0.004 0. ) + BODY606_PM = ( 189.64 22.5769768 0. ) + BODY606_LONG_AXIS = ( 0. ) + + BODY606_NUT_PREC_RA = ( 0. 0. 0. 0. 0. 0. 2.66 0. 0 ) + BODY606_NUT_PREC_DEC = ( 0. 0. 0. 0. 0. 0. -0.30 0. 0 ) + BODY606_NUT_PREC_PM = ( 0. 0. 0. 0. 0. 0. -2.64 0. 0 ) + + \begintext + + + + Hyperion + + The IAU report does not give an orientation model for Hyperion. + Hyperion's rotation is in chaotic and is not predictable for + long periods. + + + Iapetus + + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY608_POLE_RA = ( 318.16 -3.949 0. ) + BODY608_POLE_DEC = ( 75.03 -1.143 0. ) + BODY608_PM = ( 350.20 4.5379572 0. ) + BODY608_LONG_AXIS = ( 0. ) + + \begintext + + + + Phoebe + + + Old values: + + Values are from the 2003 IAU report. + + body609_pole_ra = ( 355.00 0. 0. ) + body609_pole_dec = ( 68.70 0. 0. ) + body609_pm = ( 304.70 930.8338720 0. ) + body609_long_axis = ( 0. ) + + Current values: + + \begindata + + BODY609_POLE_RA = ( 356.90 0. 0. ) + BODY609_POLE_DEC = ( 77.80 0. 0. ) + BODY609_PM = ( 178.58 931.639 0. ) + BODY609_LONG_AXIS = ( 0. ) + + \begintext + + + Janus + + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY610_POLE_RA = ( 40.58 -0.036 0. ) + BODY610_POLE_DEC = ( 83.52 -0.004 0. ) + BODY610_PM = ( 58.83 518.2359876 0. ) + BODY610_LONG_AXIS = ( 0. ) + + BODY610_NUT_PREC_RA = ( 0. -1.623 0. 0. 0. 0. 0. 0. 0.023 ) + BODY610_NUT_PREC_DEC = ( 0. -0.183 0. 0. 0. 0. 0. 0. 0.001 ) + BODY610_NUT_PREC_PM = ( 0. 1.613 0. 0. 0. 0. 0. 0. -0.023 ) + + \begintext + + + + Epimetheus + + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY611_POLE_RA = ( 40.58 -0.036 0. ) + BODY611_POLE_DEC = ( 83.52 -0.004 0. ) + BODY611_PM = ( 293.87 518.4907239 0. ) + BODY611_LONG_AXIS = ( 0. ) + + BODY611_NUT_PREC_RA = ( -3.153 0. 0. 0. 0. 0. 0. 0.086 0. ) + BODY611_NUT_PREC_DEC = ( -0.356 0. 0. 0. 0. 0. 0. 0.005 0. ) + BODY611_NUT_PREC_PM = ( 3.133 0. 0. 0. 0. 0. 0. -0.086 0. ) + + \begintext + + + + Helene + + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY612_POLE_RA = ( 40.85 -0.036 0. ) + BODY612_POLE_DEC = ( 83.34 -0.004 0. ) + BODY612_PM = ( 245.12 131.6174056 0. ) + BODY612_LONG_AXIS = ( 0. ) + + \begintext + + + + Telesto + + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY613_POLE_RA = ( 50.51 -0.036 0. ) + BODY613_POLE_DEC = ( 84.06 -0.004 0. ) + BODY613_PM = ( 56.88 190.6979332 0. ) + BODY613_LONG_AXIS = ( 0. ) + + \begintext + + + + Calypso + + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY614_POLE_RA = ( 36.41 -0.036 0. ) + BODY614_POLE_DEC = ( 85.04 -0.004 0. ) + BODY614_PM = ( 153.51 190.6742373 0. ) + BODY614_LONG_AXIS = ( 0. ) + + \begintext + + + + Atlas + + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY615_POLE_RA = ( 40.58 -0.036 0. ) + BODY615_POLE_DEC = ( 83.53 -0.004 0. ) + BODY615_PM = ( 137.88 598.3060000 0. ) + BODY615_LONG_AXIS = ( 0. ) + + \begintext + + + + Prometheus + + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY616_POLE_RA = ( 40.58 -0.036 ) + BODY616_POLE_DEC = ( 83.53 -0.004 ) + BODY616_PM = ( 296.14 587.289000 ) + BODY616_LONG_AXIS = ( 0. ) + + \begintext + + + + Pandora + + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY617_POLE_RA = ( 40.58 -0.036 0. ) + BODY617_POLE_DEC = ( 83.53 -0.004 0. ) + BODY617_PM = ( 162.92 572.7891000 0. ) + BODY617_LONG_AXIS = ( 0. ) + + \begintext + + + + Pan + + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY618_POLE_RA = ( 40.6 -0.036 0. ) + BODY618_POLE_DEC = ( 83.5 -0.004 0. ) + BODY618_PM = ( 48.8 626.0440000 0. ) + BODY618_LONG_AXIS = ( 0. ) + + \begintext + + + + + +Satellites of Uranus + + + + Ariel + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY701_POLE_RA = ( 257.43 0. 0. ) + BODY701_POLE_DEC = ( -15.10 0. 0. ) + BODY701_PM = ( 156.22 -142.8356681 0. ) + BODY701_LONG_AXIS = ( 0. ) + + BODY701_NUT_PREC_RA = ( 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. 0. 0. 0.29 ) + + BODY701_NUT_PREC_DEC = ( 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. 0. 0. 0.28 ) + + BODY701_NUT_PREC_PM = ( 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. 0. 0.05 0.08 ) + \begintext + + + + Umbriel + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY702_POLE_RA = ( 257.43 0. 0. ) + BODY702_POLE_DEC = ( -15.10 0. 0. ) + BODY702_PM = ( 108.05 -86.8688923 0. ) + BODY702_LONG_AXIS = ( 0. ) + + BODY702_NUT_PREC_RA = ( 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. 0. 0. 0. 0.21 ) + + BODY702_NUT_PREC_DEC = ( 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. 0. 0. 0. 0.20 ) + + BODY702_NUT_PREC_PM = ( 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. 0. -0.09 0. 0.06 ) + + \begintext + + + + Titania + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY703_POLE_RA = ( 257.43 0. 0. ) + BODY703_POLE_DEC = ( -15.10 0. 0. ) + BODY703_PM = ( 77.74 -41.3514316 0. ) + BODY703_LONG_AXIS = ( 0. ) + + BODY703_NUT_PREC_RA = ( 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.29 ) + + BODY703_NUT_PREC_DEC = ( 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.28 ) + + BODY703_NUT_PREC_PM = ( 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.08 ) + \begintext + + + + Oberon + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY704_POLE_RA = ( 257.43 0. 0. ) + BODY704_POLE_DEC = ( -15.10 0. 0. ) + BODY704_PM = ( 6.77 -26.7394932 0. ) + BODY704_LONG_AXIS = ( 0. ) + + + BODY704_NUT_PREC_RA = ( 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. 0.16 ) + + BODY704_NUT_PREC_DEC = ( 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. 0.16 ) + + BODY704_NUT_PREC_PM = ( 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. 0.04 ) + \begintext + + + + Miranda + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + + BODY705_POLE_RA = ( 257.43 0. 0. ) + BODY705_POLE_DEC = ( -15.08 0. 0. ) + BODY705_PM = ( 30.70 -254.6906892 0. ) + BODY705_LONG_AXIS = ( 0. ) + + BODY705_NUT_PREC_RA = ( 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 4.41 0. 0. 0. 0. + 0. -0.04 0. ) + + BODY705_NUT_PREC_DEC = ( 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 4.25 0. 0. 0. 0. + 0. -0.02 0. ) + + BODY705_NUT_PREC_PM = ( 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 1.15 -1.27 0. 0. 0. + 0. -0.09 0.15 ) + \begintext + + + + Cordelia + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY706_POLE_RA = ( 257.31 0. 0. ) + BODY706_POLE_DEC = ( -15.18 0. 0. ) + BODY706_PM = ( 127.69 -1074.5205730 0. ) + BODY706_LONG_AXIS = ( 0. ) + + BODY706_NUT_PREC_RA = ( -0.15 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + BODY706_NUT_PREC_DEC = ( 0.14 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + BODY706_NUT_PREC_PM = ( -0.04 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + \begintext + + + + Ophelia + + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY707_POLE_RA = ( 257.31 0. 0. ) + BODY707_POLE_DEC = ( -15.18 0. 0. ) + BODY707_PM = ( 130.35 -956.4068150 0. ) + BODY707_LONG_AXIS = ( 0. ) + + BODY707_NUT_PREC_RA = ( 0. -0.09 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + BODY707_NUT_PREC_DEC = ( 0. 0.09 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + BODY707_NUT_PREC_PM = ( 0. -0.03 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + \begintext + + + + Bianca + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY708_POLE_RA = ( 257.31 0. 0. ) + BODY708_POLE_DEC = ( -15.18 0. 0. ) + BODY708_PM = ( 105.46 -828.3914760 0. ) + BODY708_LONG_AXIS = ( 0. ) + + BODY708_NUT_PREC_RA = ( 0. 0. -0.16 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + BODY708_NUT_PREC_DEC = ( 0. 0. 0.16 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + BODY708_NUT_PREC_PM = ( 0. 0. -0.04 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + \begintext + + + + Cressida + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + + BODY709_POLE_RA = ( 257.31 0. 0. ) + BODY709_POLE_DEC = ( -15.18 0. 0. ) + BODY709_PM = ( 59.16 -776.5816320 0. ) + BODY709_LONG_AXIS = ( 0. ) + + + BODY709_NUT_PREC_RA = ( 0. 0. 0. -0.04 0. + 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + + BODY709_NUT_PREC_DEC = ( 0. 0. 0. 0.04 0. + 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + + BODY709_NUT_PREC_PM = ( 0. 0. 0. -0.01 0. + 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + + \begintext + + + + Desdemona + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY710_POLE_RA = ( 257.31 0. 0. ) + BODY710_POLE_DEC = ( -15.18 0. 0. ) + BODY710_PM = ( 95.08 -760.0531690 0. ) + BODY710_LONG_AXIS = ( 0. ) + + BODY710_NUT_PREC_RA = ( 0. 0. 0. 0. -0.17 + 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + BODY710_NUT_PREC_DEC = ( 0. 0. 0. 0. 0.16 + 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + BODY710_NUT_PREC_PM = ( 0. 0. 0. 0. -0.04 + 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + \begintext + + + + Juliet + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY711_POLE_RA = ( 257.31 0. 0. ) + BODY711_POLE_DEC = ( -15.18 0. 0. ) + BODY711_PM = ( 302.56 -730.1253660 0. ) + BODY711_LONG_AXIS = ( 0. ) + + BODY711_NUT_PREC_RA = ( 0. 0. 0. 0. 0. + -0.06 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + BODY711_NUT_PREC_DEC = ( 0. 0. 0. 0. 0. + 0.06 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + BODY711_NUT_PREC_PM = ( 0. 0. 0. 0. 0. + -0.02 0. 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + \begintext + + + + Portia + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY712_POLE_RA = ( 257.31 0. 0. ) + BODY712_POLE_DEC = ( -15.18 0. 0. ) + BODY712_PM = ( 25.03 -701.4865870 0. ) + BODY712_LONG_AXIS = ( 0. ) + + BODY712_NUT_PREC_RA = ( 0. 0. 0. 0. 0. + 0. -0.09 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + BODY712_NUT_PREC_DEC = ( 0. 0. 0. 0. 0. + 0. 0.09 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + BODY712_NUT_PREC_PM = ( 0. 0. 0. 0. 0. + 0. -0.02 0. 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + \begintext + + + + Rosalind + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY713_POLE_RA = ( 257.31 0. 0. ) + BODY713_POLE_DEC = ( -15.18 0. 0. ) + BODY713_PM = ( 314.90 -644.6311260 0. ) + BODY713_LONG_AXIS = ( 0. ) + + BODY713_NUT_PREC_RA = ( 0. 0. 0. 0. 0. + 0. 0. -0.29 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + BODY713_NUT_PREC_DEC = ( 0. 0. 0. 0. 0. + 0. 0. 0.28 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + BODY713_NUT_PREC_PM = ( 0. 0. 0. 0. 0. + 0. 0. -0.08 0. 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + \begintext + + + + Belinda + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY714_POLE_RA = ( 257.31 0. 0. ) + BODY714_POLE_DEC = ( -15.18 0. 0. ) + BODY714_PM = ( 297.46 -577.3628170 0. ) + BODY714_LONG_AXIS = ( 0. ) + + BODY714_NUT_PREC_RA = ( 0. 0. 0. 0. 0. + 0. 0. 0. -0.03 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + BODY714_NUT_PREC_DEC = ( 0. 0. 0. 0. 0. + 0. 0. 0. 0.03 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + BODY714_NUT_PREC_PM = ( 0. 0. 0. 0. 0. + 0. 0. 0. -0.01 0. + 0. 0. 0. 0. 0. + 0. 0. 0. ) + \begintext + + + + Puck + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY715_POLE_RA = ( 257.31 0. 0. ) + BODY715_POLE_DEC = ( -15.18 0. 0. ) + BODY715_PM = ( 91.24 -472.5450690 0. ) + BODY715_LONG_AXIS = ( 0. ) + + BODY715_NUT_PREC_RA = ( 0. 0. 0. 0. 0. + 0. 0. 0. 0. -0.33 + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + BODY715_NUT_PREC_DEC = ( 0. 0. 0. 0. 0. + 0. 0. 0. 0. 0.31 + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + BODY715_NUT_PREC_PM = ( 0. 0. 0. 0. 0. + 0. 0. 0. 0. -0.09 + 0. 0. 0. 0. 0. + 0. 0. 0. ) + + \begintext + + + + +Satellites of Neptune + + + Triton + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY801_POLE_RA = ( 299.36 0. 0. ) + BODY801_POLE_DEC = ( 41.17 0. 0. ) + BODY801_PM = ( 296.53 -61.2572637 0. ) + BODY801_LONG_AXIS = ( 0. ) + + + BODY801_NUT_PREC_RA = ( 0. 0. 0. 0. + 0. 0. 0. -32.35 + 0. -6.28 -2.08 -0.74 + -0.28 -0.11 -0.07 -0.02 + -0.01 ) + + + BODY801_NUT_PREC_DEC = ( 0. 0. 0. 0. + 0. 0. 0. 22.55 + 0. 2.10 0.55 0.16 + 0.05 0.02 0.01 0. + 0. ) + + + BODY801_NUT_PREC_PM = ( 0. 0. 0. 0. + 0. 0. 0. 22.25 + 0. 6.73 2.05 0.74 + 0.28 0.11 0.05 0.02 + 0.01 ) + + \begintext + + + + + Nereid + + Old values: + + Values are from the 1988 IAU report [10]. Note that this + rotation model pre-dated the 1989 Voyager 2 Neptune + encounter. + + + body802_pole_ra = ( 273.48 0. 0. ) + body802_pole_dec = ( 67.22 0. 0. ) + body802_pm = ( 237.22 0.9996465 0. ) + body802_long_axis = ( 0. ) + + + The report seems to have a typo: in the nut_prec_ra expression, + where the report gives -0.51 sin 3N3, we use -0.51 3N2. + + body802_nut_prec_ra = ( 0. -17.81 + 0. 0. 0. 0. + 0. 0. 0. + 2.56 -0.51 0.11 -0.03 ) + + body802_nut_prec_dec = ( 0. -6.67 + 0. 0. 0. 0. + 0. 0. 0. + 0.47 -0.07 0.01 ) + + body802_nut_prec_pm = ( 0. 16.48 + 0. 0. 0. 0. + 0. 0. 0. + -2.57 0.51 -0.11 0.02 ) + + + + Current values: + + The 2006 report [1] states that values for Nereid are not + given because Nereid is not in synchronous rotation with Neptune + (p. 167). + + + + Naiad + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + + \begindata + + BODY803_POLE_RA = ( 299.36 0. 0. ) + BODY803_POLE_DEC = ( 43.36 0. 0. ) + BODY803_PM = ( 254.06 +1222.8441209 0. ) + BODY803_LONG_AXIS = ( 0. ) + + + BODY803_NUT_PREC_RA = ( 0.70 -6.49 0. 0. + 0. 0. 0. 0. + 0.25 0. 0. 0. + 0. 0. 0. 0. + 0. ) + + BODY803_NUT_PREC_DEC = ( -0.51 -4.75 0. 0. + 0. 0. 0. 0. + 0.09 0. 0. 0. + 0. 0. 0. 0. + 0. ) + + BODY803_NUT_PREC_PM = ( -0.48 4.40 0. 0. + 0. 0. 0. 0. + -0.27 0. 0. 0. + 0. 0. 0. 0. + 0. ) + + \begintext + + + + + Thalassa + + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY804_POLE_RA = ( 299.36 0. 0. ) + BODY804_POLE_DEC = ( 43.45 0. 0. ) + BODY804_PM = ( 102.06 1155.7555612 0. ) + BODY804_LONG_AXIS = ( 0. ) + + + BODY804_NUT_PREC_RA = ( 0.70 0. -0.28 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. ) + + + BODY804_NUT_PREC_DEC = ( -0.51 0. -0.21 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. ) + + BODY804_NUT_PREC_PM = ( -0.48 0. 0.19 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. ) + + \begintext + + + + Despina + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + + \begindata + + BODY805_POLE_RA = ( 299.36 0. 0. ) + BODY805_POLE_DEC = ( 43.45 0. 0. ) + BODY805_PM = ( 306.51 +1075.7341562 0. ) + BODY805_LONG_AXIS = ( 0. ) + + + BODY805_NUT_PREC_RA = ( 0.70 0. 0. -0.09 + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. ) + + BODY805_NUT_PREC_DEC = ( -0.51 0. 0. -0.07 + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. ) + + BODY805_NUT_PREC_PM = ( -0.49 0. 0. 0.06 + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. ) + \begintext + + + + Galatea + + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + + \begindata + + BODY806_POLE_RA = ( 299.36 0. 0. ) + BODY806_POLE_DEC = ( 43.43 0. 0. ) + BODY806_PM = ( 258.09 839.6597686 0. ) + BODY806_LONG_AXIS = ( 0. ) + + + BODY806_NUT_PREC_RA = ( 0.70 0. 0. 0. + -0.07 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. ) + + BODY806_NUT_PREC_DEC = ( -0.51 0. 0. 0. + -0.05 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. ) + + BODY806_NUT_PREC_PM = ( -0.48 0. 0. 0. + 0.05 0. 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. ) + \begintext + + + Larissa + + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY807_POLE_RA = ( 299.36 0. 0. ) + BODY807_POLE_DEC = ( 43.41 0. 0. ) + BODY807_PM = ( 179.41 +649.0534470 0. ) + BODY807_LONG_AXIS = ( 0. ) + + + BODY807_NUT_PREC_RA = ( 0.70 0. 0. 0. + 0. -0.27 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. ) + + BODY807_NUT_PREC_DEC = ( -0.51 0. 0. 0. + 0. -0.20 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. ) + + BODY807_NUT_PREC_PM = ( -0.48 0. 0. 0. + 0. 0.19 0. 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. ) + \begintext + + + + Proteus + + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY808_POLE_RA = ( 299.27 0. 0. ) + BODY808_POLE_DEC = ( 42.91 0. 0. ) + BODY808_PM = ( 93.38 +320.7654228 0. ) + BODY808_LONG_AXIS = ( 0. ) + + + BODY808_NUT_PREC_RA = ( 0.70 0. 0. 0. + 0. 0. -0.05 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. ) + + BODY808_NUT_PREC_DEC = ( -0.51 0. 0. 0. + 0. 0. -0.04 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. ) + + BODY808_NUT_PREC_PM = ( -0.48 0. 0. 0. + 0. 0. 0.04 0. + 0. 0. 0. 0. + 0. 0. 0. 0. + 0. ) + + \begintext + + + + + +Satellites of Pluto + + Charon + + Old values: + + Values are from the 2003 IAU report. + + body901_pole_ra = ( 313.02 0. 0. ) + body901_pole_dec = ( 9.09 0. 0. ) + body901_pm = ( 56.77 -56.3623195 0. ) + body901_long_axis = ( 0. ) + + Current values: + + \begindata + + BODY901_POLE_RA = ( 312.993 0. 0. ) + BODY901_POLE_DEC = ( 6.163 0. 0. ) + BODY901_PM = ( 57.305 -56.3625225 0. ) + BODY901_LONG_AXIS = ( 0. ) + + \begintext + + + +Orientation constants for Selected Comets and Asteroids +-------------------------------------------------------- + + + +19P/Borrelly + + + Current values: + + \begindata + + BODY1000005_POLE_RA = ( 218.5 0. 0. ) + BODY1000005_POLE_DEC = ( -12.5 0. 0. ) + BODY1000005_PM = ( 000. 390.0 0. ) + BODY1000005_LONG_AXIS = ( 0. ) + + \begintext + + + +9P/Tempel 1 + + + Current values: + + \begindata + + BODY1000093_POLE_RA = ( 294. 0. 0. ) + BODY1000093_POLE_DEC = ( 73. 0. 0. ) + BODY1000093_PM = ( 252.63 212.064 0. ) + BODY1000093_LONG_AXIS = ( 0. ) + + \begintext + + +Vesta + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY2000004_POLE_RA = ( 301. 0. 0. ) + BODY2000004_POLE_DEC = ( 41. 0. 0. ) + BODY2000004_PM = ( 292. 1617.332776 0. ) + BODY2000004_LONG_AXIS = ( 0. ) + + \begintext + +Eros + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY2000433_POLE_RA = ( 11.35 0. 0. ) + BODY2000433_POLE_DEC = ( 17.22 0. 0. ) + BODY2000433_PM = ( 326.07 1639.38864745 0. ) + BODY2000433_LONG_AXIS = ( 0. ) + + \begintext + + +Itokawa + + + Current values: + + \begindata + + BODY2025143_POLE_RA = ( 90.53 0. 0. ) + BODY2025143_POLE_DEC = ( -66.30 0. 0. ) + BODY2025143_PM = ( 000.0 712.143 0. ) + BODY2025143_LONG_AXIS = ( 0. ) + + \begintext + + + +Ida + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY2431010_POLE_RA = ( 168.76 0. 0. ) + BODY2431010_POLE_DEC = ( -2.88 0. 0. ) + BODY2431010_PM = ( 265.95 +1864.6280070 0. ) + BODY2431010_LONG_AXIS = ( 0. ) + + \begintext + +Gaspra + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY9511010_POLE_RA = ( 9.47 0. 0. ) + BODY9511010_POLE_DEC = ( 26.70 0. 0. ) + BODY9511010_PM = ( 83.67 1226.9114850 0. ) + BODY9511010_LONG_AXIS = ( 0. ) + + \begintext + + + + + + + + + + +Radii of Sun and Planets +-------------------------------------------------------- + + +Sun + + Value for the Sun is from the [3], page K7. + + \begindata + + BODY10_RADII = ( 696000. 696000. 696000. ) + + \begintext + + +Mercury + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY199_RADII = ( 2439.7 2439.7 2439.7 ) + + \begintext + + +Venus + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY299_RADII = ( 6051.8 6051.8 6051.8 ) + + \begintext + + +Earth + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + + \begindata + + BODY399_RADII = ( 6378.14 6378.14 6356.75 ) + + \begintext + + +Mars + + + Old values: + + body499_radii = ( 3397. 3397. 3375. ) + + Current values: + + + The IAU report gives separate values for the north and south + polar radii: + + north: 3373.19 + south: 3379.21 + + We use the average of these values as the polar radius for + the triaxial model. + + \begindata + + BODY499_RADII = ( 3396.19 3396.19 3376.20 ) + + \begintext + + + +Jupiter + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY599_RADII = ( 71492 71492 66854 ) + + \begintext + + + +Saturn + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY699_RADII = ( 60268 60268 54364 ) + + \begintext + + + +Uranus + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY799_RADII = ( 25559 25559 24973 ) + + \begintext + + + +Neptune + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + (Values are for the 1 bar pressure level.) + + \begindata + + BODY899_RADII = ( 24764 24764 24341 ) + + \begintext + + + +Pluto + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY999_RADII = ( 1195 1195 1195 ) + + \begintext + + + + +Radii of Satellites +-------------------------------------------------------- + + +Moon + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY301_RADII = ( 1737.4 1737.4 1737.4 ) + + \begintext + + + +Satellites of Mars + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY401_RADII = ( 13.4 11.2 9.2 ) + BODY402_RADII = ( 7.5 6.1 5.2 ) + + \begintext + + + +Satellites of Jupiter + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY501_RADII = ( 1829.4 1819.3 1815.7 ) + BODY502_RADII = ( 1564.13 1561.23 1560.93 ) + BODY503_RADII = ( 2632.4 2632.29 2632.35 ) + BODY504_RADII = ( 2409.4 2409.2 2409.3 ) + BODY505_RADII = ( 125 73 64 ) + + \begintext + + Only mean radii are available in the 2003 IAU report for bodies + 506-513. + + \begindata + + BODY506_RADII = ( 85 85 85 ) + BODY507_RADII = ( 40 40 40 ) + BODY508_RADII = ( 18 18 18 ) + BODY509_RADII = ( 14 14 14 ) + BODY510_RADII = ( 12 12 12 ) + BODY511_RADII = ( 15 15 15 ) + BODY512_RADII = ( 10 10 10 ) + BODY513_RADII = ( 5 5 5 ) + BODY514_RADII = ( 58 49 42 ) + BODY515_RADII = ( 10 8 7 ) + + \begintext + + The value for the second radius for body 516 is not given in + 2003 IAU report. The values given are: + + BODY516_RADII = ( 30 --- 20 ) + + For use within the SPICE system, we use only the mean radius. + \begindata + + BODY516_RADII = ( 21.5 21.5 21.5 ) + + \begintext + + + +Satellites of Saturn + + + Old values: + + Values are from the 2003 IAU report. + + body601_radii = ( 209.1 196.2 191.4 ) + body602_radii = ( 256.3 247.3 244.6 ) + body603_radii = ( 535.6 528.2 525.8 ) + body604_radii = ( 560 560 560 ) + body605_radii = ( 764 764 764 ) + body606_radii = ( 2575 2575 2575 ) + body607_radii = ( 164 130 107 ) + body608_radii = ( 718 718 718 ) + body609_radii = ( 115 110 105 ) + body610_radii = ( 97.0 95.0 77.0 ) + body611_radii = ( 69.0 55.0 55.0 ) + + + Only the first equatorial radius for Helene (body 612) was given in the + 2003 IAU report: + + body612_radii = ( 17.5 --- --- ) + + The mean radius was 16km; we used this radius for all three axes, as + we do for the satellites for which only the mean radius is available. + + + body612_radii = ( 16 16 16 ) + body613_radii = ( 15 12.5 7.5 ) + body614_radii = ( 15.0 8.0 8.0 ) + body615_radii = ( 18.5 17.2 13.5 ) + body616_radii = ( 74.0 50.0 34.0 ) + body617_radii = ( 55.0 44.0 31.0 ) + + + + Current values: + + \begindata + + BODY601_RADII = ( 207.4 196.8 190.6 ) + BODY602_RADII = ( 256.6 251.4 248.3 ) + BODY603_RADII = ( 540.4 531.1 527.5 ) + BODY604_RADII = ( 563.8 561.0 560.3 ) + BODY605_RADII = ( 767.2 762.5 763.1 ) + BODY606_RADII = ( 2575 2575 2575 ) + BODY607_RADII = ( 164 130 107 ) + BODY608_RADII = ( 747.4 747.4 712.4 ) + BODY609_RADII = ( 108.6 107.7 101.5 ) + BODY610_RADII = ( 97.0 95.0 77.0 ) + BODY611_RADII = ( 69.0 55.0 55.0 ) + + \begintext + + Only the first equatorial radius for Helene (body 612) is given in the + 2006 IAU report: + + BODY612_RADII = ( 17.5 --- --- ) + + The mean radius is 16km; we use this radius for all three axes, as + we do for the satellites for which only the mean radius is available. + + + \begindata + + BODY612_RADII = ( 17.5 17.5 17.5 ) + BODY613_RADII = ( 15 12.5 7.5 ) + BODY614_RADII = ( 15.0 8.0 8.0 ) + BODY615_RADII = ( 18.5 17.2 13.5 ) + BODY616_RADII = ( 74.0 50.0 34.0 ) + BODY617_RADII = ( 55.0 44.0 31.0 ) + + \begintext + + + For Pan, only a mean radius is given in the 2006 report. + + \begindata + + BODY618_RADII = ( 10 10 10 ) + + \begintext + + + +Satellites of Uranus + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + \begindata + + BODY701_RADII = ( 581.1 577.9 577.7 ) + BODY702_RADII = ( 584.7 584.7 584.7 ) + BODY703_RADII = ( 788.9 788.9 788.9 ) + BODY704_RADII = ( 761.4 761.4 761.4 ) + BODY705_RADII = ( 240.4 234.2 232.9 ) + + \begintext + + The 2000 report gives only mean radii for satellites 706--715. + + \begindata + + BODY706_RADII = ( 13 13 13 ) + BODY707_RADII = ( 15 15 15 ) + BODY708_RADII = ( 21 21 21 ) + BODY709_RADII = ( 31 31 31 ) + BODY710_RADII = ( 27 27 27 ) + BODY711_RADII = ( 42 42 42 ) + BODY712_RADII = ( 54 54 54 ) + BODY713_RADII = ( 27 27 27 ) + BODY714_RADII = ( 33 33 33 ) + BODY715_RADII = ( 77 77 77 ) + + \begintext + + + + +Satellites of Neptune + + + Old values: + + Values are unchanged in the 2006 IAU report. + + Current values: + + The 2000 report gives mean radii only for bodies 801-806. + + \begindata + + BODY801_RADII = ( 1352.6 1352.6 1352.6 ) + BODY802_RADII = ( 170 170 170 ) + BODY803_RADII = ( 29 29 29 ) + BODY804_RADII = ( 40 40 40 ) + BODY805_RADII = ( 74 74 74 ) + BODY806_RADII = ( 79 79 79 ) + + \begintext + + + The second equatorial radius for Larissa is not given in the 2000 + report. The available values are: + + BODY807_RADII = ( 104 --- 89 ) + + For use within the SPICE system, we use only the mean radius. + \begindata + + BODY807_RADII = ( 96 96 96 ) + BODY808_RADII = ( 218 208 201 ) + + \begintext + + + + +Satellites of Pluto + + + Old values: + + Values are from the 2003 IAU report. + + BODY901_RADII = ( 593 593 593 ) + + Current values: + + \begindata + + BODY901_RADII = ( 605 605 605 ) + + \begintext + + + +Radii for Selected Comets and Asteroids +-------------------------------------------------------- + + +19P/Borrelly + + + Current values: + + + The value in the data assignment below is the + "effective radius." + + The first principal axis length is + + 3.5 km + + The lengths of the other semi-axes are not provided + by [1]. + + \begindata + + BODY1000005_RADII = ( 4.22 4.22 4.22 ) + + \begintext + + + +Halley + + + Current values: + + \begindata + + BODY1000036_RADII = ( 8.0 4.0 4.0 ) + + \begintext + + + +9P/Tempel 1 + + + Current values: + + + The value in the data assignment below is the + "effective radius." + + According to [1]: + + The maximum and minimum radii are not properly + the values of the principal semi-axes, they + are half the maximum and minimum values of the + diameter. Due to the large deviations from a + simple ellipsoid, they may not correspond with + measurements along the principal axes, or be + orthogonal to each other. + + \begindata + + BODY1000093_RADII = ( 3.0 3.0 3.0 ) + + \begintext + + +81P/Wild 2 + + + Current values: + + + \begindata + + BODY1000107_RADII = ( 2.7 1.9 1.5 ) + + \begintext + + +Ceres + + + Current values: + + + \begindata + + BODY2000001_RADII = ( 487.3 487.3 454.7 ) + + \begintext + + +Vesta + + + Current values: + + + \begindata + + BODY2000004_RADII = ( 289. 280. 229. ) + + \begintext + + +Toutatis + + + Current values: + + + \begindata + + BODY2004179_RADII = ( 2.13 1.015 0.85 ) + + \begintext + + +Kleopatra + + + Old values: + + Values are from the 2003 report. + + + body2000216_radii = ( 108.5 47 40.5 ) + + + Current values: + + + No values are provided in the 2006 report. + + +Mathilde + + + Current values: + + + \begindata + + BODY2000253_RADII = ( 33. 24. 23. ) + + \begintext + +Eros + + + Current values: + + + \begindata + + BODY2000433_RADII = ( 17.0 5.5 5.5 ) + + \begintext + + +Itokawa + + + Current values: + + + \begindata + + BODY2025143_RADII = ( 0.535 0.294 0.209 ) + + \begintext + + + +Gaspra + + + Current values: + + + \begindata + + BODY9511010_RADII = ( 9.1 5.2 4.4 ) + + \begintext + + + + +Ida + + + Current values: + + + \begindata + + BODY2431010_RADII = ( 26.8 12.0 7.6 ) + + \begintext + + + +=========================================================================== +End of file pck00009.tpc +=========================================================================== + + + diff --git a/tests/kernels/smap_test.bsp b/tests/kernels/smap_test.bsp new file mode 100644 index 0000000..71773f2 Binary files /dev/null and b/tests/kernels/smap_test.bsp differ diff --git a/tests/kernels/smap_v00.tf b/tests/kernels/smap_v00.tf new file mode 100644 index 0000000..e5bbcfa --- /dev/null +++ b/tests/kernels/smap_v00.tf @@ -0,0 +1,157 @@ +SMAP NAIF IDs and Frames + +History at end + +\begindata + +NAIF_BODY_NAME += ( 'SMAP' ) +NAIF_BODY_CODE += ( -205 ) + +NAIF_BODY_NAME += ( 'SMAP_BUS' ) +NAIF_BODY_CODE += ( 1420500 ) + +NAIF_BODY_NAME += ( 'SMAP_REFLECTOR_BASE' ) +NAIF_BODY_CODE += ( 1420510 ) + +NAIF_BODY_NAME += ( 'SMAP_FEFLECTOR_ROTATING' ) +NAIF_BODY_CODE += ( 1420511 ) + +NAIF_BODY_NAME += ( 'SMAP_FEFLECTOR' ) +NAIF_BODY_CODE += ( 1420512 ) + +NAIF_BODY_NAME += ( 'EARTH_SUN_ORBIT' ) +NAIF_BODY_CODE += ( 1420599 ) +\begintext + +SMAP Spacecraft bus frame: dynamic (Class 5) two-vector TK frame + + Primary: +X to earth nadir + Secondary: +Z near direction to Sun + +\begindata + +FRAME_SMAP_BUS = 1420500 +FRAME_1420500_NAME = 'SMAP_BUS' +FRAME_1420500_CLASS = 5 +FRAME_1420500_CENTER = -205 +FRAME_1420500_CLASS_ID = 1420500 + +FRAME_1420500_RELATIVE = 'J2000' +FRAME_1420500_DEF_STYLE = 'PARAMETERIZED' +FRAME_1420500_FAMILY = 'TWO-VECTOR' + +FRAME_1420500_PRI_AXIS = '+X' +FRAME_1420500_PRI_VECTOR_DEF = 'OBSERVER_TARGET_POSITION' +FRAME_1420500_PRI_OBSERVER = -205 +FRAME_1420500_PRI_TARGET = 399 +FRAME_1420500_PRI_ABCORR = 'NONE' + +FRAME_1420500_SEC_AXIS = '+Z' +FRAME_1420500_SEC_VECTOR_DEF = 'OBSERVER_TARGET_POSITION' +FRAME_1420500_SEC_OBSERVER = -205 +FRAME_1420500_SEC_TARGET = 10 +FRAME_1420500_SEC_ABCORR = 'NONE' + +\begintext + +SMAP Reflector base frame: static (Class 4) TK frame + + Expresses instrument base alignment wrt S/C bus: initially coincident + +\begindata + +FRAME_SMAP_REFLECTOR_BASE = 1420510 +FRAME_1420510_NAME = 'SMAP_REFLECTOR_BASE' +FRAME_1420510_CLASS = 4 +FRAME_1420510_CENTER = -205 +FRAME_1420510_CLASS_ID = 1420510 + +TKFRAME_1420510_SPEC = 'MATRIX' +TKFRAME_1420510_RELATIVE = 'SMAP_BUS' +TKFRAME_1420510_MATRIX = ( 1.0 0.0 0.0 + 0.0 1.0 0.0 + 0.0 0.0 1.0 ) + +\begintext + +SMAP Reflector rotating frame: dynamic (Class 5) Euler frame + + Rotates around reflector base +X at 14.6 rpm = 87.6 deg/s + +\begindata + +FRAME_SMAP_REFLECTOR_ROTATING = 1420511 +FRAME_1420511_NAME = 'SMAP_REFLECTOR_ROTATING' +FRAME_1420511_CLASS = 5 +FRAME_1420511_CENTER = -205 +FRAME_1420511_CLASS_ID = 1420511 + +FRAME_1420511_RELATIVE = 'SMAP_REFLECTOR_BASE' +FRAME_1420511_DEF_STYLE = 'PARAMETERIZED' +FRAME_1420511_FAMILY = 'EULER' + +FRAME_1420511_EPOCH = @2015-JAN-01/12:00:00 +FRAME_1420511_AXES = ( 1 3 1 ) +FRAME_1420511_UNITS = 'DEGREES' +FRAME_1420511_ANGLE_1_COEFFS = ( 0.0 87.6 ) +FRAME_1420511_ANGLE_2_COEFFS = ( 0.0 0.0 ) +FRAME_1420511_ANGLE_3_COEFFS = ( 0.0 0.0 ) + +\begintext + +SMAP Reflector: static (Class 4) TK frame + + SMAP_REFLECTOR_ROTATING rotated 40deg around +Y + => nominal +X (boresight) is 40deg off-nadir + +\begindata + +FRAME_SMAP_REFLECTOR = 1420512 +FRAME_1420512_NAME = 'SMAP_REFLECTOR' +FRAME_1420512_CLASS = 4 +FRAME_1420512_CENTER = -205 +FRAME_1420512_CLASS_ID = 1420512 + +TKFRAME_1420512_RELATIVE = 'SMAP_REFLECTOR_ROTATING' +TKFRAME_1420512_SPEC = 'ANGLES' +TKFRAME_1420512_UNITS = 'DEGREES' +TKFRAME_1420512_ANGLES = ( 40.0 0.0 0.0 ) +TKFRAME_1420512_AXES = ( 2 1 2 ) + +\begintext + +Earth/Sun orbit frame + + Primary: +Z from Earth to Sun + Secondary: +X near Earth Sun-relative velocity + +\begindata + +FRAME_EARTH_SUN_ORBIT = 1420599 +FRAME_1420599_NAME = 'EARTH_SUN_ORBIT' +FRAME_1420599_CLASS = 5 +FRAME_1420599_CENTER = 399 +FRAME_1420599_CLASS_ID = 1420599 + +FRAME_1420599_RELATIVE = 'J2000' +FRAME_1420599_DEF_STYLE = 'PARAMETERIZED' +FRAME_1420599_FAMILY = 'TWO-VECTOR' + +FRAME_1420599_PRI_AXIS = '+Z' +FRAME_1420599_PRI_VECTOR_DEF = 'OBSERVER_TARGET_POSITION' +FRAME_1420599_PRI_OBSERVER = 399 +FRAME_1420599_PRI_TARGET = 10 +FRAME_1420599_PRI_ABCORR = 'LT' + +FRAME_1420599_SEC_AXIS = '+X' +FRAME_1420599_SEC_VECTOR_DEF = 'OBSERVER_TARGET_VELOCITY' +FRAME_1420599_SEC_OBSERVER = 10 +FRAME_1420599_SEC_TARGET = 399 +FRAME_1420599_SEC_FRAME = 'J2000' +FRAME_1420599_SEC_ABCORR = 'LT' + +\begintext + +BTCarcich +2013-02 +Initial version for testing diff --git a/tests/kernels/spk_drm239_WithBurn-full.bsp b/tests/kernels/spk_drm239_WithBurn-full.bsp new file mode 100644 index 0000000..1e2a773 Binary files /dev/null and b/tests/kernels/spk_drm239_WithBurn-full.bsp differ diff --git a/tests/test_btc.py b/tests/test_btc.py new file mode 100644 index 0000000..1406b32 --- /dev/null +++ b/tests/test_btc.py @@ -0,0 +1,118 @@ +import spice +import unittest +""" +This string contains a SPICE text kernel which can be loaded +via + + spice.furnsh(__file__) + +\begindata + +D = 10.0 +I = ( 1, 2 ) +C = ( 'abc', 'def', 'ghi' ) + +BODY399_VARS = ( 1000.0 2000.0 3000.0 ) +BODY99_VARS = ( 1099.5 2099.25 3099.125, 4099.0625 ) + +\begintext +""" + +### Test routines that work with kernel pool variables +class TestKernelPool(unittest.TestCase): + def setUp(self): + ### Variables for comparison + self.Ddtp = ( 1, 'N', ) + self.Idtp = ( 2, 'N', ) + self.Cdtp = ( 3, 'C', ) + self.var399 = ( 3, ( 1000.0, 2000.0, 3000.0, ), ) + self.var99 = (4, ( 1099.5, 2099.25, 3099.125, 4099.0625, ), ) + + ### Load the kernel + spice.furnsh( __file__ ) + + ### Load a private name/code pair + spice.boddef( 'MYBOD', 99 ) + + def tearDown(self): + ### Unload the kernel + spice.unload( __file__ ) + + ### Test bodvcd and bodvrd + def test_bodvXds(self): + self.assertEqual( spice.bodvcd( 399, 'VARS', 10), self.var399 ) + self.assertEqual( spice.bodvcd( 99, 'VARS', 10), self.var99 ) + self.assertEqual( spice.bodvrd( 'earth', 'VARS', 10), self.var399 ) + self.assertEqual( spice.bodvrd( 'mybod', 'VARS', 10), self.var99 ) + + ### Test dtpool + def test_dtpool(self): + self.assertEqual( spice.dtpool( 'D' ), self.Ddtp ) + self.assertEqual( spice.dtpool( 'I' ), self.Idtp ) + self.assertEqual( spice.dtpool( 'C' ), self.Cdtp ) + + ### Test bodc2n, bodn2c, bods2c, bodc2s + def test_bodX2Y(self): + self.assertEqual( spice.bodc2n( 99, ), 'MYBOD' ) + self.assertEqual( spice.bodn2c( 'MYBOD', ), 99 ) + + self.assertEqual( spice.bodc2s( -99, ), '-99' ) + self.assertEqual( spice.bods2c( '-99', ), -99 ) + self.assertEqual( spice.bods2c( '99', ), 99 ) + self.assertEqual( spice.bods2c( 'MYBOD', ), 99 ) + + self.assertEqual( spice.bodc2n( 999, ), 'PLUTO' ) + self.assertEqual( spice.bodn2c( 'PLUTO', ), 999 ) + self.assertEqual( spice.bods2c( '999', ), 999 ) + self.assertEqual( spice.bods2c( 'PLUTO', ), 999 ) + + +### Test routins that work with SpiceCell's +class TestSpiceCells(unittest.TestCase): + + def setUp(self): + pass + + def test_cells(self): + for typ,appnd,item in ((spice.DataType.CHR,spice.appndc,'63',) + ,(spice.DataType.INT,spice.appndi,-99,) + ,(spice.DataType.DP,spice.appndd,-99.0,) + ,): + + ### items will be [n,2n,3n,] + ### comparison object, first three items + cmp = [ item, item+item, item+item+item ] + + a=spice.copy(spice.Cell(typ,4),spice.Cell(typ,4)) + + ### comparison object, last item + cmp += a.data[-1:] + + ### pad with nulls for character cells + if typ==spice.DataType.CHR: + cmp = [ (i[:5]+('\x00'*6))[:6] for i in cmp ] + + ### Assign two items, set cardinality, append a third item + a.data[0]=item + a.data[1]=item+item + a=spice.scard(2,a) + a=appnd(item+item+item,a) + + ### Check structure contents + self.assertEqual( a.dtype, typ ) + self.assertEqual( a.size, 4 ) + self.assertEqual( a.card, 3 ) + self.assertEqual( a.init, True ) + + ### Length is minimum of 6 for char cells, else 0 + if typ==spice.DataType.CHR: + self.assertEqual( a.length, 6 ) + else: + self.assertEqual( a.length, 0 ) + + ### Compare data + self.assertEqual( a.data, cmp ) + + +if __name__=="__main__": + unittest.main() diff --git a/tests/test_horizons2plot.py b/tests/test_horizons2plot.py new file mode 100755 index 0000000..55ea56d --- /dev/null +++ b/tests/test_horizons2plot.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python + +import os +import sys +import spice +import unittest + +class TestHorizons(unittest.TestCase): + def setUp(self): + ### Load default kernels + mydir = os.path.dirname(__file__) + self.kernels = [ os.path.join( mydir,i.strip()) for i in + """ +kernels/naif0010.tls +kernels/spk_drm239_WithBurn-full.bsp + """.strip().split('\n') ] + for kernel in self.kernels: spice.furnsh( kernel ) + + def tearDown(self): + ### Unload any kernels + for kernel in self.kernels: spice.unload( kernel ) + + def test_horizons(self): + import horizons + + target = 'C/2013 S1' + target = 'C/2011 L4' + + spkFilename,spiceId,status = horizons.gomain(target) + + spice.furnsh( spkFilename ) + self.kernels += [spkFilename] + + target_ = '_'.join( target.split() ) + + et0 = spice.utc2et( '2013-01-10T12:00:00' ) + + ls2au = spice.convrt( spice.clight(), 'KM', 'AU' ) + dpr = spice.dpr() + spd = spice.spd() + + deltatime = None + + while deltatime is None or abs(deltatime) > 5e-7: + stS2I,lsS2I = spice.spkgeo( spiceId, et0, 'J2000', 10 ) + posn, veloc = stS2I[:3], stS2I[3:] + deltatime = - spice.vdot( posn, veloc ) / spice.vdot( veloc, veloc ) + et0 += deltatime + + + valarrs = [ ] + print( (deltatime,spice.et2utc(et0,'ISOC',3),) ) + + deltatime = 1.0 + sixmonths = spice.pi() * 1e7 + + while deltatime < sixmonths: + for pmdet in (-deltatime,deltatime): + et = et0 + pmdet + utc = spice.et2utc(et,'ISOC',1) + + stD2I,lsD2I = spice.spkgeo( spiceId, et, 'J2000', -140) + stI2S,lsI2S = spice.spkgeo( 10, et, 'J2000', spiceId ) + stD2S,lsD2S = spice.spkgeo( 10, et, 'J2000', -140 ) + + rD2I, rI2S = [ ls * ls2au for ls in [lsD2I,lsI2S] ] + aDIS, aSDI = [ ang * dpr for ang in + [ spice.vsep( spice.vminus(stD2I[:3]), stI2S[:-3] ) + , spice.vsep( stD2S[:3], stD2I[:-3] ) + ] + ] + valarrs += [ (et,pmdet,rD2I,rI2S,aDIS,aSDI,utc,) ] + + deltatime *= 1.2 + + valarrs.sort() + for valarr in valarrs: + print( '%12.1f %9.3f %9.3f %7.2f %7.2f %s' % valarr[1:] ) + + days = [i[1]/spd for i in valarrs] + + titles = [ i % (target_,) for i in """ + Range, %s-DI, AU + Range, %s-Sun, AU + Phase, DI-%s-Sun, deg + Elongation, Sun-DI-%s, deg + """.strip().split('\n')] + + try: + ### Moved matplotlib import to here so test runs to here at least + from matplotlib import pyplot as plt + plt.figure(1) + for idx in range(len(titles)): + ordinate = [i[idx+2] for i in valarrs] + plt.subplot( 221+idx ) + plt.plot( days, ordinate ) + plt.plot( days, ordinate, '.') + plt.title( titles[idx] ) + plt.ylabel( titles[idx] ) + if idx>1: plt.xlabel( 'T-Tperi, d' ) + + plt.show() + + except: + print( "Bypassed, or failed, matplotlib tests" ) + + + +if __name__=="__main__": + unittest.main() diff --git a/tests/test_ison.py b/tests/test_ison.py new file mode 100644 index 0000000..f71b56f --- /dev/null +++ b/tests/test_ison.py @@ -0,0 +1,259 @@ +import spice +import unittest +""" +This file contains a SPICE text kernel which can be loaded +via + + spice.furnsh(__file__) + + C/2012 S1 (ISON) +Epoch 2012 Sept. 30.0 TT = JDT 2456200.5 +T 2013 Nov. 28.83943 TT MPC +q 0.0125206 (2000.0) P Q +z -0.0001416 Peri. 345.49752 +0.31396150 +0.52149342 + +/-0.0000061 Node 295.75673 -0.75950095 -0.36349391 +e 1.0000018 Incl. 61.75288 -0.56972491 +0.77195647 +From 1418 observations 2011 Dec. 28-2013 Jan. 12, mean residual 0".4. + + C/2012 S1 (ISON) +Epoch 2013 Dec. 14.0 TT = JDT 2456640.5 +T 2013 Nov. 28.78376 TT MPC +q 0.0124445 (2000.0) P Q +z -0.0001246 Peri. 345.56415 +0.31512453 +0.51249745 + +/-0.0000061 Node 295.65420 -0.75894756 -0.36925673 +e 1.0000016 Incl. 62.39057 -0.56982026 +0.77523921 +From 1418 observations 2011 Dec. 28-2013 Jan. 12, mean residual 0".4. +""" + +class MPC_HELIOCENTRIC_ISON: + """ +VECTORS: Heliocentric vectors/AU +Obj JD_TT X Y Z X' Y' Z' +CK12S010 2456313.5000000 -1.838621582 3.996888204 2.473535871 0.003679388 -0.008412821 -0.005747084 +CK12S010 2456323.5000000 -1.801610451 3.912290279 2.415774077 0.003722922 -0.008506895 -0.005805299 +CK12S010 2456333.5000000 -1.764154611 3.826732067 2.357418790 0.003768496 -0.008605253 -0.005866032 + +Convert to ( jdtt, (X,Y,Z), (Xdot,Ydot,Zdot), ) + """ + def __init__(self): + self.jpv=[ ( 'JD %s TDT' % (jdtt,) + , ( spice.convrt(float(x),'AU','KM'), spice.convrt(float(y),'AU','KM'), spice.convrt(float(z),'AU','KM'), ) + , ( spice.convrt(float(xdot),'AU','KM')/spice.spd(), spice.convrt(float(ydot),'AU','KM')/spice.spd(), spice.convrt(float(zdot),'AU','KM')/spice.spd(), ) + , ) + for nm,jdtt,x,y,z,xdot,ydot,zdot + in [ i.strip().split() for i in self.__doc__.split('\n') if i[:9]=='CK12S010 ' ] + ] + + +class MPC_ISON_C_2012_S1: + """Minor Planet Center orbital elements for + Comet C/2012 S1 (ISON) per MPC 2013-A85 + + """ + def __init__(self): + self.source = 'MPC 2013-A85' + self.qAU = 0.0125206 + self.e = 1.0000018 + self.InclDEG = 61.75288 + self.NodeDEG = 295.75673 + self.PeriDEG = 345.49752 + self.M0 = 0.0 + self.T0_TDT = ('2013-11-28 00:00:00 TDT',0.83943) + self.MuM3S2 = 1.32712440018e+20 ### km**3 s**-2 + + #self.qAU = 0.0124445 + #self.e = 1.0000016 + #self.InclDEG = 62.39057 + #self.NodeDEG = 295.65420 + #self.PeriDEG = 345.56415 + #self.M0 = 0.0 + #self.T0_TDT = ('2013-11-28 00:00:00 TDT',0.78376) + #self.MuM3S2 = 1.32712440018e+20 ### km**3 s**-2 + + +### Test routins that work with kernel pool variables +class TestConics(unittest.TestCase): + def setUp(self): + + ### Load the kernel + spice.furnsh( __file__ ) + + ### Convert MPC constants to CONICS_C elements + ison = MPC_ISON_C_2012_S1() + self.rpKM = spice.convrt( ison.qAU, 'AU', 'KM') + self.ecc = ison.e + self.incRAD = spice.convrt( ison.InclDEG, 'DEGREES', 'RADIANS') + self.lnodeRAD = spice.convrt( ison.NodeDEG, 'DEGREES', 'RADIANS') + self.argpRAD = spice.convrt( ison.PeriDEG, 'DEGREES', 'RADIANS') + self.m0RAD = spice.convrt( ison.M0, 'DEGREES', 'RADIANS') + self.t0 = spice.str2et( ison.T0_TDT[0] ) + spice.convrt( ison.T0_TDT[1], 'DAYS', 'SECONDS' ) + self.mu = ison.MuM3S2 * 1e-9 + self.elts = ( self.rpKM, self.ecc, self.incRAD, self.lnodeRAD, self.argpRAD, self.m0RAD, self.t0, self.mu ) + + self.ditime = spice.utc2et( '2013-01-16 12:00:00' ) + + def tearDown(self): + ### Unload the kernel + spice.unload( __file__ ) + + ### Test conics and others + def test_bodvXds(self): + periState = spice.conics( self.elts, self.t0) + self.assertAlmostEqual( spice.vnorm(periState[:3]), self.rpKM, places=11) + helioIson = MPC_HELIOCENTRIC_ISON() + for jdtt,pos,vel in helioIson.jpv: + et = spice.str2et( jdtt ) + conicState = spice.conics( self.elts, et ) + print( conicState ) + print( pos+vel ) + self.assertAlmostEqual( spice.vdist(conicState[:3], pos), 0.0, places=3) + + +if __name__=="__main__": + unittest.main() +""" +naif0010.tls - leapseconds through mid-2012 + +KPL/LSK + + +LEAPSECONDS KERNEL FILE +=========================================================================== + +Modifications: +-------------- + +2012, Jan. 5 NJB Modified file to account for the leapsecond that + will occur on June 30, 2012. + +2008, Jul. 7 NJB Modified file to account for the leapsecond that + will occur on December 31, 2008. + +2005, Aug. 3 NJB Modified file to account for the leapsecond that + will occur on December 31, 2005. + +1998, Jul 17 WLT Modified file to account for the leapsecond that + will occur on December 31, 1998. + +1997, Feb 22 WLT Modified file to account for the leapsecond that + will occur on June 30, 1997. + +1995, Dec 14 KSZ Corrected date of last leapsecond from 1-1-95 + to 1-1-96. + +1995, Oct 25 WLT Modified file to account for the leapsecond that + will occur on Dec 31, 1995. + +1994, Jun 16 WLT Modified file to account for the leapsecond on + June 30, 1994. + +1993, Feb. 22 CHA Modified file to account for the leapsecond on + June 30, 1993. + +1992, Mar. 6 HAN Modified file to account for the leapsecond on + June 30, 1992. + +1990, Oct. 8 HAN Modified file to account for the leapsecond on + Dec. 31, 1990. + + +Explanation: +------------ + +The contents of this file are used by the routine DELTET to compute the +time difference + +[1] DELTA_ET = ET - UTC + +the increment to be applied to UTC to give ET. + +The difference between UTC and TAI, + +[2] DELTA_AT = TAI - UTC + +is always an integral number of seconds. The value of DELTA_AT was 10 +seconds in January 1972, and increases by one each time a leap second +is declared. Combining [1] and [2] gives + +[3] DELTA_ET = ET - (TAI - DELTA_AT) + + = (ET - TAI) + DELTA_AT + +The difference (ET - TAI) is periodic, and is given by + +[4] ET - TAI = DELTA_T_A + K sin E + +where DELTA_T_A and K are constant, and E is the eccentric anomaly of the +heliocentric orbit of the Earth-Moon barycenter. Equation [4], which ignores +small-period fluctuations, is accurate to about 0.000030 seconds. + +The eccentric anomaly E is given by + +[5] E = M + EB sin M + +where M is the mean anomaly, which in turn is given by + +[6] M = M + M t + 0 1 + +where t is the number of ephemeris seconds past J2000. + +Thus, in order to compute DELTA_ET, the following items are necessary. + + DELTA_TA + K + EB + M0 + M1 + DELTA_AT after each leap second. + +The numbers, and the formulation, are taken from the following sources. + + 1) Moyer, T.D., Transformation from Proper Time on Earth to + Coordinate Time in Solar System Barycentric Space-Time Frame + of Reference, Parts 1 and 2, Celestial Mechanics 23 (1981), + 33-56 and 57-68. + + 2) Moyer, T.D., Effects of Conversion to the J2000 Astronomical + Reference System on Algorithms for Computing Time Differences + and Clock Rates, JPL IOM 314.5--942, 1 October 1985. + +The variable names used above are consistent with those used in the +Astronomical Almanac. + +\begindata + +DELTET/DELTA_T_A = 32.184 +DELTET/K = 1.657D-3 +DELTET/EB = 1.671D-2 +DELTET/M = ( 6.239996D0 1.99096871D-7 ) + +DELTET/DELTA_AT = ( 10, @1972-JAN-1 + 11, @1972-JUL-1 + 12, @1973-JAN-1 + 13, @1974-JAN-1 + 14, @1975-JAN-1 + 15, @1976-JAN-1 + 16, @1977-JAN-1 + 17, @1978-JAN-1 + 18, @1979-JAN-1 + 19, @1980-JAN-1 + 20, @1981-JUL-1 + 21, @1982-JUL-1 + 22, @1983-JUL-1 + 23, @1985-JUL-1 + 24, @1988-JAN-1 + 25, @1990-JAN-1 + 26, @1991-JAN-1 + 27, @1992-JUL-1 + 28, @1993-JUL-1 + 29, @1994-JUL-1 + 30, @1996-JAN-1 + 31, @1997-JUL-1 + 32, @1999-JAN-1 + 33, @2006-JAN-1 + 34, @2009-JAN-1 + 35, @2012-JUL-1 ) + +\begintext +""" diff --git a/tests/test_smap.py b/tests/test_smap.py new file mode 100755 index 0000000..0872fe0 --- /dev/null +++ b/tests/test_smap.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python + +import os +import sys +import math +import spice +from collections import OrderedDict as OD +import unittest + +class TestSMAP(unittest.TestCase): + + def setUp(self): + mydir = os.path.dirname(__file__) + self.kernels = [ os.path.join( mydir, i.strip() ) for i in """ +### Lines in this string that start with '#' are comments +### The other lines in this string are paths to kernels, +### relative to the parent directory of this Python script, __file__ +### +kernels/naif0010.tls +kernels/smap_v00.tf +kernels/pck00009.tpc +kernels/spk_drm239_WithBurn-full.bsp +kernels/smap_test.bsp +### +### kernels/SMAP_ref_150529_180529.bsp +### +### That commented SMAP SPK kernel, or one like it, should be under this URL: +### +### http://naif.jpl.nasa.gov/pub/naif/SMAP/kernels/spk/ +### +### +""".strip().split('\n') if i[0]!='#' ] + + ### Load default kernels (string variable "kernels" above") + for kernel in self.kernels: spice.furnsh( kernel ) + + def tearDown(self): + ### Unload any kernels + for kernel in self.kernels: spice.unload( kernel ) + + def test_smap(self): + + target = 'SMAP' + + et0 = spice.utc2et( '2016-06-01T12:00:00' ) + + dpr = spice.dpr() + + a,b,c = [spice.gdpool('BODY399_RADII',i,1)[1] for i in range(3)] + + ods = [] + + for deltatime in [0.1 * i for i in range(1080)]: + et = et0 + deltatime + stSmap,lsSmap = spice.spkezr( target, et, 'IAU_EARTH', 'NONE', 'EARTH' ) + posn, veloc = stSmap[:3], stSmap[3:] + stSun,lsSun = spice.spkezr( 'SUN', et0, 'IAU_EARTH', 'LT', 'EARTH' ) + mtx = spice.pxform( 'SMAP_REFLECTOR', 'IAU_EARTH', et) + boreEbf = spice.mxv( mtx, [1.0,0,0] ) + point = spice.surfpt( posn, boreEbf, a, b, c) + rsurfpt,lon,lat = spice.reclat( point ) + utc = spice.et2utc( et, 'ISOC', 3 ) + + ods += [ OD(deltatime=deltatime,posn=posn,veloc=veloc,boreEbf=boreEbf + ,utc=utc,point=point,rsurfpt=rsurfpt + ,rsmap=spice.vnorm(posn),lat=lat,lon=lon + ,raynge=spice.vnorm(spice.vsub(point,posn)) + ,sunsep=spice.vsep( spice.ucrss(posn,veloc), stSun[:3] ) + ) + ] + + try: + ### Moved matplotlib import to here so test runs to here at least + from matplotlib import pyplot as plt + plt.figure(1) + keys = 'lat lon raynge'.split() + secs = [od['deltatime'] for od in ods] + for idx in range(len(keys)): + scal = 1.0 if keys[idx] in 'rsurfpt rsmap raynge sunsep rp ecc t0 mu a P eccmean amean Pmean'.split() else dpr + ordinate = [od[keys[idx]]*scal for od in ods] + plt.subplot( 221+idx ) + plt.plot( secs, ordinate ) + plt.plot( secs, ordinate, '.') + plt.title( keys[idx] ) + plt.ylabel( '%s%s' % (keys[idx],'' if scal==1.0 else ', deg') ) + if idx>1: plt.xlabel( 'T-T0, s' ) + + abscissa = [od['lon']*dpr for od in ods] + ordinate = [od['lat']*dpr for od in ods] + plt.subplot( 221+idx+1 ) + plt.title( 'lon vs. lat' ) + plt.plot( abscissa, ordinate ) + plt.xlabel( 'lon, deg' ) + plt.ylabel( 'lat, deg' ) + plt.show() + + except: + print( "Bypassed, or failed, matplotlib tests" ) + + +if __name__=="__main__": + unittest.main()