Error out when we see absolute positioning in GDS

We don't support it (yet?)
This commit is contained in:
jan 2018-04-14 15:23:01 -07:00
parent c14daf2e5e
commit 358f45c5fd

View File

@ -258,24 +258,28 @@ def read(filename: str,
# Helper function to create a SubPattern from an SREF or AREF. Sets subpat.pattern to None # Helper function to create a SubPattern from an SREF or AREF. Sets subpat.pattern to None
# and sets the instance attribute .ref_name to the struct_name. # and sets the instance attribute .ref_name to the struct_name.
# #
# BUG: Figure out what "absolute" means in the context of elements and if the current
# behavior is correct
# BUG: Need to check STRANS bit 0 to handle x-reflection # BUG: Need to check STRANS bit 0 to handle x-reflection
# BUG: "Absolute" means not affected by parent elements.
# That's not currently supported by masque at all, so need to either tag it and
# undo the parent transformations, or implement it in masque.
subpat = SubPattern(pattern=None, offset=offset) subpat = SubPattern(pattern=None, offset=offset)
subpat.ref_name = element.struct_name subpat.ref_name = element.struct_name
if element.strans is not None: if element.strans is not None:
if element.mag is not None: if element.mag is not None:
subpat.scale = element.mag subpat.scale = element.mag
# Bit 13 means absolute scale # Bit 13 means absolute scale
if get_bit(element.strans, 13): if get_bit(element.strans, 15 - 13):
subpat.offset *= subpat.scale #subpat.offset *= subpat.scale
raise PatternError('Absolute scale is not implemented yet!')
if element.angle is not None: if element.angle is not None:
subpat.rotation = element.angle * numpy.pi / 180 subpat.rotation = element.angle * numpy.pi / 180
# Bit 14 means absolute rotation # Bit 14 means absolute rotation
if get_bit(element.strans, 14): if get_bit(element.strans, 15 - 14):
subpat.offset = numpy.dot(rotation_matrix_2d(subpat.rotation), subpat.offset) #subpat.offset = numpy.dot(rotation_matrix_2d(subpat.rotation), subpat.offset)
raise PatternError('Absolute rotation is not implemented yet!')
return subpat return subpat
patterns = [] patterns = []
for structure in lib: for structure in lib:
pat = Pattern(name=structure.name.decode('ASCII')) pat = Pattern(name=structure.name.decode('ASCII'))