<!doctypehtml PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns=http://www.w3.org/1999/xhtml><meta content="text/html; charset=utf-8"http-equiv=Content-Type><title>
   constants.TAU - Nullege Python Samples
  </title><link href=/opensearch.xml rel=search title=Nullege type=application/opensearchdescription+xml><link href=/favicon.ico rel=icon type=image/x-icon><link rel="shortcut icon"href=/favicon.ico type=image/x-icon><meta content='28 Samples. ...  from .constants import ASEC2RAD, ASEC360, DEG2RAD, TAU, PSI_COR, EPS_COR, T0  def compute_nutation(jd): """Generate the nutation rotations f...'name=description><meta content="constants, TAU, python, Samples"name=keywords><link href=/codes/search/constants.TAU rel=canonical><link href=/min/b=css&f=jquery.autocomplete.css,nullege.css rel=stylesheet><script src=http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js></script><meta content=208737708787 property=fb:page_id><body><script>var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-7648444-4']);
        _gaq.push(['_trackPageview']);

        (function() {
         var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
         ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
         var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
         })();</script><div id=container><div id=header></div><div id=content><link href=/min/b=css&f=shCore.css,shThemeDefault.css rel=stylesheet><link href=/css/jstree_themes/default/style.css rel=stylesheet><div id=searchboxdiv><div id=small-logo-div><a href=/> <img title="Nullege Home"alt=Logo id=small-logo src=/img/small_logo.png> </a></div><div id=searchbox-right><form action=/codes/search id=searchboxform method=GET><input id=searchbox maxlength=512 name=cq size=60 value=constants.TAU><input type=submit value=Search></form><div class=navsrc></div><p class=survey>Did I find the right examples for you? <a href=https://docs.google.com/forms/d/1alqcvGzIUWSeA4dddg8IKVtr6bmq8TtdB5x4-beBwSw/viewform?entry.1738482762=constants.TAU&entry.722536272=Yes&entry.650821291&entry.1397510218&entry.926073440 target=_blank> yes </a> <a href=https://docs.google.com/forms/d/1alqcvGzIUWSeA4dddg8IKVtr6bmq8TtdB5x4-beBwSw/viewform?entry.1738482762=constants.TAU&entry.722536272=No&entry.650821291&entry.1397510218&entry.926073440 target=_blank> no </a>      <a href=https://docs.google.com/forms/d/1r1U0dkUY9Q7ymAzj5wEdCbcc525toyDRfBKpSoAzybE/viewform> Crawl my project </a>      <a href=http://www.indeed.com/jobs?q=python+developer&indpubnum=4512257349063218&chnl=searchbox target=indeed_search> Python Jobs </a></div><script src=/min/b=js&f=searchbox.js></script><script>$(function() {
        init_autocomplete("python");
    });</script></div><div id=main style=min-height:500px><div class=ui-layout-west id=west-wrapper><div id=cetree_wrapper><div id=cetree></div></div><div id=ad_wrapper><div id=ad><script async src=//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js></script><ins class=adsbygoogle data-ad-client=ca-pub-7605927754820076 data-ad-slot=5587621662 style=display:inline-block;width:300px;height:250px> </ins><script>(adsbygoogle = window.adsbygoogle || []).push({});</script></div></div></div><div class=ui-layout-center id=mainsrc><div><div class=showdoc><div class=cetitle><h1><a href=/codes/search/constants.TAU> constants.TAU </a></h1></div> All Samples(7)  |  Call(0)  |  Derive(0)  |  Import(7) <div class=doc><pre>float(x) -> floating point number

Convert a string or number to a floating point number, if possible.
</pre></div></div></div><br><a class=filelink href=/codes/show/src%40s%40k%40skyfield-0.1%40skyfield%40nutationlib.py/3/constants.TAU/python> src/s/k/skyfield-0.1/skyfield/nutationlib.py </a>     <strong> <a href=/projects/show/34116> skyfield </a> </strong> ( <a href=https://pypi.python.org/packages/source/s/skyfield/skyfield-0.1.tar.gz> Download </a> ) <div class=codebox><input name=filename type=hidden value=src/s/k/skyfield-0.1/skyfield/nutationlib.py><input name=codename type=hidden value=constants.TAU><div><pre class="brush: python; first-line: 1; highlight:[3]">"""Routines that compute Earth nutation."""
from numpy import array, cos, fmod, sin, outer, tensordot, zeros
from .constants import ASEC2RAD, ASEC360, DEG2RAD, TAU, PSI_COR, EPS_COR, T0
 
def compute_nutation(jd):
</pre></div></div><div class=codebox><input name=filename type=hidden value=src/s/k/skyfield-0.1/skyfield/nutationlib.py><input name=codename type=hidden value=constants.TAU><div><pre class="brush: python; first-line: 108; highlight:[110]">              (    -0.00024470)
              * t) * t) * t) * t) * ASEC2RAD
              + (1325.0*t % 1.0) * TAU)
 
    # Mean Anomaly of the Sun.
</pre></div></div><div class=codebox><input name=filename type=hidden value=src/s/k/skyfield-0.1/skyfield/nutationlib.py><input name=codename type=hidden value=constants.TAU><div><pre class="brush: python; first-line: 118; highlight:[120]">              (     -0.00001149)
              * t) * t) * t) * t) * ASEC2RAD
              + (99.0*t % 1.0) * TAU)
 
    # Mean Longitude of the Moon minus Mean Longitude of the Ascending
</pre></div></div><div class=codebox><input name=filename type=hidden value=src/s/k/skyfield-0.1/skyfield/nutationlib.py><input name=codename type=hidden value=constants.TAU><div><pre class="brush: python; first-line: 129; highlight:[131]">              (      0.00000417)
              * t) * t) * t) * t) * ASEC2RAD
              + (1342.0*t % 1.0) * TAU)
 
    # Mean Elongation of the Moon from the Sun.
</pre></div></div><div class=codebox><input name=filename type=hidden value=src/s/k/skyfield-0.1/skyfield/nutationlib.py><input name=codename type=hidden value=constants.TAU><div><pre class="brush: python; first-line: 139; highlight:[141]">              (     -0.00003169)
              * t) * t) * t) * t) * ASEC2RAD
              + (1236.0*t % 1.0) * TAU)
 
    # Mean Longitude of the Ascending Node of the Moon.
</pre></div></div><br><a class=filelink href=/codes/show/src%40p%40y%40python-skyfield-HEAD%40skyfield%40nutationlib.py/3/constants.TAU/python> src/p/y/python-skyfield-HEAD/skyfield/nutationlib.py </a>     <strong> <a href=/projects/show/57090> python-skyfield </a> </strong> ( <a href=git://github.com/brandon-rhodes/python-skyfield.git> Download </a> ) <div class=codebox><input name=filename type=hidden value=src/p/y/python-skyfield-HEAD/skyfield/nutationlib.py><input name=codename type=hidden value=constants.TAU><div><pre class="brush: python; first-line: 1; highlight:[3]">"""Routines that compute Earth nutation."""
from numpy import array, cos, fmod, sin, outer, tensordot, zeros
from .constants import ASEC2RAD, ASEC360, DEG2RAD, TAU, PSI_COR, EPS_COR, T0
 
def compute_nutation(jd):
</pre></div></div><div class=codebox><input name=filename type=hidden value=src/p/y/python-skyfield-HEAD/skyfield/nutationlib.py><input name=codename type=hidden value=constants.TAU><div><pre class="brush: python; first-line: 108; highlight:[110]">              (    -0.00024470)
              * t) * t) * t) * t) * ASEC2RAD
              + (1325.0*t % 1.0) * TAU)
 
    # Mean Anomaly of the Sun.
</pre></div></div><div class=codebox><input name=filename type=hidden value=src/p/y/python-skyfield-HEAD/skyfield/nutationlib.py><input name=codename type=hidden value=constants.TAU><div><pre class="brush: python; first-line: 118; highlight:[120]">              (     -0.00001149)
              * t) * t) * t) * t) * ASEC2RAD
              + (99.0*t % 1.0) * TAU)
 
    # Mean Longitude of the Moon minus Mean Longitude of the Ascending
</pre></div></div><div class=codebox><input name=filename type=hidden value=src/p/y/python-skyfield-HEAD/skyfield/nutationlib.py><input name=codename type=hidden value=constants.TAU><div><pre class="brush: python; first-line: 129; highlight:[131]">              (      0.00000417)
              * t) * t) * t) * t) * ASEC2RAD
              + (1342.0*t % 1.0) * TAU)
 
    # Mean Elongation of the Moon from the Sun.
</pre></div></div><div class=codebox><input name=filename type=hidden value=src/p/y/python-skyfield-HEAD/skyfield/nutationlib.py><input name=codename type=hidden value=constants.TAU><div><pre class="brush: python; first-line: 139; highlight:[141]">              (     -0.00003169)
              * t) * t) * t) * t) * ASEC2RAD
              + (1236.0*t % 1.0) * TAU)
 
    # Mean Longitude of the Ascending Node of the Moon.
</pre></div></div><br><a class=filelink href=/codes/show/src%40s%40k%40skyfield-0.1%40skyfield%40positionlib.py/7/constants.TAU/python> src/s/k/skyfield-0.1/skyfield/positionlib.py </a>     <strong> <a href=/projects/show/34116> skyfield </a> </strong> ( <a href=https://pypi.python.org/packages/source/s/skyfield/skyfield-0.1.tar.gz> Download </a> ) <div class=codebox><input name=filename type=hidden value=src/s/k/skyfield-0.1/skyfield/positionlib.py><input name=codename type=hidden value=constants.TAU><div><pre class="brush: python; first-line: 5; highlight:[7]">from .angles import (interpret_longitude, interpret_latitude,
                     Angle, HourAngle, SignedAngle)
from .constants import TAU
from .functions import length_of, spin_x
from .earthlib import (compute_limb_angle, geocentric_position_and_velocity,
</pre></div></div><div class=codebox><input name=filename type=hidden value=src/s/k/skyfield-0.1/skyfield/positionlib.py><input name=codename type=hidden value=constants.TAU><div><pre class="brush: python; first-line: 15; highlight:[17]"> 
ecliptic_obliquity = (23 + (26/60.) + (21.406/3600.)) * pi / 180.
quarter_tau = 0.25 * TAU
 
class ICRS(object):
</pre></div></div><div class=codebox><input name=filename type=hidden value=src/s/k/skyfield-0.1/skyfield/positionlib.py><input name=codename type=hidden value=constants.TAU><div><pre class="brush: python; first-line: 179; highlight:[181]"> 
        gast = sidereal_time(self.jd, use_eqeq=True)
        spin = spin_x(-gast * TAU / 24.0)
        uz = einsum('i...,ij...->j...', uze, spin)
        un = einsum('i...,ij...->j...', une, spin)
</pre></div></div><div class=codebox><input name=filename type=hidden value=src/s/k/skyfield-0.1/skyfield/positionlib.py><input name=codename type=hidden value=constants.TAU><div><pre class="brush: python; first-line: 216; highlight:[218]"> 
    gast = sidereal_time(jd, use_eqeq=True)
    spin = spin_x(-gast * TAU / 24.0)
    position = einsum('i...,ij...->j...', array(rITRF), spin)
    return einsum('ij...,j...->i...', jd.MT, position)
</pre></div></div><br>      <div style=margin-top:10px><script><!--
            google_ad_client = "ca-pub-7605927754820076";
            /* nullege bottom links */
            google_ad_slot = "4117027950";
            google_ad_width = 468;
            google_ad_height = 15;
            //--></script><script src=http://pagead2.googlesyndication.com/pagead/show_ads.js></script></div></div></div><script>$(function() {
            // layout
            console.log($('#main').height());
            var main_height = $(window).height() - 110;
            main_height = main_height < 500 ? 500 : main_height;
            $('#main').height(main_height);
            $('#main').layout( {
                applyDefaultStyles: true,
                center: {
                    //paneSelector: '#mainsrc',
                    //minHeight: main_height
                },
                west__size : 315
            });
            $('#west-wrapper').layout( {
                center__paneSelector: '#cetree_wrapper',
                south__paneSelector: '#ad_wrapper',
                south__size: 250
            });
            
            // syntax highlight
            SyntaxHighlighter.highlight();

            // hook show implementation function
            $('#showimp').bind('click', function(e) {
                $('#showimpdiv').hide();
                $('#impsrc').css('display', 'block');
                return false;
            });

            // Make line numbers and each line of code clickable.
            base = "/codes/show";
            $('div.codebox').each(function() {
                var src_input = $(this).find('input[name=filename]');
                if (!src_input || src_input.length === 0) return;
                
                var sfile = src_input.val().replace(/\//g, '@');
                var codename = $(this).find('input[name=codename]').val();
                var start_line = parseInt($($(this).find('td.gutter > div.line')[0]).text(), 10);

                // wrap line numbers in <a>
                $(this).find('td.gutter > div.line').each(function() {
                    url = base + '/' + sfile + '/' + $(this).text() + '/' + codename + '/python';
                    $(this).wrap('<a href="' + url + '">');
                });

                // wrap each line of code in an <a>
                $(this).find('td.code div.line').each(function(idx) {
                    url = base + '/' + sfile + '/' + (idx + start_line) + '/' + codename + '/python';
                    $(this).wrap('<a class="hlcode" href="' + url + '">');
                });
            });

            // generate left side tree
            var open_nodes = [];
            var current_id = 458404;
            var current_selected = false;

            window.open_one_layer = function() {
                var next = open_nodes.shift();
                if(next) {
                    $('#cetree').jstree("open_node", $('#jst' + next));
                }
                else if(!current_selected) {
                    $('#cetree').jstree("select_node", $('#jst' + current_id));
                    current_selected = true;
                }
            };

            $("#cetree")
            .bind("loaded.jstree open_node.jstree", function(event, data) {
                setTimeout("open_one_layer()", 500);
            })
            .bind("select_node.jstree", function(event, data) {
                if(data.rslt.obj.attr("id") !== "jst" + current_id) {
                    url = "/codes/search/" +
                                    data.rslt.obj.attr("name") + "/python";
                    window.location.replace(url);
                }
            })
            .jstree({
                "plugins" : ["themes", "json_data", "ui"],
                "core" : { "animation" : 300 },
                "json_data" : {
                    "progressive_render" : true,
                    "data" : [ [{"data":null,"state":"leaf","attr":{"id":"jst","name":null}}] ],
                    "ajax" : {
                        "url" : "/code_entities/jstree_data_json",
                        "data" : function(n) { return { "id" : n.attr ? n.attr("id").substr(3) : -1};}
                    }
                }
                //"ui" : { "initially_select" : ["constants.TAU".replace(/([ #;&,.+*~\':"!^$[\]()=>|\/])/g,'\\$1')] }
            });

            function fix_height() {
                $('#mainsrc').height($('#main').height());
                console.log('here' + $('#mainsrc').height());
            }
            window.setTimeout(fix_height, 1000);
	});</script><script src=/min/b=js&f=shCore.js,shBrushPython.js,jquery.layout.js,jquery.jstree.js></script></div></div><div id=footer><a href=/pages/about> About Us (Contact Us) </a> | <a href=/pages/privacy> Privacy </a> | <a href=http://twitter.com/nullege> Twitter </a> | <a href=http://www.facebook.com/pages/nullege/208737708787> Facebook </a> | <a title="Open feedback & support dialog (powered by UserVoice)"href=javascript:UserVoice.showPopupWidget();> Feedback </a></div><script src=/min/b=js&f=jquery.autocomplete.js></script><script>(function() {
                var uv = document.createElement('script'); uv.type = 'text/javascript'; uv.async = true;
                uv.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'widget.uservoice.com/ed9ETa1MDOo2yB4DbS4gQ.js';
                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(uv, s);
            })();</script>