<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple style='word-wrap: break-word;
-webkit-nbsp-mode: space;-webkit-line-break: after-white-space'>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>For anyone interested<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I&#8217;ve created a proof of concept working version of SPICE that
has managed C++ code wrappers for the SPICE functionality and can be directly
called from C#.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>This code will be used in the RBSP mission for the RBSPICE Instrument
data processing segment of the Science Operations Center.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>We are several years from needing implementation but I did the
proof of concept to verify that the capability can be developed and easily
utilized.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>At this time, I have implemented wrappers for some of the time
conversion functions and for some of the simple ephemeris functionality.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I&#8217;m in the process as time allows to integrate the C# code into
the SPICE exception handling so that all SPICE exceptions can be directly
processed thru the C# code without low level queries into the SPICE exception
routines.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>All of this development has been done under the Visual Studio
2008 IDE.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I&#8217;m happy to share what I&#8217;ve accomplished if anyone is
interested.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Jerry<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'>Jerry W. Manweiler</span><span
style='font-size:10.0pt;color:#1F497D'>, Ph.D.</span><span style='font-size:
11.0pt;color:#1F497D'> <br>
Managing Member <br>
Fundamental Technologies, LLC <br>
(785) 840-0800&nbsp;&nbsp; FAX: (785) 840-0808 <o:p></o:p></span></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'>Information contained in this email and
any attachments are proprietary and confidential to Fundamental Technologies,
LLC. All rights reserved, this document, attachments, or parts thereof may not
be duplicated or reproduced in any form without the written permission of
Fundamental Technologies, LLC&nbsp; &copy; 2007 &#8211; All Rights Reserved.<o:p></o:p></span></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'>If you have received this email in error
please inform the sender of the email and delete the email immediately.</span><span
style='font-size:11.0pt;color:#1F497D'><br>
_______________________________________________________________________________<o:p></o:p></span></p>

</div>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
spice_discussion-bounces@naif.jpl.nasa.gov
[mailto:spice_discussion-bounces@naif.jpl.nasa.gov] <b>On Behalf Of </b>YAMAMOTO
Yukio<br>
<b>Sent:</b> Tuesday, February 24, 2009 2:36 PM<br>
<b>To:</b> spice_discussion@naif.jpl.nasa.gov<br>
<b>Subject:</b> [Spice_discussion] Re: Spice and .NET (C#)<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<div>

<p class=MsoNormal>Keith:<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'>

<div>

<p class=MsoNormal><span style='color:black'>I'm wondering if anyone has worked
with the spice toolkit in .NET with C#?</span><o:p></o:p></p>

</div>

</blockquote>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<p class=MsoNormal>I've just tested and a sample code works fine.<o:p></o:p></p>

<div>

<p class=MsoNormal>DLL is required to access from C#.NET.<o:p></o:p></p>

</div>

<div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal>I did the following steps to make cspice.dll:<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal>0. Download Visual C 32bit cspice.exe&nbsp;from NAIF
Toolkit&nbsp;and extract it<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>1. Put attached files: 'cspice.def', 'mkcspice_dll.bat' into
(somewhere)\cspice\src\cspice<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>2. Make 'erf' and 'erfc' functions due to the lack of these
functions in VC++<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal># attached 'erf.c' works for 32 bit architecture (put it in
the same directory above)<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>3. Execute mkcspice_dll.bat<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal># cspice.dll can be found in (somewhere)\cspice\lib<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal>Just in case,&nbsp;I'll show a sample code using cspice.dll.<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>ConsoleApplication1.exe, de421.bsp, and cspice.dll must be
in the&nbsp;same directory.<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal>Regards,<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>Yukio<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</div>

</div>

</body>

</html>