-
Notifications
You must be signed in to change notification settings - Fork 11
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
Standalone SpatialOrientation #44
Standalone SpatialOrientation #44
Conversation
1672d64
to
76ed5ec
Compare
f6cd54c
to
b27df4e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please respond to my comments before I approve. In particular, my comments about scrubbing, test_Display.test_save_load_hdf_dist_3d(), and CalibrateDisplayShape.as_DisplayShape()
@@ -0,0 +1,8 @@ | |||
View Camera Distortion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to learn what these .rst files do at some point.
return {'xy_screen_fraction': pts_xy_screen_fraction, 'xyz_screen_coords': pts_xyz_screen} | ||
|
||
def as_DisplayShape(self, name: str) -> DisplayShape: | ||
"""Saves data to DisplayShape hdf file using the distorted3d model, see |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't actually save the data, does it? It just returns a DisplayShape instance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, that was a copy/paste error.
|
||
from opencsp.common.lib.geometry.Vxy import Vxy | ||
from opencsp.common.lib.geometry.Vxyz import Vxyz | ||
import opencsp.common.lib.tool.hdf5_tools as hdf5_tools | ||
import opencsp.common.lib.tool.hdf5_tools as ht |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably converge on how we import this library. I've been using "import ... as h5", but I'm also good with "ht". I think that "h5" is more descriptive, but "ht" is more consistent with the rest of the code. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea on being consistent. Since you're already using h5, let's stick with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to ... as h5 in all (two) files.
@@ -11,7 +11,7 @@ | |||
from opencsp.app.sofast.lib.DefinitionFacet import DefinitionFacet | |||
from opencsp.app.sofast.lib.DisplayShape import DisplayShape as Display | |||
import opencsp.app.sofast.lib.image_processing as ip | |||
from opencsp.app.sofast.lib.MeasurementSofastFringe import MeasurementSofastFringe as Measurement | |||
from opencsp.app.sofast.lib.MeasurementSofastFringe import MeasurementSofastFringe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this change 👍
disp.save_to_hdf(file) | ||
|
||
# Load | ||
DisplayShape.load_from_hdf(file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest expanding this test method to compare the saved and loaded versions of the DisplayShape object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, updated!
# Load | ||
ori = SpatialOrientation.load_from_hdf(file) | ||
# Check optic is oriented | ||
np.testing.assert_equal(ori.optic_oriented, True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly! Like this! :)
Note that if you're comparing two standard python objects, you can also use self.assertEqual(a, b)
, which in my opinion produces easier-to-read results in the case that the two instance's aren't equal. In reality, it's just a matter of opinion which one you like more.
Example of np.testing.assert_equal
and unittest.TestCase.assertEqual
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that method a lot better. Updated!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did this file get run through the scrubber? I'm assuming it's safe, but we should make sure it passes the scrubber's checks, anyways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same with the rest of the HDF5 files...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was never able to get the scrubber working/do not know how to use it. Will work on this.
@bbean23, now the ubi8 CI doesn't work. It started failing on memory_monitor for some reason FYI. |
165fe76
to
7ccd13c
Compare
Fixed merge conflict with ProcessSofastFringe
Resolved merge conflict in test_integration_undefined
Fixed merge conflicts after rebase.
updated example file.
92840c7
to
f11738c
Compare
@bbean23, I believe this is finally ready after a rebase on top of develop! Nothing substantial has changed since your last review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved!
Split SpatialOrientation from DisplayShape