Skip to content

Commit

Permalink
Added documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
braden6521 committed Oct 8, 2024
1 parent 5dd6ff1 commit d2e7850
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 6 deletions.
3 changes: 1 addition & 2 deletions opencsp/app/sofast/lib/ProcessSofastFringe.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,7 @@ def get_optic(
Returns
-------
FacetEnsemble | Facet
Optic object
FacetEnsemble if ProcessSofastFringe.optic_type = 'multi', otherwise Facet
"""
facets = []
trans_list = []
Expand Down
50 changes: 46 additions & 4 deletions opencsp/common/lib/csp/FacetEnsemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,29 @@ def set_facet_transform_list(self, transformations: list[TransformXYZ]):
facet._self_to_parent_transform = transformation

def set_facet_positions(self, positions: Pxyz):
"""Sets the positions of the facets relative to the ensemble.
NOTE: Will remove previously set facet canting rotations
"""
Set the positions of the facets relative to one another.
This function updates the positions of the facets in the ensemble.
It will remove any previously set facet canting rotations.
Parameters
----------
positions : Pxyz
A sequence of positions to set for each facet. The length of
this sequence must match the number of facets in the ensemble.
Raises
------
ValueError
If the length of `positions` does not match the number of facets
in the ensemble.
Notes
-----
This method modifies the internal transformation of each facet
based on the provided positions.
"""
# "ChatGPT 4o-mini" assisted with generating this docstring.
if len(positions) != len(self.facets):
raise ValueError(
f"This FacetEnsemble contains {len(self.facets)} and"
Expand All @@ -205,9 +225,31 @@ def set_facet_positions(self, positions: Pxyz):
facet._self_to_parent_transform = TransformXYZ.from_V(pos)

def set_facet_canting(self, canting_rotations: list[Rotation]):
"""Sets facet canting relative to ensemble.
NOTE: Will remove previously set facet positionals
"""
Set the canting rotations of the facets relative to the ensemble.
This function updates the canting rotations of the facets in the
ensemble. It will remove any previously set facet positional
transformations.
Parameters
----------
canting_rotations : list[Rotation]
A list of rotation objects to set for each facet. The length
of this list must match the number of facets in the ensemble.
Raises
------
ValueError
If the length of `canting_rotations` does not match the number
of facets in the ensemble.
Notes
-----
This method modifies the internal transformation of each facet
based on the provided canting rotations and their corresponding
positions.
"""
# "ChatGPT 4o-mini" assisted with generating this docstring.
if len(canting_rotations) != len(self.facets):
raise ValueError(
f"This FacetEnsemble contains {len(self.facets)} and"
Expand Down

0 comments on commit d2e7850

Please sign in to comment.