Exemple #1
0
def create_specsheets():
    specsheets = {}

    # setup finite conjugate defaults
    fev = dict2D(fld_ape_set, obj_img_set)
    fev['field']['object'] = dict([(fld_labels[0], None)])
    fev['aperture']['object'] = dict([(ap_labels[2], None),
                                      (ap_labels[1], None)])
    fev['field']['image'] = dict([(fld_labels[0], None)])
    fev['aperture']['image'] = dict([(ap_labels[2], None),
                                     (ap_labels[1], None)])
    fss = SpecSheet('finite', etendue_values=fev)
    specsheets['finite'] = fss

    # setup infinite conjugate defaults
    imager_inputs = {'s': -math.inf}
    imager = IdealImager(None, -math.inf, None, None, None)

    iev = dict2D(fld_ape_set, obj_img_set)
    iev['field']['object'] = dict([(fld_labels[1], None)])
    iev['aperture']['object'] = dict([(ap_labels[0], None)])
    iev['field']['image'] = dict([(fld_labels[0], None)])
    iev['aperture']['image'] = dict([(ap_labels[2], None),
                                     (ap_labels[1], None)])

    ifss = SpecSheet('infinite',
                     imager=imager,
                     imager_inputs=imager_inputs,
                     frozen_imager_inputs=[True, True, True, True, False],
                     etendue_values=iev)
    specsheets['infinite'] = ifss

    return specsheets
Exemple #2
0
    def __init__(self, parent, itype, specsheet, **kwargs):
        super().__init__(title='etendue definition', **kwargs)

        self.parent = parent
        self.specsheet = specsheet

        self.groupboxes = dict2D(fld_ape_set, obj_img_set)

        if itype is 'infinite':
            gb00 = SpaceGroupBox(parent=self, title='object space',
                                 obj_img='object', fld_ape='field',
                                 keys=(fld_labels[1],))
            self.groupboxes['field']['object'] = gb00
            gb10 = SpaceGroupBox(parent=self, title='',
                                 obj_img='object', fld_ape='aperture',
                                 keys=(ap_labels[0],))
            self.groupboxes['aperture']['object'] = gb10
            gb01 = SpaceGroupBox(parent=self, title='image space',
                                 obj_img='image', fld_ape='field',
                                 keys=(fld_labels[0],))
            self.groupboxes['field']['image'] = gb01
            gb11 = SpaceGroupBox(parent=self, title='',
                                 obj_img='image', fld_ape='aperture',
                                 keys=(ap_labels[2], ap_labels[1]))
            self.groupboxes['aperture']['image'] = gb11

        else:
            gb00 = SpaceGroupBox(parent=self, title='object space',
                                 fld_ape='field', obj_img='object',
                                 keys=(fld_labels[0],))
            self.groupboxes['field']['object'] = gb00
            gb10 = SpaceGroupBox(parent=self, title='',
                                 fld_ape='aperture', obj_img='object',
                                 keys=(ap_labels[2], ap_labels[1]))
            self.groupboxes['aperture']['object'] = gb10
            gb01 = SpaceGroupBox(parent=self, title='image space',
                                 fld_ape='field', obj_img='image',
                                 keys=(fld_labels[0],))
            self.groupboxes['field']['image'] = gb01
            gb11 = SpaceGroupBox(parent=self, title='',
                                 fld_ape='aperture', obj_img='image',
                                 keys=(ap_labels[2], ap_labels[1]))
            self.groupboxes['aperture']['image'] = gb11

        layout = QGridLayout()
        layout.addWidget(gb00, 0, 0)
        layout.addWidget(gb10, 1, 0)
        layout.addWidget(gb01, 0, 1)
        layout.addWidget(gb11, 1, 1)

        self.setLayout(layout)
Exemple #3
0
    def __init__(self,
                 conjugate_type,
                 imager=None,
                 imager_inputs=None,
                 frozen_imager_inputs=None,
                 etendue_inputs=None,
                 etendue_values=None):
        self.conjugate_type = conjugate_type

        if imager is None:
            imager = IdealImager(None, None, None, None, None)
        self.imager = imager

        self.imager_inputs = imager_inputs if imager_inputs else {}

        self.frozen_imager_inputs = (frozen_imager_inputs
                                     if frozen_imager_inputs else [False] * 5)

        self.etendue_inputs = (etendue_inputs if etendue_inputs else dict2D(
            fld_ape_set, obj_img_set))
        self.etendue_values = (etendue_values if etendue_values else dict2D(
            fld_ape_set, obj_img_set))

        self.partition_defined()
Exemple #4
0
def create_etendue_dict():
    """Returns an empty dict2D(fld_ape_set, obj_img_set)."""
    return dict2D(fld_ape_set, obj_img_set)