Created
September 25, 2018 14:49
-
-
Save ijiraq/24af256570e961f26d90f6769429bc44 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
points = [] | |
vertices = [] | |
segment_type = SegmentType['MOVE'] | |
for x, y in ([0, 0], [1, 0], [1, 1], [0, 1 ]): | |
V = w.all_pix2world(x*header['naxis1'], y*header['naxis2'], 1, 1, 1) | |
points.append(Point(float(V[0]), float(V[1]))) | |
vertices.append(Vertex(float(V[0]), float(V[1]), segment_type)) | |
segment_type = SegmentType['LINE'] | |
vertices.append(Vertex(points[0].cval1, | |
points[0].cval2, | |
SegmentType['CLOSE'])) | |
polygon = shape.Polygon(points=points, samples=shape.MultiPolygon(vertices)) | |
position = Position(time_dependent=False, | |
bounds=polygon) | |
plane.position = position |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment