Day 66 and 67: Focus and the Predator

DSCN0923b

I’m spending a couple of days making some serious progress on Secret Plan 174 (the 100-year-old telescope), and also finishing the wiring diagrams for SP161.

When you want to get some work done in the city, there are plenty of good places downtown. If you haven’t got time to walk, the Market Street Railway has a whole fleet of restored streetcars from various cities. As 10-minute commutes go, they’re pretty cool.

DSCN0983

One of my favorite desks is the window table on the third floor of the Virgin building. It’s usually not crowded, the staff is friendly, the grilled sandwiches are good.

DSCN0919

…and when you’re not in the mood for a quiet place, you can park in several different spots abound Yerba Buena Gardens, just a few blocks away.

DSCN0982
Don’t come here to get work done on Friday night.

With some time to Focus, progress on the telescope is good. It’s being written to run for a very long time, on just about any operating system. Here’s an early version of the control screen (the red-on-black is so that astronomers can read it without messing up their night vision):


One of these numbers is wrong.

Yep, the calculation for sidereal time isn’t correct yet. I have to come clean about that, because there are math and science experts reading this. (You know who you are.) If that number is even slightly wrong, the telescope won’t work. My current cheeseball placeholder equation is “SIDEREAL = UT – 11.3”.

At night, my muse and I get a very tasty dinner from Tao Cafe. The price of dinner includes a promise that I’ll bring the owner some plums from our tree.

The 2-year-old cat isn’t just playing with her stuffed fish. She’s kicking the stuffing out of it like a crazed puppy. We’ll need a new fish for sure.

DSCN0922 DSCN0926

The 18-year-old cat is keeping safely out of the way, but his plan falls apart when she comes leaping down the hall and knocks the bag over. Sigh.

Random assertion: The predators who enjoyed hunting are the ones who survived.

Steganographic data: 1848/6.8

Advertisements
Published in: on July 25, 2008 at 8:33 am  Comments (5)  
Tags: , , ,

The URI to TrackBack this entry is: https://stuntrabbit.wordpress.com/2008/07/25/day-66-and-67-focus-and-the-predator/trackback/

RSS feed for comments on this post.

5 CommentsLeave a comment

  1. I use the code below, from Stellarium.

    http://www.stellarium.org/

    This cut and paste is a bit pesky of me, I know, but a large piece of cheesecake and three episodes of The Tick in a row…

    /*
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Library General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place – Suite 330, Boston, MA 02111-1307, USA.

    Copyright (C) 2000 Liam Girdwood

    */

    /* taken from table 21.A pg 133 */

    #ifndef LN_NUTATION_H
    #define LN_NUTATION_H

    /* Nutation is a period oscillation of the Earths rotational axis around it’s mean position.*/

    // Contains Nutation in longitude, obliquity and ecliptic obliquity.
    // Angles are expressed in degrees.
    struct ln_nutation
    {
    double longitude; /*!< Nutation in longitude */
    double obliquity; /*!< Nutation in obliquity */
    double ecliptic; /*!< Obliquity of the ecliptic */
    };

    struct nutation_arguments
    {
    double D;
    double M;
    double MM;
    double F;
    double O;
    };

    struct nutation_coefficients
    {
    double longitude1;
    double longitude2;
    double obliquity1;
    double obliquity2;
    };

    /* Calculate nutation of longitude and obliquity in degrees from Julian Ephemeris Day
    * params : JD Julian Day, nutation Pointer to store nutation.
    * Chapter 21 pg 131-134 Using Table 21A */
    void get_nutation (double JD, struct ln_nutation * nutation);

    #endif

    /*
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Library General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place – Suite 330, Boston, MA 02111-1307, USA.

    Copyright (C) 2000 Liam Girdwood

    */

    #include “nutation.h”
    #include

    #define TERMS 63
    #define LN_NUTATION_EPOCH_THRESHOLD 0.1

    /* arguments and coefficients taken from table 21A on page 133 */

    const static struct nutation_arguments arguments[TERMS] = {
    {0.0, 0.0, 0.0, 0.0, 1.0},
    {-2.0, 0.0, 0.0, 2.0, 2.0},
    {0.0, 0.0, 0.0, 2.0, 2.0},
    {0.0, 0.0, 0.0, 0.0, 2.0},
    {0.0, 1.0, 0.0, 0.0, 0.0},
    {0.0, 0.0, 1.0, 0.0, 0.0},
    {-2.0, 1.0, 0.0, 2.0, 2.0},
    {0.0, 0.0, 0.0, 2.0, 1.0},
    {0.0, 0.0, 1.0, 2.0, 2.0},
    {-2.0, -1.0, 0.0, 2.0, 2.0},
    {-2.0, 0.0, 1.0, 0.0, 0.0},
    {-2.0, 0.0, 0.0, 2.0, 1.0},
    {0.0, 0.0, -1.0, 2.0, 2.0},
    {2.0, 0.0, 0.0, 0.0, 0.0},
    {0.0, 0.0, 1.0, 0.0, 1.0},
    {2.0, 0.0, -1.0, 2.0, 2.0},
    {0.0, 0.0, -1.0, 0.0, 1.0},
    {0.0, 0.0, 1.0, 2.0, 1.0},
    {-2.0, 0.0, 2.0, 0.0, 0.0},
    {0.0, 0.0, -2.0, 2.0, 1.0},
    {2.0, 0.0, 0.0, 2.0, 2.0},
    {0.0, 0.0, 2.0, 2.0, 2.0},
    {0.0, 0.0, 2.0, 0.0, 0.0},
    {-2.0, 0.0, 1.0, 2.0, 2.0},
    {0.0, 0.0, 0.0, 2.0, 0.0},
    {-2.0, 0.0, 0.0, 2.0, 0.0},
    {0.0, 0.0, -1.0, 2.0, 1.0},
    {0.0, 2.0, 0.0, 0.0, 0.0},
    {2.0, 0.0, -1.0, 0.0, 1.0},
    {-2.0, 2.0, 0.0, 2.0, 2.0},
    {0.0, 1.0, 0.0, 0.0, 1.0},
    {-2.0, 0.0, 1.0, 0.0, 1.0},
    {0.0, -1.0, 0.0, 0.0, 1.0},
    {0.0, 0.0, 2.0, -2.0, 0.0},
    {2.0, 0.0, -1.0, 2.0, 1.0},
    {2.0, 0.0, 1.0, 2.0, 2.0},
    {0.0, 1.0, 0.0, 2.0, 2.0},
    {-2.0, 1.0, 1.0, 0.0, 0.0},
    {0.0, -1.0, 0.0, 2.0, 2.0},
    {2.0, 0.0, 0.0, 2.0, 1.0},
    {2.0, 0.0, 1.0, 0.0, 0.0},
    {-2.0, 0.0, 2.0, 2.0, 2.0},
    {-2.0, 0.0, 1.0, 2.0, 1.0},
    {2.0, 0.0, -2.0, 0.0, 1.0},
    {2.0, 0.0, 0.0, 0.0, 1.0},
    {0.0, -1.0, 1.0, 0.0, 0.0},
    {-2.0, -1.0, 0.0, 2.0, 1.0},
    {-2.0, 0.0, 0.0, 0.0, 1.0},
    {0.0, 0.0, 2.0, 2.0, 1.0},
    {-2.0, 0.0, 2.0, 0.0, 1.0},
    {-2.0, 1.0, 0.0, 2.0, 1.0},
    {0.0, 0.0, 1.0, -2.0, 0.0},
    {-1.0, 0.0, 1.0, 0.0, 0.0},
    {-2.0, 1.0, 0.0, 0.0, 0.0},
    {1.0, 0.0, 0.0, 0.0, 0.0},
    {0.0, 0.0, 1.0, 2.0, 0.0},
    {0.0, 0.0, -2.0, 2.0, 2.0},
    {-1.0, -1.0, 1.0, 0.0, 0.0},
    {0.0, 1.0, 1.0, 0.0, 0.0},
    {0.0, -1.0, 1.0, 2.0, 2.0},
    {2.0, -1.0, -1.0, 2.0, 2.0},
    {0.0, 0.0, 3.0, 2.0, 2.0},
    {2.0, -1.0, 0.0, 2.0, 2.0}};

    const static struct nutation_coefficients coefficients[TERMS] = {
    {-171996.0, -174.2, 92025.0,8.9},
    {-13187.0, -1.6, 5736.0, -3.1},
    {-2274.0, 0.2, 977.0, -0.5},
    {2062.0, 0.2, -895.0, 0.5},
    {1426.0, -3.4, 54.0, -0.1},
    {712.0, 0.1, -7.0, 0.0},
    {-517.0, 1.2, 224.0, -0.6},
    {-386.0, -0.4, 200.0, 0.0},
    {-301.0, 0.0, 129.0, -0.1},
    {217.0, -0.5, -95.0, 0.3},
    {-158.0, 0.0, 0.0, 0.0},
    {129.0, 0.1, -70.0, 0.0},
    {123.0, 0.0, -53.0, 0.0},
    {63.0, 0.0, 0.0, 0.0},
    {63.0, 1.0, -33.0, 0.0},
    {-59.0, 0.0, 26.0, 0.0},
    {-58.0, -0.1, 32.0, 0.0},
    {-51.0, 0.0, 27.0, 0.0},
    {48.0, 0.0, 0.0, 0.0},
    {46.0, 0.0, -24.0, 0.0},
    {-38.0, 0.0, 16.0, 0.0},
    {-31.0, 0.0, 13.0, 0.0},
    {29.0, 0.0, 0.0, 0.0},
    {29.0, 0.0, -12.0, 0.0},
    {26.0, 0.0, 0.0, 0.0},
    {-22.0, 0.0, 0.0, 0.0},
    {21.0, 0.0, -10.0, 0.0},
    {17.0, -0.1, 0.0, 0.0},
    {16.0, 0.0, -8.0, 0.0},
    {-16.0, 0.1, 7.0, 0.0},
    {-15.0, 0.0, 9.0, 0.0},
    {-13.0, 0.0, 7.0, 0.0},
    {-12.0, 0.0, 6.0, 0.0},
    {11.0, 0.0, 0.0, 0.0},
    {-10.0, 0.0, 5.0, 0.0},
    {-8.0, 0.0, 3.0, 0.0},
    {7.0, 0.0, -3.0, 0.0},
    {-7.0, 0.0, 0.0, 0.0},
    {-7.0, 0.0, 3.0, 0.0},
    {-7.0, 0.0, 3.0, 0.0},
    {6.0, 0.0, 0.0, 0.0},
    {6.0, 0.0, -3.0, 0.0},
    {6.0, 0.0, -3.0, 0.0},
    {-6.0, 0.0, 3.0, 0.0},
    {-6.0, 0.0, 3.0, 0.0},
    {5.0, 0.0, 0.0, 0.0},
    {-5.0, 0.0, 3.0, 0.0},
    {-5.0, 0.0, 3.0, 0.0},
    {-5.0, 0.0, 3.0, 0.0},
    {4.0, 0.0, 0.0, 0.0},
    {4.0, 0.0, 0.0, 0.0},
    {4.0, 0.0, 0.0, 0.0},
    {-4.0, 0.0, 0.0, 0.0},
    {-4.0, 0.0, 0.0, 0.0},
    {-4.0, 0.0, 0.0, 0.0},
    {3.0, 0.0, 0.0, 0.0},
    {-3.0, 0.0, 0.0, 0.0},
    {-3.0, 0.0, 0.0, 0.0},
    {-3.0, 0.0, 0.0, 0.0},
    {-3.0, 0.0, 0.0, 0.0},
    {-3.0, 0.0, 0.0, 0.0},
    {-3.0, 0.0, 0.0, 0.0},
    {-3.0, 0.0, 0.0, 0.0}};

    /* cache values */
    static double c_JD = 0.0, c_longitude = 0.0, c_obliquity = 0.0, c_ecliptic = 0.0;

    /* Calculate nutation of longitude and obliquity in degrees from Julian Ephemeris Day
    * params : JD Julian Day, nutation Pointer to store nutation.
    * Chapter 21 pg 131-134 Using Table 21A */
    void get_nutation (double JD, struct ln_nutation * nutation)
    {

    double D,M,MM,F,O,T,T2,T3;
    double coeff_sine, coeff_cos;
    int i;

    /* should we bother recalculating nutation */
    if (fabs(JD – c_JD) > LN_NUTATION_EPOCH_THRESHOLD)
    {
    /* set the new epoch */
    c_JD = JD;

    /* set ecliptic */
    c_ecliptic = 23.0 + 26.0 / 60.0 + 27.407 / 3600.0;

    /* calc T */
    T = (JD – 2451545.0)/36525;
    T2 = T * T;
    T3 = T2 * T;

    /* calculate D,M,M’,F and Omega */
    D = 297.85036 + 445267.111480 * T – 0.0019142 * T2 + T3 / 189474.0;
    M = 357.52772 + 35999.050340 * T – 0.0001603 * T2 – T3 / 300000.0;
    MM = 134.96298 + 477198.867398 * T + 0.0086972 * T2 + T3 / 56250.0;
    F = 93.2719100 + 483202.017538 * T – 0.0036825 * T2 + T3 / 327270.0;
    O = 125.04452 – 1934.136261 * T + 0.0020708 * T2 + T3 / 450000.0;

    /* convert to radians */
    D *= M_PI/180.;
    M *= M_PI/180.;
    MM *= M_PI/180.;
    F *= M_PI/180.;
    O *= M_PI/180.;

    /* calc sum of terms in table 21A */
    for (i=0; ilongitude = c_longitude;
    nutation->obliquity = c_obliquity;
    nutation->ecliptic = c_ecliptic;
    }

    /*
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Library General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place – Suite 330, Boston, MA 02111-1307, USA.

    Copyright (C) 2000 Liam Girdwood

    */

    #include “stellastro.h”
    #include “nutation.h”
    #include

    /* Calculate the mean sidereal time at the meridian of Greenwich of a given date.
    * returns apparent sidereal time (degree).
    * Formula 11.1, 11.4 pg 83 */
    double get_mean_sidereal_time (double JD)
    {
    double sidereal;
    double T;

    T = (JD – 2451545.0) / 36525.0;

    /* calc mean angle */
    sidereal = 280.46061837 + (360.98564736629 * (JD – 2451545.0)) + (0.000387933 * T * T) – (T * T * T / 38710000.0);

    /* add a convenient multiple of 360 degrees */
    sidereal = range_degrees (sidereal);

    return sidereal;
    }

    /* Calculate the apparent sidereal time at the meridian of Greenwich of a given date.
    * returns apparent sidereal time (degree).
    * Formula 11.1, 11.4 pg 83 */
    double get_apparent_sidereal_time (double JD)
    {
    double correction, sidereal;
    struct ln_nutation nutation;

    /* get the mean sidereal time */
    sidereal = get_mean_sidereal_time (JD);

    /* add corrections for nutation in longitude and for the true obliquity of
    the ecliptic */
    get_nutation (JD, &nutation);

    correction = (nutation.longitude * cos (nutation.obliquity*M_PI/180.));

    sidereal += correction;

    return (sidereal);
    }

  2. I cannot even tell you how happy this comment makes me. To have the answer, to have a friend who knows the answer offhand… that’s a truly rich life. Expect to see your name in the telescope software!

  3. Gosh, thanks! I was waiting for a moment I could help with the telescope project; wasn’t sure where it was going to happen. Oddly it hadn’t occured to me to mention that to you beforehand. O_o

  4. […] sent the second surprise.  It’s an equation for calculating Sidereal Time for […]

  5. […] See the top window? That’s one of my favorite downtown offices. […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: