Example #1
0
 def __init__(self):
     super(Constraint_Image_Nonscience, self).__init__(
         [
             Constraint_TargetAcq(),
             DMSAttrConstraint(
                 name='non_science',
                 sources=['exp_type'],
                 value='|'.join(IMAGE2_NONSCIENCE_EXP_TYPES),
             ),
             Constraint(
                 [
                     DMSAttrConstraint(
                         name='exp_type',
                         sources=['exp_type'],
                         value='nrs_msaspec'
                     ),
                     DMSAttrConstraint(
                         sources=['msastate'],
                         value='primarypark_allopen'
                     ),
                     DMSAttrConstraint(
                         sources=['grating'],
                         value='mirror'
                     )
                 ]
             )
         ],
         reduce=Constraint.any
     )
Example #2
0
    def __init__(self, *args, **kwargs):

        # Setup target acquisition inclusion
        constraint_acqs = Constraint([
            Constraint_TargetAcq(),
            DMSAttrConstraint(
                name='acq_obsnum',
                sources=['obs_num'],
                value=lambda: '(' + '|'.join(self.constraints['obs_num'].
                                             found_values) + ')',
                force_unique=False,
            )
        ],
                                     name='acq_constraint',
                                     work_over=ProcessList.EXISTING)

        # Put all constraints together.
        self.constraints = Constraint([
            Constraint_Base(),
            DMSAttrConstraint(sources=['is_imprt'], force_undefined=True),
            Constraint([
                Constraint(
                    [self.constraints, Constraint_Obsnum()], name='rule'),
                constraint_acqs
            ],
                       name='acq_check',
                       reduce=Constraint.any),
        ],
                                      name='dmsbase_top')

        super(AsnMixin_Science, self).__init__(*args, **kwargs)
Example #3
0
    def __init__(self, *args, **kwargs):

        # Setup for checking.
        self.constraints = Constraint([
            Constraint_TargetAcq(),
            SimpleConstraint(name='force_fail',
                             test=lambda x, y: False,
                             value='anything but None',
                             reprocess_on_fail=True,
                             work_over=ProcessList.NONSCIENCE,
                             reprocess_rules=[])
        ])

        super(Asn_Lv3ACQ_Reprocess, self).__init__(*args, **kwargs)