Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Horizon features #85

Closed
wants to merge 14 commits into from
Closed

Conversation

brendan-o
Copy link

#Adding the Horizon class

requirements.txt Outdated
readline
gcloud
#readline
#gcloud
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually you should leave these in here and just fix locally.


def enter_coords():

import ast
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All import statements should be at the top of the file.

Copy link
Member

@wtgee wtgee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry this took forever for me to get to. We'll want to merge this after all the consolidation steps that are going on.

super().__init__(*args, **kwargs)
self.obstruction_points = []

print("Horizon.__init__")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to remove all print statements and use the self.logger.debug (or .info, .warning, etc) system.

image_filename (file): The horizon panorama image to be processed
"""

from skimage.io import imread
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import statements should always be at the top of the file

If valid sets up a value for obstruction_points, otherwise leaves it empty
"""

from pocs.tests.test_horizon_limits import obstruction_points_valid
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to top.

if not obstruction_points_valid(self.obstruction_points):
self.obstruction_points = []

def interpolate(self, A, B, az):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable names should be lowercase and a and b are a little ambiguous since this is a tuple of points. Let's name them point_a and point_b or something more descriptive.

prior_point = self.obstruction_points[0]
i = 1
found = False
while(i < len(self.obstruction_points) and found is False):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while loops are generally used when you have continuous looping until some breaking condition. Here you have a set number of points you want to loop over so might as well loop them directly, something like:

for i, point in enumerate(self.obstruction_points):
    if found:
        break
    ....

Then just use point instead of next_point assignment below.

el = self.determine_el(az)

# Determine if the target altitude is above or below the determined minimum elevation for that azimuth
if alt - 7.5 > el:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this magic number?

veto2, score2 = h.get_score(time, observer, observation2)

assert veto1 is False and veto2 is False
assert score2 > score1 #Are these scores still relevant? How can I test scores for my class as its either 100 or 0?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just test one observation at at time and see if score1 > 0 or something. Depends on what you are actually trying to test. Let me know if that doesn't seem to make sense.



# Unit tests for each of the evaluations
def test_validations():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused as to what is going on here. The validation_x subs should be given names that make sense. If validation_1 is testing that there is only one point it should be called test_single_point and a test_no_points_fail or something like that. Maybe we can sit down and go over a little bit of this in person.

np.set_printoptions(threshold=np.nan)
print(edges1.astype(np.float))

def get_config_coords(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is reading the config file but not necessarily "getting" them since it doesn't return anything. I would rename to lookup_config_coords or something.

@brendan-o
Copy link
Author

brendan-o commented Dec 7, 2017 via email

@wtgee
Copy link
Member

wtgee commented Dec 7, 2017

I am currently working on a summer vacation scholarship at CSIRO so I am
too busy right now to try fix these, hopefully I will be able to find some
time early next year for it!

No problem. We have a number of changes to get integrated that will take some time. We got through most of our prep work for the 1.0.0 stream of things os early next year might be a good time for it.

In the mean time we will try to test out what is there for Huntsman when we do the commissioning run. Enjoy the holidays!

@jamessynge
Copy link
Contributor

FYI, we should move forward with this. I need this for PAN006, which has a big obstruction in the north-west quadrant.

@wtgee
Copy link
Member

wtgee commented Jan 15, 2018

FYI, we should move forward with this. I need this for PAN006, which has a big obstruction in the north-west quadrant.

Brendan changed a few other things and then emailed the changes to me instead of submitting to PR. I'll try to get those integrated soon but it will need additional work to get it going.

@wtgee
Copy link
Member

wtgee commented Jan 16, 2018

Closing in favor of #368

@wtgee wtgee closed this Jan 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants