Mensanator wrote:
On Aug 22, 6:12 pm, "W. eWatson" <[EMAIL PROTECTED]> wrote:
The other night I surveyed a site for astronomical use by measuring the
altitude (0-90 degrees above the horizon) and az (azimuth, 0 degrees north
clockwise around the site to 360 degrees, almost north again) of obstacles,
trees. My purpose was to feed this profile of obstacles (trees) to an
astronomy program that would then account for not sighting objects below the
trees.

When I got around to entering them into the program by a file, I found it
required the alt at 360 azimuth points in order from 0 to 360 (same as 0).
Instead I have about 25 points, and expected the program to be able to do
simple linear interpolation between those.

Is there some simple operational device in Python that would allow me to
create an array (vector) of 360 points from my data by interpolating between
azimuth points when necessary? All my data I rounded to the nearest integer.
Maybe there's an interpolation operator?

As an example, supposed I had made 3 observations: (0,0) (180,45) and
(360,0). I would want some thing like (note the slope of the line from 0 to
179 is 45/180 or 0.25):
alt: 0, 0.25, 0.50, 0.75, ... 44.75, 45.0
az : 0, 1,    2,    3,              180

Of course, I don't need the az.

On Aug 22, 6:12 pm, "W. eWatson" <[EMAIL PROTECTED]> wrote:
The other night I surveyed a site for astronomical use by measuring the
altitude (0-90 degrees above the horizon) and az (azimuth, 0 degrees north
clockwise around the site to 360 degrees, almost north again) of obstacles,
trees. My purpose was to feed this profile of obstacles (trees) to an
astronomy program that would then account for not sighting objects below the
trees.

When I got around to entering them into the program by a file, I found it
required the alt at 360 azimuth points in order from 0 to 360 (same as 0).
Instead I have about 25 points, and expected the program to be able to do
simple linear interpolation between those.

Is there some simple operational device in Python that would allow me to
create an array (vector) of 360 points from my data by interpolating between
azimuth points when necessary? All my data I rounded to the nearest integer.
Maybe there's an interpolation operator?

As an example, supposed I had made 3 observations: (0,0) (180,45) and
(360,0). I would want some thing like (note the slope of the line from 0 to
179 is 45/180 or 0.25):
alt: 0, 0.25, 0.50, 0.75, ... 44.75, 45.0
az : 0, 1,    2,    3,              180

Of course, I don't need the az.

for az in xrange(181):
        print (az,az*0.25),

(0, 0.0) (1, 0.25) (2, 0.5) (3, 0.75)
(4, 1.0) (5, 1.25) (6, 1.5) (7, 1.75)
(8, 2.0) (9, 2.25) (10, 2.5) (11, 2.75)
(12, 3.0) (13, 3.25) (14, 3.5) (15, 3.75)
(16, 4.0) (17, 4.25) (18, 4.5) (19, 4.75)
(20, 5.0) (21, 5.25) (22, 5.5) (23, 5.75)
etc.
Yes, that works, but that was only a simple illustration. My data looks in fact looks like this (only a few values given:
Az   Alt
0    18
18   18
27   16
34   20
48   20
...
268  28
290  32
...
So the python software should generate
0  18
1  18
2  18
3  18
... the trees are all about 18 degrees high
18 18
19 17.9 we have a slight slope. I'm using values that might be close
20 27.75
21
...
27 16
28 16.4 now the trees are starting to get a little higher
29 16.9
...
359 18 (most likely. I didn't have the patience to make a measure at 359)

That should pretty well illustrate it. In actuality, as I swept around the circle, the tree line becomes much more abrupt than those first few data points. The tallest tree is at 36 degrees and is among some other equally tall trees.


But are you saying if you have two readings of tree tops

        *
        *
      x *
      x *
    * x *
    * x *
____*_x_*______


And you linearly interpret between them
exactly. I put a value there -- x

        /
       /*
      / *
     /  *
    /   *
   /*   *
    *   *
____*___*______

that the area below the dashed line is assumed to be hidden?
Yes, the telescope software will see that it cannot move the telescope into that area. Surprisingly, they use interpolation. For example, suppose the two trees in your illustration are at an az of 100 and 101, and the two altitudes are 3 and 7. Suppose the telescope wants to go below the line into 100.622 az and an alt of 2.42. The software will say no you don't.

That wouldn't necessarily be true, as the tree profile could
dip below the line.

        /
       /*
      / *
     / **
    /  ***
   /*  ****
    ** ****
___***_****____

Of course, if you take enough points, the open areas may be small
enough not to be practical to worry about.

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to