How to use gds_validate_float method in autotest

Best Python code snippet using autotest_python

maja_xml_aot_params.py

Source:maja_xml_aot_params.py Github

copy

Full Screen

...130 raise_parse_error(node, 'Requires sequence of integers')131 return values132 def gds_format_float(self, input_data, input_name=''):133 return ('%.15f' % input_data).rstrip('0')134 def gds_validate_float(self, input_data, node=None, input_name=''):135 return input_data136 def gds_format_float_list(self, input_data, input_name=''):137 return '%s' % ' '.join(input_data)138 def gds_validate_float_list(139 self, input_data, node=None, input_name=''):140 values = input_data.split()141 for value in values:142 try:143 float(value)144 except (TypeError, ValueError):145 raise_parse_error(node, 'Requires sequence of floats')146 return values147 def gds_format_double(self, input_data, input_name=''):148 return '%e' % input_data149 def gds_validate_double(self, input_data, node=None, input_name=''):150 return input_data151 def gds_format_double_list(self, input_data, input_name=''):152 return '%s' % ' '.join(input_data)153 def gds_validate_double_list(154 self, input_data, node=None, input_name=''):155 values = input_data.split()156 for value in values:157 try:158 float(value)159 except (TypeError, ValueError):160 raise_parse_error(node, 'Requires sequence of doubles')161 return values162 def gds_format_boolean(self, input_data, input_name=''):163 return ('%s' % input_data).lower()164 def gds_validate_boolean(self, input_data, node=None, input_name=''):165 return input_data166 def gds_format_boolean_list(self, input_data, input_name=''):167 return '%s' % ' '.join(input_data)168 def gds_validate_boolean_list(169 self, input_data, node=None, input_name=''):170 values = input_data.split()171 for value in values:172 if value not in ('true', '1', 'false', '0', ):173 raise_parse_error(174 node,175 'Requires sequence of booleans '176 '("true", "1", "false", "0")')177 return values178 def gds_validate_datetime(self, input_data, node=None, input_name=''):179 return input_data180 def gds_format_datetime(self, input_data, input_name=''):181 if input_data.microsecond == 0:182 _svalue = '%04d-%02d-%02dT%02d:%02d:%02d' % (183 input_data.year,184 input_data.month,185 input_data.day,186 input_data.hour,187 input_data.minute,188 input_data.second,189 )190 else:191 _svalue = '%04d-%02d-%02dT%02d:%02d:%02d.%s' % (192 input_data.year,193 input_data.month,194 input_data.day,195 input_data.hour,196 input_data.minute,197 input_data.second,198 ('%f' % (float(input_data.microsecond) / 1000000))[2:],199 )200 if input_data.tzinfo is not None:201 tzoff = input_data.tzinfo.utcoffset(input_data)202 if tzoff is not None:203 total_seconds = tzoff.seconds + (86400 * tzoff.days)204 if total_seconds == 0:205 _svalue += 'Z'206 else:207 if total_seconds < 0:208 _svalue += '-'209 total_seconds *= -1210 else:211 _svalue += '+'212 hours = total_seconds // 3600213 minutes = (total_seconds - (hours * 3600)) // 60214 _svalue += '{0:02d}:{1:02d}'.format(hours, minutes)215 return _svalue216 @classmethod217 def gds_parse_datetime(cls, input_data):218 tz = None219 if input_data[-1] == 'Z':220 tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')221 input_data = input_data[:-1]222 else:223 results = GeneratedsSuper.tzoff_pattern.search(input_data)224 if results is not None:225 tzoff_parts = results.group(2).split(':')226 tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])227 if results.group(1) == '-':228 tzoff *= -1229 tz = GeneratedsSuper._FixedOffsetTZ(230 tzoff, results.group(0))231 input_data = input_data[:-6]232 time_parts = input_data.split('.')233 if len(time_parts) > 1:234 micro_seconds = int(float('0.' + time_parts[1]) * 1000000)235 input_data = '%s.%s' % (time_parts[0], micro_seconds, )236 dt = datetime_.datetime.strptime(237 input_data, '%Y-%m-%dT%H:%M:%S.%f')238 else:239 dt = datetime_.datetime.strptime(240 input_data, '%Y-%m-%dT%H:%M:%S')241 dt = dt.replace(tzinfo=tz)242 return dt243 def gds_validate_date(self, input_data, node=None, input_name=''):244 return input_data245 def gds_format_date(self, input_data, input_name=''):246 _svalue = '%04d-%02d-%02d' % (247 input_data.year,248 input_data.month,249 input_data.day,250 )251 try:252 if input_data.tzinfo is not None:253 tzoff = input_data.tzinfo.utcoffset(input_data)254 if tzoff is not None:255 total_seconds = tzoff.seconds + (86400 * tzoff.days)256 if total_seconds == 0:257 _svalue += 'Z'258 else:259 if total_seconds < 0:260 _svalue += '-'261 total_seconds *= -1262 else:263 _svalue += '+'264 hours = total_seconds // 3600265 minutes = (total_seconds - (hours * 3600)) // 60266 _svalue += '{0:02d}:{1:02d}'.format(267 hours, minutes)268 except AttributeError:269 pass270 return _svalue271 @classmethod272 def gds_parse_date(cls, input_data):273 tz = None274 if input_data[-1] == 'Z':275 tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')276 input_data = input_data[:-1]277 else:278 results = GeneratedsSuper.tzoff_pattern.search(input_data)279 if results is not None:280 tzoff_parts = results.group(2).split(':')281 tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])282 if results.group(1) == '-':283 tzoff *= -1284 tz = GeneratedsSuper._FixedOffsetTZ(285 tzoff, results.group(0))286 input_data = input_data[:-6]287 dt = datetime_.datetime.strptime(input_data, '%Y-%m-%d')288 dt = dt.replace(tzinfo=tz)289 return dt.date()290 def gds_validate_time(self, input_data, node=None, input_name=''):291 return input_data292 def gds_format_time(self, input_data, input_name=''):293 if input_data.microsecond == 0:294 _svalue = '%02d:%02d:%02d' % (295 input_data.hour,296 input_data.minute,297 input_data.second,298 )299 else:300 _svalue = '%02d:%02d:%02d.%s' % (301 input_data.hour,302 input_data.minute,303 input_data.second,304 ('%f' % (float(input_data.microsecond) / 1000000))[2:],305 )306 if input_data.tzinfo is not None:307 tzoff = input_data.tzinfo.utcoffset(input_data)308 if tzoff is not None:309 total_seconds = tzoff.seconds + (86400 * tzoff.days)310 if total_seconds == 0:311 _svalue += 'Z'312 else:313 if total_seconds < 0:314 _svalue += '-'315 total_seconds *= -1316 else:317 _svalue += '+'318 hours = total_seconds // 3600319 minutes = (total_seconds - (hours * 3600)) // 60320 _svalue += '{0:02d}:{1:02d}'.format(hours, minutes)321 return _svalue322 def gds_validate_simple_patterns(self, patterns, target):323 # pat is a list of lists of strings/patterns. We should:324 # - AND the outer elements325 # - OR the inner elements326 found1 = True327 for patterns1 in patterns:328 found2 = False329 for patterns2 in patterns1:330 if re_.search(patterns2, target) is not None:331 found2 = True332 break333 if not found2:334 found1 = False335 break336 return found1337 @classmethod338 def gds_parse_time(cls, input_data):339 tz = None340 if input_data[-1] == 'Z':341 tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')342 input_data = input_data[:-1]343 else:344 results = GeneratedsSuper.tzoff_pattern.search(input_data)345 if results is not None:346 tzoff_parts = results.group(2).split(':')347 tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])348 if results.group(1) == '-':349 tzoff *= -1350 tz = GeneratedsSuper._FixedOffsetTZ(351 tzoff, results.group(0))352 input_data = input_data[:-6]353 if len(input_data.split('.')) > 1:354 dt = datetime_.datetime.strptime(input_data, '%H:%M:%S.%f')355 else:356 dt = datetime_.datetime.strptime(input_data, '%H:%M:%S')357 dt = dt.replace(tzinfo=tz)358 return dt.time()359 def gds_str_lower(self, instring):360 return instring.lower()361 def get_path_(self, node):362 path_list = []363 self.get_path_list_(node, path_list)364 path_list.reverse()365 path = '/'.join(path_list)366 return path367 Tag_strip_pattern_ = re_.compile(r'\{.*\}')368 def get_path_list_(self, node, path_list):369 if node is None:370 return371 tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag)372 if tag:373 path_list.append(tag)374 self.get_path_list_(node.getparent(), path_list)375 def get_class_obj_(self, node, default_class=None):376 class_obj1 = default_class377 if 'xsi' in node.nsmap:378 classname = node.get('{%s}type' % node.nsmap['xsi'])379 if classname is not None:380 names = classname.split(':')381 if len(names) == 2:382 classname = names[1]383 class_obj2 = globals().get(classname)384 if class_obj2 is not None:385 class_obj1 = class_obj2386 return class_obj1387 def gds_build_any(self, node, type_name=None):388 return None389 @classmethod390 def gds_reverse_node_mapping(cls, mapping):391 return dict(((v, k) for k, v in mapping.iteritems()))392 @staticmethod393 def gds_encode(instring):394 if sys.version_info.major == 2:395 return instring.encode(ExternalEncoding)396 else:397 return instring398 @staticmethod399 def convert_unicode(instring):400 if isinstance(instring, str):401 result = quote_xml(instring)402 elif sys.version_info.major == 2 and isinstance(instring, unicode):403 result = quote_xml(instring).encode('utf8')404 else:405 result = GeneratedsSuper.gds_encode(str(instring))406 return result407 def __eq__(self, other):408 if type(self) != type(other):409 return False410 return self.__dict__ == other.__dict__411 def __ne__(self, other):412 return not self.__eq__(other)413 414 def getSubclassFromModule_(module, class_):415 '''Get the subclass of a class from a specific module.'''416 name = class_.__name__ + 'Sub'417 if hasattr(module, name):418 return getattr(module, name)419 else:420 return None421#422# If you have installed IPython you can uncomment and use the following.423# IPython is available from http://ipython.scipy.org/.424#425## from IPython.Shell import IPShellEmbed426## args = ''427## ipshell = IPShellEmbed(args,428## banner = 'Dropping into IPython',429## exit_msg = 'Leaving Interpreter, back to program.')430# Then use the following line where and when you want to drop into the431# IPython shell:432# ipshell('<some message> -- Entering ipshell.\nHit Ctrl-D to exit')433#434# Globals435#436ExternalEncoding = 'ascii'437Tag_pattern_ = re_.compile(r'({.*})?(.*)')438String_cleanup_pat_ = re_.compile(r"[\n\r\s]+")439Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)')440CDATA_pattern_ = re_.compile(r"<!\[CDATA\[.*?\]\]>", re_.DOTALL)441# Change this to redirect the generated superclass module to use a442# specific subclass module.443CurrentSubclassModule_ = None444#445# Support/utility functions.446#447def showIndent(outfile, level, pretty_print=True):448 if pretty_print:449 for idx in range(level):450 outfile.write(' ')451def quote_xml(inStr):452 "Escape markup chars, but do not modify CDATA sections."453 if not inStr:454 return ''455 s1 = (isinstance(inStr, BaseStrType_) and inStr or '%s' % inStr)456 s2 = ''457 pos = 0458 matchobjects = CDATA_pattern_.finditer(s1)459 for mo in matchobjects:460 s3 = s1[pos:mo.start()]461 s2 += quote_xml_aux(s3)462 s2 += s1[mo.start():mo.end()]463 pos = mo.end()464 s3 = s1[pos:]465 s2 += quote_xml_aux(s3)466 return s2467def quote_xml_aux(inStr):468 s1 = inStr.replace('&', '&amp;')469 s1 = s1.replace('<', '&lt;')470 s1 = s1.replace('>', '&gt;')471 return s1472def quote_attrib(inStr):473 s1 = (isinstance(inStr, BaseStrType_) and inStr or '%s' % inStr)474 s1 = s1.replace('&', '&amp;')475 s1 = s1.replace('<', '&lt;')476 s1 = s1.replace('>', '&gt;')477 if '"' in s1:478 if "'" in s1:479 s1 = '"%s"' % s1.replace('"', "&quot;")480 else:481 s1 = "'%s'" % s1482 else:483 s1 = '"%s"' % s1484 return s1485def quote_python(inStr):486 s1 = inStr487 if s1.find("'") == -1:488 if s1.find('\n') == -1:489 return "'%s'" % s1490 else:491 return "'''%s'''" % s1492 else:493 if s1.find('"') != -1:494 s1 = s1.replace('"', '\\"')495 if s1.find('\n') == -1:496 return '"%s"' % s1497 else:498 return '"""%s"""' % s1499def get_all_text_(node):500 if node.text is not None:501 text = node.text502 else:503 text = ''504 for child in node:505 if child.tail is not None:506 text += child.tail507 return text508def find_attr_value_(attr_name, node):509 attrs = node.attrib510 attr_parts = attr_name.split(':')511 value = None512 if len(attr_parts) == 1:513 value = attrs.get(attr_name)514 elif len(attr_parts) == 2:515 prefix, name = attr_parts516 namespace = node.nsmap.get(prefix)517 if namespace is not None:518 value = attrs.get('{%s}%s' % (namespace, name, ))519 return value520class GDSParseError(Exception):521 pass522def raise_parse_error(node, msg):523 msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, )524 raise GDSParseError(msg)525class MixedContainer:526 # Constants for category:527 CategoryNone = 0528 CategoryText = 1529 CategorySimple = 2530 CategoryComplex = 3531 # Constants for content_type:532 TypeNone = 0533 TypeText = 1534 TypeString = 2535 TypeInteger = 3536 TypeFloat = 4537 TypeDecimal = 5538 TypeDouble = 6539 TypeBoolean = 7540 TypeBase64 = 8541 def __init__(self, category, content_type, name, value):542 self.category = category543 self.content_type = content_type544 self.name = name545 self.value = value546 def getCategory(self):547 return self.category548 def getContenttype(self, content_type):549 return self.content_type550 def getValue(self):551 return self.value552 def getName(self):553 return self.name554 def export(self, outfile, level, name, namespace,555 pretty_print=True):556 if self.category == MixedContainer.CategoryText:557 # Prevent exporting empty content as empty lines.558 if self.value.strip():559 outfile.write(self.value)560 elif self.category == MixedContainer.CategorySimple:561 self.exportSimple(outfile, level, name)562 else: # category == MixedContainer.CategoryComplex563 self.value.export(564 outfile, level, namespace, name,565 pretty_print=pretty_print)566 def exportSimple(self, outfile, level, name):567 if self.content_type == MixedContainer.TypeString:568 outfile.write('<%s>%s</%s>' % (569 self.name, self.value, self.name))570 elif self.content_type == MixedContainer.TypeInteger or \571 self.content_type == MixedContainer.TypeBoolean:572 outfile.write('<%s>%d</%s>' % (573 self.name, self.value, self.name))574 elif self.content_type == MixedContainer.TypeFloat or \575 self.content_type == MixedContainer.TypeDecimal:576 outfile.write('<%s>%f</%s>' % (577 self.name, self.value, self.name))578 elif self.content_type == MixedContainer.TypeDouble:579 outfile.write('<%s>%g</%s>' % (580 self.name, self.value, self.name))581 elif self.content_type == MixedContainer.TypeBase64:582 outfile.write('<%s>%s</%s>' % (583 self.name,584 base64.b64encode(self.value),585 self.name))586 def to_etree(self, element):587 if self.category == MixedContainer.CategoryText:588 # Prevent exporting empty content as empty lines.589 if self.value.strip():590 if len(element) > 0:591 if element[-1].tail is None:592 element[-1].tail = self.value593 else:594 element[-1].tail += self.value595 else:596 if element.text is None:597 element.text = self.value598 else:599 element.text += self.value600 elif self.category == MixedContainer.CategorySimple:601 subelement = etree_.SubElement(602 element, '%s' % self.name)603 subelement.text = self.to_etree_simple()604 else: # category == MixedContainer.CategoryComplex605 self.value.to_etree(element)606 def to_etree_simple(self):607 if self.content_type == MixedContainer.TypeString:608 text = self.value609 elif (self.content_type == MixedContainer.TypeInteger or610 self.content_type == MixedContainer.TypeBoolean):611 text = '%d' % self.value612 elif (self.content_type == MixedContainer.TypeFloat or613 self.content_type == MixedContainer.TypeDecimal):614 text = '%f' % self.value615 elif self.content_type == MixedContainer.TypeDouble:616 text = '%g' % self.value617 elif self.content_type == MixedContainer.TypeBase64:618 text = '%s' % base64.b64encode(self.value)619 return text620 def exportLiteral(self, outfile, level, name):621 if self.category == MixedContainer.CategoryText:622 showIndent(outfile, level)623 outfile.write(624 'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (625 self.category, self.content_type,626 self.name, self.value))627 elif self.category == MixedContainer.CategorySimple:628 showIndent(outfile, level)629 outfile.write(630 'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (631 self.category, self.content_type,632 self.name, self.value))633 else: # category == MixedContainer.CategoryComplex634 showIndent(outfile, level)635 outfile.write(636 'model_.MixedContainer(%d, %d, "%s",\n' % (637 self.category, self.content_type, self.name,))638 self.value.exportLiteral(outfile, level + 1)639 showIndent(outfile, level)640 outfile.write(')\n')641class MemberSpec_(object):642 def __init__(self, name='', data_type='', container=0,643 optional=0, child_attrs=None, choice=None):644 self.name = name645 self.data_type = data_type646 self.container = container647 self.child_attrs = child_attrs648 self.choice = choice649 self.optional = optional650 def set_name(self, name): self.name = name651 def get_name(self): return self.name652 def set_data_type(self, data_type): self.data_type = data_type653 def get_data_type_chain(self): return self.data_type654 def get_data_type(self):655 if isinstance(self.data_type, list):656 if len(self.data_type) > 0:657 return self.data_type[-1]658 else:659 return 'xs:string'660 else:661 return self.data_type662 def set_container(self, container): self.container = container663 def get_container(self): return self.container664 def set_child_attrs(self, child_attrs): self.child_attrs = child_attrs665 def get_child_attrs(self): return self.child_attrs666 def set_choice(self, choice): self.choice = choice667 def get_choice(self): return self.choice668 def set_optional(self, optional): self.optional = optional669 def get_optional(self): return self.optional670def _cast(typ, value):671 if typ is None or value is None:672 return value673 return typ(value)674#675# Data representation classes.676#677class AOT_Estimation(GeneratedsSuper):678 subclass = None679 superclass = None680 def __init__(self, AOT_Method=None, AOT_KPondCAMS=None, AOT_HeightScale=None, Multi_Spectral_Method=None, Multi_Temporal_Method=None, Spectro_Temporal_Method=None, AOT_Max_Age=None, Default_AOT=None, Step_AOT=None, Sampling_Interval_Min=None, Sampling_Interval_Max=None, N_Pix_Min=None, Increment_N_Distance=None, Dark_Band_Code=None, SE_Valid_AOT_Radius=None, SE_Mask_Dilatation_Radius=None, Half_Window_Size=None, W_dark=None, W_bounds=None, AOT_min=None, F_Tolerance=None, G_Tolerance=None, X_Tolerance=None, Epsilon_Function=None, Max_Iterations=None, AOT_initial_D=None, Init_Window_Radius=None, Max_Window_Radius=None, Sigma_Smoothing_AOT=None):681 self.original_tagname_ = None682 self.AOT_Method = AOT_Method683 self.AOT_KPondCAMS = AOT_KPondCAMS684 self.AOT_HeightScale = AOT_HeightScale685 self.Multi_Spectral_Method = Multi_Spectral_Method686 self.Multi_Temporal_Method = Multi_Temporal_Method687 self.Spectro_Temporal_Method = Spectro_Temporal_Method688 self.AOT_Max_Age = AOT_Max_Age689 self.Default_AOT = Default_AOT690 self.Step_AOT = Step_AOT691 self.Sampling_Interval_Min = Sampling_Interval_Min692 self.Sampling_Interval_Max = Sampling_Interval_Max693 self.N_Pix_Min = N_Pix_Min694 self.Increment_N_Distance = Increment_N_Distance695 self.Dark_Band_Code = Dark_Band_Code696 self.SE_Valid_AOT_Radius = SE_Valid_AOT_Radius697 self.SE_Mask_Dilatation_Radius = SE_Mask_Dilatation_Radius698 self.Half_Window_Size = Half_Window_Size699 self.W_dark = W_dark700 self.W_bounds = W_bounds701 self.AOT_min = AOT_min702 self.F_Tolerance = F_Tolerance703 self.G_Tolerance = G_Tolerance704 self.X_Tolerance = X_Tolerance705 self.Epsilon_Function = Epsilon_Function706 self.Max_Iterations = Max_Iterations707 self.AOT_initial_D = AOT_initial_D708 self.Init_Window_Radius = Init_Window_Radius709 self.Max_Window_Radius = Max_Window_Radius710 self.Sigma_Smoothing_AOT = Sigma_Smoothing_AOT711 def factory(*args_, **kwargs_):712 if CurrentSubclassModule_ is not None:713 subclass = getSubclassFromModule_(714 CurrentSubclassModule_, AOT_Estimation)715 if subclass is not None:716 return subclass(*args_, **kwargs_)717 if AOT_Estimation.subclass:718 return AOT_Estimation.subclass(*args_, **kwargs_)719 else:720 return AOT_Estimation(*args_, **kwargs_)721 factory = staticmethod(factory)722 def get_AOT_Method(self): return self.AOT_Method723 def set_AOT_Method(self, AOT_Method): self.AOT_Method = AOT_Method724 def get_AOT_KPondCAMS(self): return self.AOT_KPondCAMS725 def set_AOT_KPondCAMS(self, AOT_KPondCAMS): self.AOT_KPondCAMS = AOT_KPondCAMS726 def get_AOT_HeightScale(self): return self.AOT_HeightScale727 def set_AOT_HeightScale(self, AOT_HeightScale): self.AOT_HeightScale = AOT_HeightScale728 def get_Multi_Spectral_Method(self): return self.Multi_Spectral_Method729 def set_Multi_Spectral_Method(self, Multi_Spectral_Method): self.Multi_Spectral_Method = Multi_Spectral_Method730 def get_Multi_Temporal_Method(self): return self.Multi_Temporal_Method731 def set_Multi_Temporal_Method(self, Multi_Temporal_Method): self.Multi_Temporal_Method = Multi_Temporal_Method732 def get_Spectro_Temporal_Method(self): return self.Spectro_Temporal_Method733 def set_Spectro_Temporal_Method(self, Spectro_Temporal_Method): self.Spectro_Temporal_Method = Spectro_Temporal_Method734 def get_AOT_Max_Age(self): return self.AOT_Max_Age735 def set_AOT_Max_Age(self, AOT_Max_Age): self.AOT_Max_Age = AOT_Max_Age736 def get_Default_AOT(self): return self.Default_AOT737 def set_Default_AOT(self, Default_AOT): self.Default_AOT = Default_AOT738 def get_Step_AOT(self): return self.Step_AOT739 def set_Step_AOT(self, Step_AOT): self.Step_AOT = Step_AOT740 def get_Sampling_Interval_Min(self): return self.Sampling_Interval_Min741 def set_Sampling_Interval_Min(self, Sampling_Interval_Min): self.Sampling_Interval_Min = Sampling_Interval_Min742 def get_Sampling_Interval_Max(self): return self.Sampling_Interval_Max743 def set_Sampling_Interval_Max(self, Sampling_Interval_Max): self.Sampling_Interval_Max = Sampling_Interval_Max744 def get_N_Pix_Min(self): return self.N_Pix_Min745 def set_N_Pix_Min(self, N_Pix_Min): self.N_Pix_Min = N_Pix_Min746 def get_Increment_N_Distance(self): return self.Increment_N_Distance747 def set_Increment_N_Distance(self, Increment_N_Distance): self.Increment_N_Distance = Increment_N_Distance748 def get_Dark_Band_Code(self): return self.Dark_Band_Code749 def set_Dark_Band_Code(self, Dark_Band_Code): self.Dark_Band_Code = Dark_Band_Code750 def get_SE_Valid_AOT_Radius(self): return self.SE_Valid_AOT_Radius751 def set_SE_Valid_AOT_Radius(self, SE_Valid_AOT_Radius): self.SE_Valid_AOT_Radius = SE_Valid_AOT_Radius752 def get_SE_Mask_Dilatation_Radius(self): return self.SE_Mask_Dilatation_Radius753 def set_SE_Mask_Dilatation_Radius(self, SE_Mask_Dilatation_Radius): self.SE_Mask_Dilatation_Radius = SE_Mask_Dilatation_Radius754 def get_Half_Window_Size(self): return self.Half_Window_Size755 def set_Half_Window_Size(self, Half_Window_Size): self.Half_Window_Size = Half_Window_Size756 def get_W_dark(self): return self.W_dark757 def set_W_dark(self, W_dark): self.W_dark = W_dark758 def get_W_bounds(self): return self.W_bounds759 def set_W_bounds(self, W_bounds): self.W_bounds = W_bounds760 def get_AOT_min(self): return self.AOT_min761 def set_AOT_min(self, AOT_min): self.AOT_min = AOT_min762 def get_F_Tolerance(self): return self.F_Tolerance763 def set_F_Tolerance(self, F_Tolerance): self.F_Tolerance = F_Tolerance764 def get_G_Tolerance(self): return self.G_Tolerance765 def set_G_Tolerance(self, G_Tolerance): self.G_Tolerance = G_Tolerance766 def get_X_Tolerance(self): return self.X_Tolerance767 def set_X_Tolerance(self, X_Tolerance): self.X_Tolerance = X_Tolerance768 def get_Epsilon_Function(self): return self.Epsilon_Function769 def set_Epsilon_Function(self, Epsilon_Function): self.Epsilon_Function = Epsilon_Function770 def get_Max_Iterations(self): return self.Max_Iterations771 def set_Max_Iterations(self, Max_Iterations): self.Max_Iterations = Max_Iterations772 def get_AOT_initial_D(self): return self.AOT_initial_D773 def set_AOT_initial_D(self, AOT_initial_D): self.AOT_initial_D = AOT_initial_D774 def get_Init_Window_Radius(self): return self.Init_Window_Radius775 def set_Init_Window_Radius(self, Init_Window_Radius): self.Init_Window_Radius = Init_Window_Radius776 def get_Max_Window_Radius(self): return self.Max_Window_Radius777 def set_Max_Window_Radius(self, Max_Window_Radius): self.Max_Window_Radius = Max_Window_Radius778 def get_Sigma_Smoothing_AOT(self): return self.Sigma_Smoothing_AOT779 def set_Sigma_Smoothing_AOT(self, Sigma_Smoothing_AOT): self.Sigma_Smoothing_AOT = Sigma_Smoothing_AOT780 def hasContent_(self):781 if (782 self.AOT_Method is not None or783 self.AOT_KPondCAMS is not None or784 self.AOT_HeightScale is not None or785 self.Multi_Spectral_Method is not None or786 self.Multi_Temporal_Method is not None or787 self.Spectro_Temporal_Method is not None or788 self.AOT_Max_Age is not None or789 self.Default_AOT is not None or790 self.Step_AOT is not None or791 self.Sampling_Interval_Min is not None or792 self.Sampling_Interval_Max is not None or793 self.N_Pix_Min is not None or794 self.Increment_N_Distance is not None or795 self.Dark_Band_Code is not None or796 self.SE_Valid_AOT_Radius is not None or797 self.SE_Mask_Dilatation_Radius is not None or798 self.Half_Window_Size is not None or799 self.W_dark is not None or800 self.W_bounds is not None or801 self.AOT_min is not None or802 self.F_Tolerance is not None or803 self.G_Tolerance is not None or804 self.X_Tolerance is not None or805 self.Epsilon_Function is not None or806 self.Max_Iterations is not None or807 self.AOT_initial_D is not None or808 self.Init_Window_Radius is not None or809 self.Max_Window_Radius is not None or810 self.Sigma_Smoothing_AOT is not None811 ):812 return True813 else:814 return False815 def export(self, outfile, level, namespace_='', name_='AOT_Estimation', namespacedef_='', pretty_print=True):816 imported_ns_def_ = GenerateDSNamespaceDefs_.get('AOT_Estimation')817 if imported_ns_def_ is not None:818 namespacedef_ = imported_ns_def_819 if pretty_print:820 eol_ = '\n'821 else:822 eol_ = ''823 if self.original_tagname_ is not None:824 name_ = self.original_tagname_825 showIndent(outfile, level, pretty_print)826 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))827 already_processed = set()828 self.exportAttributes(outfile, level, already_processed, namespace_, name_='AOT_Estimation')829 if self.hasContent_():830 outfile.write('>%s' % (eol_, ))831 self.exportChildren(outfile, level + 1, namespace_='', name_='AOT_Estimation', pretty_print=pretty_print)832 showIndent(outfile, level, pretty_print)833 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))834 else:835 outfile.write('/>%s' % (eol_, ))836 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='AOT_Estimation'):837 pass838 def exportChildren(self, outfile, level, namespace_='', name_='AOT_Estimation', fromsubclass_=False, pretty_print=True):839 if pretty_print:840 eol_ = '\n'841 else:842 eol_ = ''843 if self.AOT_Method is not None:844 showIndent(outfile, level, pretty_print)845 outfile.write('<AOT_Method>%s</AOT_Method>%s' % (self.gds_encode(self.gds_format_string(quote_xml(self.AOT_Method), input_name='AOT_Method')), eol_))846 if self.AOT_KPondCAMS is not None:847 showIndent(outfile, level, pretty_print)848 outfile.write('<AOT_KPondCAMS>%s</AOT_KPondCAMS>%s' % (self.gds_format_double(self.AOT_KPondCAMS, input_name='AOT_KPondCAMS'), eol_))849 if self.AOT_HeightScale is not None:850 showIndent(outfile, level, pretty_print)851 outfile.write('<AOT_HeightScale>%s</AOT_HeightScale>%s' % (self.gds_format_double(self.AOT_HeightScale, input_name='AOT_HeightScale'), eol_))852 if self.Multi_Spectral_Method is not None:853 self.Multi_Spectral_Method.export(outfile, level, namespace_, name_='Multi_Spectral_Method', pretty_print=pretty_print)854 if self.Multi_Temporal_Method is not None:855 self.Multi_Temporal_Method.export(outfile, level, namespace_, name_='Multi_Temporal_Method', pretty_print=pretty_print)856 if self.Spectro_Temporal_Method is not None:857 self.Spectro_Temporal_Method.export(outfile, level, namespace_, name_='Spectro_Temporal_Method', pretty_print=pretty_print)858 if self.AOT_Max_Age is not None:859 showIndent(outfile, level, pretty_print)860 outfile.write('<AOT_Max_Age>%s</AOT_Max_Age>%s' % (self.gds_format_integer(self.AOT_Max_Age, input_name='AOT_Max_Age'), eol_))861 if self.Default_AOT is not None:862 showIndent(outfile, level, pretty_print)863 outfile.write('<Default_AOT>%s</Default_AOT>%s' % (self.gds_format_double(self.Default_AOT, input_name='Default_AOT'), eol_))864 if self.Step_AOT is not None:865 showIndent(outfile, level, pretty_print)866 outfile.write('<Step_AOT>%s</Step_AOT>%s' % (self.gds_format_integer(self.Step_AOT, input_name='Step_AOT'), eol_))867 if self.Sampling_Interval_Min is not None:868 showIndent(outfile, level, pretty_print)869 outfile.write('<Sampling_Interval_Min>%s</Sampling_Interval_Min>%s' % (self.gds_format_integer(self.Sampling_Interval_Min, input_name='Sampling_Interval_Min'), eol_))870 if self.Sampling_Interval_Max is not None:871 showIndent(outfile, level, pretty_print)872 outfile.write('<Sampling_Interval_Max>%s</Sampling_Interval_Max>%s' % (self.gds_format_integer(self.Sampling_Interval_Max, input_name='Sampling_Interval_Max'), eol_))873 if self.N_Pix_Min is not None:874 showIndent(outfile, level, pretty_print)875 outfile.write('<N_Pix_Min>%s</N_Pix_Min>%s' % (self.gds_format_integer(self.N_Pix_Min, input_name='N_Pix_Min'), eol_))876 if self.Increment_N_Distance is not None:877 showIndent(outfile, level, pretty_print)878 outfile.write('<Increment_N_Distance>%s</Increment_N_Distance>%s' % (self.gds_format_integer(self.Increment_N_Distance, input_name='Increment_N_Distance'), eol_))879 if self.Dark_Band_Code is not None:880 showIndent(outfile, level, pretty_print)881 outfile.write('<Dark_Band_Code>%s</Dark_Band_Code>%s' % (self.gds_format_integer(self.Dark_Band_Code, input_name='Dark_Band_Code'), eol_))882 if self.SE_Valid_AOT_Radius is not None:883 showIndent(outfile, level, pretty_print)884 outfile.write('<SE_Valid_AOT_Radius>%s</SE_Valid_AOT_Radius>%s' % (self.gds_format_integer(self.SE_Valid_AOT_Radius, input_name='SE_Valid_AOT_Radius'), eol_))885 if self.SE_Mask_Dilatation_Radius is not None:886 showIndent(outfile, level, pretty_print)887 outfile.write('<SE_Mask_Dilatation_Radius>%s</SE_Mask_Dilatation_Radius>%s' % (self.gds_format_integer(self.SE_Mask_Dilatation_Radius, input_name='SE_Mask_Dilatation_Radius'), eol_))888 if self.Half_Window_Size is not None:889 showIndent(outfile, level, pretty_print)890 outfile.write('<Half_Window_Size>%s</Half_Window_Size>%s' % (self.gds_format_integer(self.Half_Window_Size, input_name='Half_Window_Size'), eol_))891 if self.W_dark is not None:892 showIndent(outfile, level, pretty_print)893 outfile.write('<W_dark>%s</W_dark>%s' % (self.gds_format_integer(self.W_dark, input_name='W_dark'), eol_))894 if self.W_bounds is not None:895 showIndent(outfile, level, pretty_print)896 outfile.write('<W_bounds>%s</W_bounds>%s' % (self.gds_format_integer(self.W_bounds, input_name='W_bounds'), eol_))897 if self.AOT_min is not None:898 showIndent(outfile, level, pretty_print)899 outfile.write('<AOT_min>%s</AOT_min>%s' % (self.gds_format_double(self.AOT_min, input_name='AOT_min'), eol_))900 if self.F_Tolerance is not None:901 showIndent(outfile, level, pretty_print)902 outfile.write('<F_Tolerance>%s</F_Tolerance>%s' % (self.gds_format_double(self.F_Tolerance, input_name='F_Tolerance'), eol_))903 if self.G_Tolerance is not None:904 showIndent(outfile, level, pretty_print)905 outfile.write('<G_Tolerance>%s</G_Tolerance>%s' % (self.gds_format_double(self.G_Tolerance, input_name='G_Tolerance'), eol_))906 if self.X_Tolerance is not None:907 showIndent(outfile, level, pretty_print)908 outfile.write('<X_Tolerance>%s</X_Tolerance>%s' % (self.gds_format_double(self.X_Tolerance, input_name='X_Tolerance'), eol_))909 if self.Epsilon_Function is not None:910 showIndent(outfile, level, pretty_print)911 outfile.write('<Epsilon_Function>%s</Epsilon_Function>%s' % (self.gds_format_double(self.Epsilon_Function, input_name='Epsilon_Function'), eol_))912 if self.Max_Iterations is not None:913 showIndent(outfile, level, pretty_print)914 outfile.write('<Max_Iterations>%s</Max_Iterations>%s' % (self.gds_format_integer(self.Max_Iterations, input_name='Max_Iterations'), eol_))915 if self.AOT_initial_D is not None:916 showIndent(outfile, level, pretty_print)917 outfile.write('<AOT_initial_D>%s</AOT_initial_D>%s' % (self.gds_format_double(self.AOT_initial_D, input_name='AOT_initial_D'), eol_))918 if self.Init_Window_Radius is not None:919 showIndent(outfile, level, pretty_print)920 outfile.write('<Init_Window_Radius>%s</Init_Window_Radius>%s' % (self.gds_format_integer(self.Init_Window_Radius, input_name='Init_Window_Radius'), eol_))921 if self.Max_Window_Radius is not None:922 showIndent(outfile, level, pretty_print)923 outfile.write('<Max_Window_Radius>%s</Max_Window_Radius>%s' % (self.gds_format_integer(self.Max_Window_Radius, input_name='Max_Window_Radius'), eol_))924 if self.Sigma_Smoothing_AOT is not None:925 showIndent(outfile, level, pretty_print)926 outfile.write('<Sigma_Smoothing_AOT>%s</Sigma_Smoothing_AOT>%s' % (self.gds_format_integer(self.Sigma_Smoothing_AOT, input_name='Sigma_Smoothing_AOT'), eol_))927 def build(self, node):928 already_processed = set()929 self.buildAttributes(node, node.attrib, already_processed)930 for child in node:931 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]932 self.buildChildren(child, node, nodeName_)933 return self934 def buildAttributes(self, node, attrs, already_processed):935 pass936 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):937 if nodeName_ == 'AOT_Method':938 AOT_Method_ = child_.text939 AOT_Method_ = self.gds_validate_string(AOT_Method_, node, 'AOT_Method')940 self.AOT_Method = AOT_Method_941 elif nodeName_ == 'AOT_KPondCAMS':942 sval_ = child_.text943 try:944 fval_ = float(sval_)945 except (TypeError, ValueError) as exp:946 raise_parse_error(child_, 'requires float or double: %s' % exp)947 fval_ = self.gds_validate_float(fval_, node, 'AOT_KPondCAMS')948 self.AOT_KPondCAMS = fval_949 elif nodeName_ == 'AOT_HeightScale':950 sval_ = child_.text951 try:952 fval_ = float(sval_)953 except (TypeError, ValueError) as exp:954 raise_parse_error(child_, 'requires float or double: %s' % exp)955 fval_ = self.gds_validate_float(fval_, node, 'AOT_HeightScale')956 self.AOT_HeightScale = fval_957 elif nodeName_ == 'Multi_Spectral_Method':958 obj_ = Multi_Spectral_MethodType.factory()959 obj_.build(child_)960 self.Multi_Spectral_Method = obj_961 obj_.original_tagname_ = 'Multi_Spectral_Method'962 elif nodeName_ == 'Multi_Temporal_Method':963 obj_ = Multi_Temporal_MethodType.factory()964 obj_.build(child_)965 self.Multi_Temporal_Method = obj_966 obj_.original_tagname_ = 'Multi_Temporal_Method'967 elif nodeName_ == 'Spectro_Temporal_Method':968 obj_ = Spectro_Temporal_MethodType.factory()969 obj_.build(child_)970 self.Spectro_Temporal_Method = obj_971 obj_.original_tagname_ = 'Spectro_Temporal_Method'972 elif nodeName_ == 'AOT_Max_Age':973 sval_ = child_.text974 try:975 ival_ = int(sval_)976 except (TypeError, ValueError) as exp:977 raise_parse_error(child_, 'requires integer: %s' % exp)978 if ival_ <= 0:979 raise_parse_error(child_, 'requires positiveInteger')980 ival_ = self.gds_validate_integer(ival_, node, 'AOT_Max_Age')981 self.AOT_Max_Age = ival_982 elif nodeName_ == 'Default_AOT':983 sval_ = child_.text984 try:985 fval_ = float(sval_)986 except (TypeError, ValueError) as exp:987 raise_parse_error(child_, 'requires float or double: %s' % exp)988 fval_ = self.gds_validate_float(fval_, node, 'Default_AOT')989 self.Default_AOT = fval_990 elif nodeName_ == 'Step_AOT':991 sval_ = child_.text992 try:993 ival_ = int(sval_)994 except (TypeError, ValueError) as exp:995 raise_parse_error(child_, 'requires integer: %s' % exp)996 if ival_ <= 0:997 raise_parse_error(child_, 'requires positiveInteger')998 ival_ = self.gds_validate_integer(ival_, node, 'Step_AOT')999 self.Step_AOT = ival_1000 elif nodeName_ == 'Sampling_Interval_Min':1001 sval_ = child_.text1002 try:1003 ival_ = int(sval_)1004 except (TypeError, ValueError) as exp:1005 raise_parse_error(child_, 'requires integer: %s' % exp)1006 if ival_ <= 0:1007 raise_parse_error(child_, 'requires positiveInteger')1008 ival_ = self.gds_validate_integer(ival_, node, 'Sampling_Interval_Min')1009 self.Sampling_Interval_Min = ival_1010 elif nodeName_ == 'Sampling_Interval_Max':1011 sval_ = child_.text1012 try:1013 ival_ = int(sval_)1014 except (TypeError, ValueError) as exp:1015 raise_parse_error(child_, 'requires integer: %s' % exp)1016 if ival_ <= 0:1017 raise_parse_error(child_, 'requires positiveInteger')1018 ival_ = self.gds_validate_integer(ival_, node, 'Sampling_Interval_Max')1019 self.Sampling_Interval_Max = ival_1020 elif nodeName_ == 'N_Pix_Min':1021 sval_ = child_.text1022 try:1023 ival_ = int(sval_)1024 except (TypeError, ValueError) as exp:1025 raise_parse_error(child_, 'requires integer: %s' % exp)1026 if ival_ <= 0:1027 raise_parse_error(child_, 'requires positiveInteger')1028 ival_ = self.gds_validate_integer(ival_, node, 'N_Pix_Min')1029 self.N_Pix_Min = ival_1030 elif nodeName_ == 'Increment_N_Distance':1031 sval_ = child_.text1032 try:1033 ival_ = int(sval_)1034 except (TypeError, ValueError) as exp:1035 raise_parse_error(child_, 'requires integer: %s' % exp)1036 if ival_ <= 0:1037 raise_parse_error(child_, 'requires positiveInteger')1038 ival_ = self.gds_validate_integer(ival_, node, 'Increment_N_Distance')1039 self.Increment_N_Distance = ival_1040 elif nodeName_ == 'Dark_Band_Code':1041 sval_ = child_.text1042 try:1043 ival_ = int(sval_)1044 except (TypeError, ValueError) as exp:1045 raise_parse_error(child_, 'requires integer: %s' % exp)1046 if ival_ <= 0:1047 raise_parse_error(child_, 'requires positiveInteger')1048 ival_ = self.gds_validate_integer(ival_, node, 'Dark_Band_Code')1049 self.Dark_Band_Code = ival_1050 elif nodeName_ == 'SE_Valid_AOT_Radius':1051 sval_ = child_.text1052 try:1053 ival_ = int(sval_)1054 except (TypeError, ValueError) as exp:1055 raise_parse_error(child_, 'requires integer: %s' % exp)1056 if ival_ <= 0:1057 raise_parse_error(child_, 'requires positiveInteger')1058 ival_ = self.gds_validate_integer(ival_, node, 'SE_Valid_AOT_Radius')1059 self.SE_Valid_AOT_Radius = ival_1060 elif nodeName_ == 'SE_Mask_Dilatation_Radius':1061 sval_ = child_.text1062 try:1063 ival_ = int(sval_)1064 except (TypeError, ValueError) as exp:1065 raise_parse_error(child_, 'requires integer: %s' % exp)1066 if ival_ <= 0:1067 raise_parse_error(child_, 'requires positiveInteger')1068 ival_ = self.gds_validate_integer(ival_, node, 'SE_Mask_Dilatation_Radius')1069 self.SE_Mask_Dilatation_Radius = ival_1070 elif nodeName_ == 'Half_Window_Size':1071 sval_ = child_.text1072 try:1073 ival_ = int(sval_)1074 except (TypeError, ValueError) as exp:1075 raise_parse_error(child_, 'requires integer: %s' % exp)1076 if ival_ <= 0:1077 raise_parse_error(child_, 'requires positiveInteger')1078 ival_ = self.gds_validate_integer(ival_, node, 'Half_Window_Size')1079 self.Half_Window_Size = ival_1080 elif nodeName_ == 'W_dark':1081 sval_ = child_.text1082 try:1083 ival_ = int(sval_)1084 except (TypeError, ValueError) as exp:1085 raise_parse_error(child_, 'requires integer: %s' % exp)1086 if ival_ <= 0:1087 raise_parse_error(child_, 'requires positiveInteger')1088 ival_ = self.gds_validate_integer(ival_, node, 'W_dark')1089 self.W_dark = ival_1090 elif nodeName_ == 'W_bounds':1091 sval_ = child_.text1092 try:1093 ival_ = int(sval_)1094 except (TypeError, ValueError) as exp:1095 raise_parse_error(child_, 'requires integer: %s' % exp)1096 if ival_ <= 0:1097 raise_parse_error(child_, 'requires positiveInteger')1098 ival_ = self.gds_validate_integer(ival_, node, 'W_bounds')1099 self.W_bounds = ival_1100 elif nodeName_ == 'AOT_min':1101 sval_ = child_.text1102 try:1103 fval_ = float(sval_)1104 except (TypeError, ValueError) as exp:1105 raise_parse_error(child_, 'requires float or double: %s' % exp)1106 fval_ = self.gds_validate_float(fval_, node, 'AOT_min')1107 self.AOT_min = fval_1108 elif nodeName_ == 'F_Tolerance':1109 sval_ = child_.text1110 try:1111 fval_ = float(sval_)1112 except (TypeError, ValueError) as exp:1113 raise_parse_error(child_, 'requires float or double: %s' % exp)1114 fval_ = self.gds_validate_float(fval_, node, 'F_Tolerance')1115 self.F_Tolerance = fval_1116 elif nodeName_ == 'G_Tolerance':1117 sval_ = child_.text1118 try:1119 fval_ = float(sval_)1120 except (TypeError, ValueError) as exp:1121 raise_parse_error(child_, 'requires float or double: %s' % exp)1122 fval_ = self.gds_validate_float(fval_, node, 'G_Tolerance')1123 self.G_Tolerance = fval_1124 elif nodeName_ == 'X_Tolerance':1125 sval_ = child_.text1126 try:1127 fval_ = float(sval_)1128 except (TypeError, ValueError) as exp:1129 raise_parse_error(child_, 'requires float or double: %s' % exp)1130 fval_ = self.gds_validate_float(fval_, node, 'X_Tolerance')1131 self.X_Tolerance = fval_1132 elif nodeName_ == 'Epsilon_Function':1133 sval_ = child_.text1134 try:1135 fval_ = float(sval_)1136 except (TypeError, ValueError) as exp:1137 raise_parse_error(child_, 'requires float or double: %s' % exp)1138 fval_ = self.gds_validate_float(fval_, node, 'Epsilon_Function')1139 self.Epsilon_Function = fval_1140 elif nodeName_ == 'Max_Iterations':1141 sval_ = child_.text1142 try:1143 ival_ = int(sval_)1144 except (TypeError, ValueError) as exp:1145 raise_parse_error(child_, 'requires integer: %s' % exp)1146 if ival_ <= 0:1147 raise_parse_error(child_, 'requires positiveInteger')1148 ival_ = self.gds_validate_integer(ival_, node, 'Max_Iterations')1149 self.Max_Iterations = ival_1150 elif nodeName_ == 'AOT_initial_D':1151 sval_ = child_.text1152 try:1153 fval_ = float(sval_)1154 except (TypeError, ValueError) as exp:1155 raise_parse_error(child_, 'requires float or double: %s' % exp)1156 fval_ = self.gds_validate_float(fval_, node, 'AOT_initial_D')1157 self.AOT_initial_D = fval_1158 elif nodeName_ == 'Init_Window_Radius':1159 sval_ = child_.text1160 try:1161 ival_ = int(sval_)1162 except (TypeError, ValueError) as exp:1163 raise_parse_error(child_, 'requires integer: %s' % exp)1164 if ival_ <= 0:1165 raise_parse_error(child_, 'requires positiveInteger')1166 ival_ = self.gds_validate_integer(ival_, node, 'Init_Window_Radius')1167 self.Init_Window_Radius = ival_1168 elif nodeName_ == 'Max_Window_Radius':1169 sval_ = child_.text1170 try:1171 ival_ = int(sval_)1172 except (TypeError, ValueError) as exp:1173 raise_parse_error(child_, 'requires integer: %s' % exp)1174 if ival_ <= 0:1175 raise_parse_error(child_, 'requires positiveInteger')1176 ival_ = self.gds_validate_integer(ival_, node, 'Max_Window_Radius')1177 self.Max_Window_Radius = ival_1178 elif nodeName_ == 'Sigma_Smoothing_AOT':1179 sval_ = child_.text1180 try:1181 ival_ = int(sval_)1182 except (TypeError, ValueError) as exp:1183 raise_parse_error(child_, 'requires integer: %s' % exp)1184 if ival_ <= 0:1185 raise_parse_error(child_, 'requires positiveInteger')1186 ival_ = self.gds_validate_integer(ival_, node, 'Sigma_Smoothing_AOT')1187 self.Sigma_Smoothing_AOT = ival_1188# end class AOT_Estimation1189class Multi_Spectral_MethodType(GeneratedsSuper):1190 subclass = None1191 superclass = None1192 def __init__(self, MS_AOT_Band_Code=None, MS_AOT_Red_Band_Code=None, NDVI_AOT_Band1_Code=None, NDVI_AOT_Band2_Code=None, NDVI_Threshold=None, Red_TOA_Threshold=None, MS_Slope=None, MS_YIntercept=None, NDVI_Slope=None, NDVI_YIntercept=None, W_MS=None):1193 self.original_tagname_ = None1194 self.MS_AOT_Band_Code = MS_AOT_Band_Code1195 self.validate_MS_AOT_Band_CodeType(self.MS_AOT_Band_Code)1196 self.MS_AOT_Red_Band_Code = MS_AOT_Red_Band_Code1197 self.NDVI_AOT_Band1_Code = NDVI_AOT_Band1_Code1198 self.NDVI_AOT_Band2_Code = NDVI_AOT_Band2_Code1199 self.NDVI_Threshold = NDVI_Threshold1200 self.Red_TOA_Threshold = Red_TOA_Threshold1201 self.MS_Slope = MS_Slope1202 self.MS_YIntercept = MS_YIntercept1203 self.NDVI_Slope = NDVI_Slope1204 self.NDVI_YIntercept = NDVI_YIntercept1205 self.W_MS = W_MS1206 def factory(*args_, **kwargs_):1207 if CurrentSubclassModule_ is not None:1208 subclass = getSubclassFromModule_(1209 CurrentSubclassModule_, Multi_Spectral_MethodType)1210 if subclass is not None:1211 return subclass(*args_, **kwargs_)1212 if Multi_Spectral_MethodType.subclass:1213 return Multi_Spectral_MethodType.subclass(*args_, **kwargs_)1214 else:1215 return Multi_Spectral_MethodType(*args_, **kwargs_)1216 factory = staticmethod(factory)1217 def get_MS_AOT_Band_Code(self): return self.MS_AOT_Band_Code1218 def set_MS_AOT_Band_Code(self, MS_AOT_Band_Code): self.MS_AOT_Band_Code = MS_AOT_Band_Code1219 def get_MS_AOT_Red_Band_Code(self): return self.MS_AOT_Red_Band_Code1220 def set_MS_AOT_Red_Band_Code(self, MS_AOT_Red_Band_Code): self.MS_AOT_Red_Band_Code = MS_AOT_Red_Band_Code1221 def get_NDVI_AOT_Band1_Code(self): return self.NDVI_AOT_Band1_Code1222 def set_NDVI_AOT_Band1_Code(self, NDVI_AOT_Band1_Code): self.NDVI_AOT_Band1_Code = NDVI_AOT_Band1_Code1223 def get_NDVI_AOT_Band2_Code(self): return self.NDVI_AOT_Band2_Code1224 def set_NDVI_AOT_Band2_Code(self, NDVI_AOT_Band2_Code): self.NDVI_AOT_Band2_Code = NDVI_AOT_Band2_Code1225 def get_NDVI_Threshold(self): return self.NDVI_Threshold1226 def set_NDVI_Threshold(self, NDVI_Threshold): self.NDVI_Threshold = NDVI_Threshold1227 def get_Red_TOA_Threshold(self): return self.Red_TOA_Threshold1228 def set_Red_TOA_Threshold(self, Red_TOA_Threshold): self.Red_TOA_Threshold = Red_TOA_Threshold1229 def get_MS_Slope(self): return self.MS_Slope1230 def set_MS_Slope(self, MS_Slope): self.MS_Slope = MS_Slope1231 def get_MS_YIntercept(self): return self.MS_YIntercept1232 def set_MS_YIntercept(self, MS_YIntercept): self.MS_YIntercept = MS_YIntercept1233 def get_NDVI_Slope(self): return self.NDVI_Slope1234 def set_NDVI_Slope(self, NDVI_Slope): self.NDVI_Slope = NDVI_Slope1235 def get_NDVI_YIntercept(self): return self.NDVI_YIntercept1236 def set_NDVI_YIntercept(self, NDVI_YIntercept): self.NDVI_YIntercept = NDVI_YIntercept1237 def get_W_MS(self): return self.W_MS1238 def set_W_MS(self, W_MS): self.W_MS = W_MS1239 def validate_MS_AOT_Band_CodeType(self, value):1240 # Validate type MS_AOT_Band_CodeType, a restriction on xs:positiveInteger.1241 pass1242 def hasContent_(self):1243 if (1244 self.MS_AOT_Band_Code is not None or1245 self.MS_AOT_Red_Band_Code is not None or1246 self.NDVI_AOT_Band1_Code is not None or1247 self.NDVI_AOT_Band2_Code is not None or1248 self.NDVI_Threshold is not None or1249 self.Red_TOA_Threshold is not None or1250 self.MS_Slope is not None or1251 self.MS_YIntercept is not None or1252 self.NDVI_Slope is not None or1253 self.NDVI_YIntercept is not None or1254 self.W_MS is not None1255 ):1256 return True1257 else:1258 return False1259 def export(self, outfile, level, namespace_='', name_='Multi_Spectral_MethodType', namespacedef_='', pretty_print=True):1260 imported_ns_def_ = GenerateDSNamespaceDefs_.get('Multi_Spectral_MethodType')1261 if imported_ns_def_ is not None:1262 namespacedef_ = imported_ns_def_1263 if pretty_print:1264 eol_ = '\n'1265 else:1266 eol_ = ''1267 if self.original_tagname_ is not None:1268 name_ = self.original_tagname_1269 showIndent(outfile, level, pretty_print)1270 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1271 already_processed = set()1272 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Multi_Spectral_MethodType')1273 if self.hasContent_():1274 outfile.write('>%s' % (eol_, ))1275 self.exportChildren(outfile, level + 1, namespace_='', name_='Multi_Spectral_MethodType', pretty_print=pretty_print)1276 showIndent(outfile, level, pretty_print)1277 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1278 else:1279 outfile.write('/>%s' % (eol_, ))1280 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='Multi_Spectral_MethodType'):1281 pass1282 def exportChildren(self, outfile, level, namespace_='', name_='Multi_Spectral_MethodType', fromsubclass_=False, pretty_print=True):1283 if pretty_print:1284 eol_ = '\n'1285 else:1286 eol_ = ''1287 if self.MS_AOT_Band_Code is not None:1288 showIndent(outfile, level, pretty_print)1289 outfile.write('<MS_AOT_Band_Code>%s</MS_AOT_Band_Code>%s' % (self.gds_format_integer_list(self.MS_AOT_Band_Code, input_name='MS_AOT_Band_Code'), eol_))1290 if self.MS_AOT_Red_Band_Code is not None:1291 showIndent(outfile, level, pretty_print)1292 outfile.write('<MS_AOT_Red_Band_Code>%s</MS_AOT_Red_Band_Code>%s' % (self.gds_format_integer(self.MS_AOT_Red_Band_Code, input_name='MS_AOT_Red_Band_Code'), eol_))1293 if self.NDVI_AOT_Band1_Code is not None:1294 showIndent(outfile, level, pretty_print)1295 outfile.write('<NDVI_AOT_Band1_Code>%s</NDVI_AOT_Band1_Code>%s' % (self.gds_format_integer(self.NDVI_AOT_Band1_Code, input_name='NDVI_AOT_Band1_Code'), eol_))1296 if self.NDVI_AOT_Band2_Code is not None:1297 showIndent(outfile, level, pretty_print)1298 outfile.write('<NDVI_AOT_Band2_Code>%s</NDVI_AOT_Band2_Code>%s' % (self.gds_format_integer(self.NDVI_AOT_Band2_Code, input_name='NDVI_AOT_Band2_Code'), eol_))1299 if self.NDVI_Threshold is not None:1300 showIndent(outfile, level, pretty_print)1301 outfile.write('<NDVI_Threshold>%s</NDVI_Threshold>%s' % (self.gds_format_double(self.NDVI_Threshold, input_name='NDVI_Threshold'), eol_))1302 if self.Red_TOA_Threshold is not None:1303 showIndent(outfile, level, pretty_print)1304 outfile.write('<Red_TOA_Threshold>%s</Red_TOA_Threshold>%s' % (self.gds_format_double(self.Red_TOA_Threshold, input_name='Red_TOA_Threshold'), eol_))1305 if self.MS_Slope is not None:1306 showIndent(outfile, level, pretty_print)1307 outfile.write('<MS_Slope>%s</MS_Slope>%s' % (self.gds_format_float(self.MS_Slope, input_name='MS_Slope'), eol_))1308 if self.MS_YIntercept is not None:1309 showIndent(outfile, level, pretty_print)1310 outfile.write('<MS_YIntercept>%s</MS_YIntercept>%s' % (self.gds_format_float(self.MS_YIntercept, input_name='MS_YIntercept'), eol_))1311 if self.NDVI_Slope is not None:1312 showIndent(outfile, level, pretty_print)1313 outfile.write('<NDVI_Slope>%s</NDVI_Slope>%s' % (self.gds_format_double(self.NDVI_Slope, input_name='NDVI_Slope'), eol_))1314 if self.NDVI_YIntercept is not None:1315 showIndent(outfile, level, pretty_print)1316 outfile.write('<NDVI_YIntercept>%s</NDVI_YIntercept>%s' % (self.gds_format_double(self.NDVI_YIntercept, input_name='NDVI_YIntercept'), eol_))1317 if self.W_MS is not None:1318 showIndent(outfile, level, pretty_print)1319 outfile.write('<W_MS>%s</W_MS>%s' % (self.gds_format_double(self.W_MS, input_name='W_MS'), eol_))1320 def build(self, node):1321 already_processed = set()1322 self.buildAttributes(node, node.attrib, already_processed)1323 for child in node:1324 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1325 self.buildChildren(child, node, nodeName_)1326 return self1327 def buildAttributes(self, node, attrs, already_processed):1328 pass1329 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1330 if nodeName_ == 'MS_AOT_Band_Code':1331 MS_AOT_Band_Code_ = child_.text1332 MS_AOT_Band_Code_ = self.gds_validate_integer_list(MS_AOT_Band_Code_, node, 'MS_AOT_Band_Code')1333 self.MS_AOT_Band_Code = MS_AOT_Band_Code_1334 # validate type MS_AOT_Band_CodeType1335 self.validate_MS_AOT_Band_CodeType(self.MS_AOT_Band_Code)1336 elif nodeName_ == 'MS_AOT_Red_Band_Code':1337 sval_ = child_.text1338 try:1339 ival_ = int(sval_)1340 except (TypeError, ValueError) as exp:1341 raise_parse_error(child_, 'requires integer: %s' % exp)1342 if ival_ <= 0:1343 raise_parse_error(child_, 'requires positiveInteger')1344 ival_ = self.gds_validate_integer(ival_, node, 'MS_AOT_Red_Band_Code')1345 self.MS_AOT_Red_Band_Code = ival_1346 elif nodeName_ == 'NDVI_AOT_Band1_Code':1347 sval_ = child_.text1348 try:1349 ival_ = int(sval_)1350 except (TypeError, ValueError) as exp:1351 raise_parse_error(child_, 'requires integer: %s' % exp)1352 if ival_ <= 0:1353 raise_parse_error(child_, 'requires positiveInteger')1354 ival_ = self.gds_validate_integer(ival_, node, 'NDVI_AOT_Band1_Code')1355 self.NDVI_AOT_Band1_Code = ival_1356 elif nodeName_ == 'NDVI_AOT_Band2_Code':1357 sval_ = child_.text1358 try:1359 ival_ = int(sval_)1360 except (TypeError, ValueError) as exp:1361 raise_parse_error(child_, 'requires integer: %s' % exp)1362 if ival_ <= 0:1363 raise_parse_error(child_, 'requires positiveInteger')1364 ival_ = self.gds_validate_integer(ival_, node, 'NDVI_AOT_Band2_Code')1365 self.NDVI_AOT_Band2_Code = ival_1366 elif nodeName_ == 'NDVI_Threshold':1367 sval_ = child_.text1368 try:1369 fval_ = float(sval_)1370 except (TypeError, ValueError) as exp:1371 raise_parse_error(child_, 'requires float or double: %s' % exp)1372 fval_ = self.gds_validate_float(fval_, node, 'NDVI_Threshold')1373 self.NDVI_Threshold = fval_1374 elif nodeName_ == 'Red_TOA_Threshold':1375 sval_ = child_.text1376 try:1377 fval_ = float(sval_)1378 except (TypeError, ValueError) as exp:1379 raise_parse_error(child_, 'requires float or double: %s' % exp)1380 fval_ = self.gds_validate_float(fval_, node, 'Red_TOA_Threshold')1381 self.Red_TOA_Threshold = fval_1382 elif nodeName_ == 'MS_Slope':1383 sval_ = child_.text1384 try:1385 fval_ = float(sval_)1386 except (TypeError, ValueError) as exp:1387 raise_parse_error(child_, 'requires float or double: %s' % exp)1388 fval_ = self.gds_validate_float(fval_, node, 'MS_Slope')1389 self.MS_Slope = fval_1390 elif nodeName_ == 'MS_YIntercept':1391 sval_ = child_.text1392 try:1393 fval_ = float(sval_)1394 except (TypeError, ValueError) as exp:1395 raise_parse_error(child_, 'requires float or double: %s' % exp)1396 fval_ = self.gds_validate_float(fval_, node, 'MS_YIntercept')1397 self.MS_YIntercept = fval_1398 elif nodeName_ == 'NDVI_Slope':1399 sval_ = child_.text1400 try:1401 fval_ = float(sval_)1402 except (TypeError, ValueError) as exp:1403 raise_parse_error(child_, 'requires float or double: %s' % exp)1404 fval_ = self.gds_validate_float(fval_, node, 'NDVI_Slope')1405 self.NDVI_Slope = fval_1406 elif nodeName_ == 'NDVI_YIntercept':1407 sval_ = child_.text1408 try:1409 fval_ = float(sval_)1410 except (TypeError, ValueError) as exp:1411 raise_parse_error(child_, 'requires float or double: %s' % exp)1412 fval_ = self.gds_validate_float(fval_, node, 'NDVI_YIntercept')1413 self.NDVI_YIntercept = fval_1414 elif nodeName_ == 'W_MS':1415 sval_ = child_.text1416 try:1417 fval_ = float(sval_)1418 except (TypeError, ValueError) as exp:1419 raise_parse_error(child_, 'requires float or double: %s' % exp)1420 fval_ = self.gds_validate_float(fval_, node, 'W_MS')1421 self.W_MS = fval_1422# end class Multi_Spectral_MethodType1423class Multi_Temporal_MethodType(GeneratedsSuper):1424 subclass = None1425 superclass = None1426 def __init__(self, MT_AOT_Band_Code_D=None, MT_AOT_Band_Reflectance_Composite_Dm1=None, MT_AOT_Band_LUT_Composite_Dm1=None, Var_Band_Code_D=None, Var_Band_Code_Dm1=None, Relative_Var_Max=None, W_MT_equation2=None, Stdev_Band_Code=None, Stdev_Min=None, Std_Noise=None, AOT_initial_Dm1=None, First_AOT=None, Second_AOT=None, TOA_Reflectance_Min=None, TOA_Reflectance_Max=None, TOA_Reflectance_Step=None, Min_Difference_Thresholds_Calculation=None):1427 self.original_tagname_ = None1428 self.MT_AOT_Band_Code_D = MT_AOT_Band_Code_D1429 self.validate_MT_AOT_Band_Code_DType(self.MT_AOT_Band_Code_D)1430 self.MT_AOT_Band_Reflectance_Composite_Dm1 = MT_AOT_Band_Reflectance_Composite_Dm11431 self.validate_MT_AOT_Band_Reflectance_Composite_Dm1Type(self.MT_AOT_Band_Reflectance_Composite_Dm1)1432 self.MT_AOT_Band_LUT_Composite_Dm1 = MT_AOT_Band_LUT_Composite_Dm11433 self.validate_MT_AOT_Band_LUT_Composite_Dm1Type(self.MT_AOT_Band_LUT_Composite_Dm1)1434 self.Var_Band_Code_D = Var_Band_Code_D1435 self.Var_Band_Code_Dm1 = Var_Band_Code_Dm11436 self.Relative_Var_Max = Relative_Var_Max1437 self.W_MT_equation2 = W_MT_equation21438 self.Stdev_Band_Code = Stdev_Band_Code1439 self.Stdev_Min = Stdev_Min1440 self.Std_Noise = Std_Noise1441 self.AOT_initial_Dm1 = AOT_initial_Dm11442 self.First_AOT = First_AOT1443 self.Second_AOT = Second_AOT1444 self.TOA_Reflectance_Min = TOA_Reflectance_Min1445 self.TOA_Reflectance_Max = TOA_Reflectance_Max1446 self.TOA_Reflectance_Step = TOA_Reflectance_Step1447 self.Min_Difference_Thresholds_Calculation = Min_Difference_Thresholds_Calculation1448 def factory(*args_, **kwargs_):1449 if CurrentSubclassModule_ is not None:1450 subclass = getSubclassFromModule_(1451 CurrentSubclassModule_, Multi_Temporal_MethodType)1452 if subclass is not None:1453 return subclass(*args_, **kwargs_)1454 if Multi_Temporal_MethodType.subclass:1455 return Multi_Temporal_MethodType.subclass(*args_, **kwargs_)1456 else:1457 return Multi_Temporal_MethodType(*args_, **kwargs_)1458 factory = staticmethod(factory)1459 def get_MT_AOT_Band_Code_D(self): return self.MT_AOT_Band_Code_D1460 def set_MT_AOT_Band_Code_D(self, MT_AOT_Band_Code_D): self.MT_AOT_Band_Code_D = MT_AOT_Band_Code_D1461 def get_MT_AOT_Band_Reflectance_Composite_Dm1(self): return self.MT_AOT_Band_Reflectance_Composite_Dm11462 def set_MT_AOT_Band_Reflectance_Composite_Dm1(self, MT_AOT_Band_Reflectance_Composite_Dm1): self.MT_AOT_Band_Reflectance_Composite_Dm1 = MT_AOT_Band_Reflectance_Composite_Dm11463 def get_MT_AOT_Band_LUT_Composite_Dm1(self): return self.MT_AOT_Band_LUT_Composite_Dm11464 def set_MT_AOT_Band_LUT_Composite_Dm1(self, MT_AOT_Band_LUT_Composite_Dm1): self.MT_AOT_Band_LUT_Composite_Dm1 = MT_AOT_Band_LUT_Composite_Dm11465 def get_Var_Band_Code_D(self): return self.Var_Band_Code_D1466 def set_Var_Band_Code_D(self, Var_Band_Code_D): self.Var_Band_Code_D = Var_Band_Code_D1467 def get_Var_Band_Code_Dm1(self): return self.Var_Band_Code_Dm11468 def set_Var_Band_Code_Dm1(self, Var_Band_Code_Dm1): self.Var_Band_Code_Dm1 = Var_Band_Code_Dm11469 def get_Relative_Var_Max(self): return self.Relative_Var_Max1470 def set_Relative_Var_Max(self, Relative_Var_Max): self.Relative_Var_Max = Relative_Var_Max1471 def get_W_MT_equation2(self): return self.W_MT_equation21472 def set_W_MT_equation2(self, W_MT_equation2): self.W_MT_equation2 = W_MT_equation21473 def get_Stdev_Band_Code(self): return self.Stdev_Band_Code1474 def set_Stdev_Band_Code(self, Stdev_Band_Code): self.Stdev_Band_Code = Stdev_Band_Code1475 def get_Stdev_Min(self): return self.Stdev_Min1476 def set_Stdev_Min(self, Stdev_Min): self.Stdev_Min = Stdev_Min1477 def get_Std_Noise(self): return self.Std_Noise1478 def set_Std_Noise(self, Std_Noise): self.Std_Noise = Std_Noise1479 def get_AOT_initial_Dm1(self): return self.AOT_initial_Dm11480 def set_AOT_initial_Dm1(self, AOT_initial_Dm1): self.AOT_initial_Dm1 = AOT_initial_Dm11481 def get_First_AOT(self): return self.First_AOT1482 def set_First_AOT(self, First_AOT): self.First_AOT = First_AOT1483 def get_Second_AOT(self): return self.Second_AOT1484 def set_Second_AOT(self, Second_AOT): self.Second_AOT = Second_AOT1485 def get_TOA_Reflectance_Min(self): return self.TOA_Reflectance_Min1486 def set_TOA_Reflectance_Min(self, TOA_Reflectance_Min): self.TOA_Reflectance_Min = TOA_Reflectance_Min1487 def get_TOA_Reflectance_Max(self): return self.TOA_Reflectance_Max1488 def set_TOA_Reflectance_Max(self, TOA_Reflectance_Max): self.TOA_Reflectance_Max = TOA_Reflectance_Max1489 def get_TOA_Reflectance_Step(self): return self.TOA_Reflectance_Step1490 def set_TOA_Reflectance_Step(self, TOA_Reflectance_Step): self.TOA_Reflectance_Step = TOA_Reflectance_Step1491 def get_Min_Difference_Thresholds_Calculation(self): return self.Min_Difference_Thresholds_Calculation1492 def set_Min_Difference_Thresholds_Calculation(self, Min_Difference_Thresholds_Calculation): self.Min_Difference_Thresholds_Calculation = Min_Difference_Thresholds_Calculation1493 def validate_MT_AOT_Band_Code_DType(self, value):1494 # Validate type MT_AOT_Band_Code_DType, a restriction on xs:positiveInteger.1495 pass1496 def validate_MT_AOT_Band_Reflectance_Composite_Dm1Type(self, value):1497 # Validate type MT_AOT_Band_Reflectance_Composite_Dm1Type, a restriction on xs:positiveInteger.1498 pass1499 def validate_MT_AOT_Band_LUT_Composite_Dm1Type(self, value):1500 # Validate type MT_AOT_Band_LUT_Composite_Dm1Type, a restriction on xs:positiveInteger.1501 pass1502 def hasContent_(self):1503 if (1504 self.MT_AOT_Band_Code_D is not None or1505 self.MT_AOT_Band_Reflectance_Composite_Dm1 is not None or1506 self.MT_AOT_Band_LUT_Composite_Dm1 is not None or1507 self.Var_Band_Code_D is not None or1508 self.Var_Band_Code_Dm1 is not None or1509 self.Relative_Var_Max is not None or1510 self.W_MT_equation2 is not None or1511 self.Stdev_Band_Code is not None or1512 self.Stdev_Min is not None or1513 self.Std_Noise is not None or1514 self.AOT_initial_Dm1 is not None or1515 self.First_AOT is not None or1516 self.Second_AOT is not None or1517 self.TOA_Reflectance_Min is not None or1518 self.TOA_Reflectance_Max is not None or1519 self.TOA_Reflectance_Step is not None or1520 self.Min_Difference_Thresholds_Calculation is not None1521 ):1522 return True1523 else:1524 return False1525 def export(self, outfile, level, namespace_='', name_='Multi_Temporal_MethodType', namespacedef_='', pretty_print=True):1526 imported_ns_def_ = GenerateDSNamespaceDefs_.get('Multi_Temporal_MethodType')1527 if imported_ns_def_ is not None:1528 namespacedef_ = imported_ns_def_1529 if pretty_print:1530 eol_ = '\n'1531 else:1532 eol_ = ''1533 if self.original_tagname_ is not None:1534 name_ = self.original_tagname_1535 showIndent(outfile, level, pretty_print)1536 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))1537 already_processed = set()1538 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Multi_Temporal_MethodType')1539 if self.hasContent_():1540 outfile.write('>%s' % (eol_, ))1541 self.exportChildren(outfile, level + 1, namespace_='', name_='Multi_Temporal_MethodType', pretty_print=pretty_print)1542 showIndent(outfile, level, pretty_print)1543 outfile.write('</%s%s>%s' % (namespace_, name_, eol_))1544 else:1545 outfile.write('/>%s' % (eol_, ))1546 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='Multi_Temporal_MethodType'):1547 pass1548 def exportChildren(self, outfile, level, namespace_='', name_='Multi_Temporal_MethodType', fromsubclass_=False, pretty_print=True):1549 if pretty_print:1550 eol_ = '\n'1551 else:1552 eol_ = ''1553 if self.MT_AOT_Band_Code_D is not None:1554 showIndent(outfile, level, pretty_print)1555 outfile.write('<MT_AOT_Band_Code_D>%s</MT_AOT_Band_Code_D>%s' % (self.gds_format_integer_list(self.MT_AOT_Band_Code_D, input_name='MT_AOT_Band_Code_D'), eol_))1556 if self.MT_AOT_Band_Reflectance_Composite_Dm1 is not None:1557 showIndent(outfile, level, pretty_print)1558 outfile.write('<MT_AOT_Band_Reflectance_Composite_Dm1>%s</MT_AOT_Band_Reflectance_Composite_Dm1>%s' % (self.gds_format_integer_list(self.MT_AOT_Band_Reflectance_Composite_Dm1, input_name='MT_AOT_Band_Reflectance_Composite_Dm1'), eol_))1559 if self.MT_AOT_Band_LUT_Composite_Dm1 is not None:1560 showIndent(outfile, level, pretty_print)1561 outfile.write('<MT_AOT_Band_LUT_Composite_Dm1>%s</MT_AOT_Band_LUT_Composite_Dm1>%s' % (self.gds_format_integer_list(self.MT_AOT_Band_LUT_Composite_Dm1, input_name='MT_AOT_Band_LUT_Composite_Dm1'), eol_))1562 if self.Var_Band_Code_D is not None:1563 showIndent(outfile, level, pretty_print)1564 outfile.write('<Var_Band_Code_D>%s</Var_Band_Code_D>%s' % (self.gds_format_integer(self.Var_Band_Code_D, input_name='Var_Band_Code_D'), eol_))1565 if self.Var_Band_Code_Dm1 is not None:1566 showIndent(outfile, level, pretty_print)1567 outfile.write('<Var_Band_Code_Dm1>%s</Var_Band_Code_Dm1>%s' % (self.gds_format_integer(self.Var_Band_Code_Dm1, input_name='Var_Band_Code_Dm1'), eol_))1568 if self.Relative_Var_Max is not None:1569 showIndent(outfile, level, pretty_print)1570 outfile.write('<Relative_Var_Max>%s</Relative_Var_Max>%s' % (self.gds_format_double(self.Relative_Var_Max, input_name='Relative_Var_Max'), eol_))1571 if self.W_MT_equation2 is not None:1572 showIndent(outfile, level, pretty_print)1573 outfile.write('<W_MT_equation2>%s</W_MT_equation2>%s' % (self.gds_format_double(self.W_MT_equation2, input_name='W_MT_equation2'), eol_))1574 if self.Stdev_Band_Code is not None:1575 showIndent(outfile, level, pretty_print)1576 outfile.write('<Stdev_Band_Code>%s</Stdev_Band_Code>%s' % (self.gds_format_integer(self.Stdev_Band_Code, input_name='Stdev_Band_Code'), eol_))1577 if self.Stdev_Min is not None:1578 showIndent(outfile, level, pretty_print)1579 outfile.write('<Stdev_Min>%s</Stdev_Min>%s' % (self.gds_format_double(self.Stdev_Min, input_name='Stdev_Min'), eol_))1580 if self.Std_Noise is not None:1581 showIndent(outfile, level, pretty_print)1582 outfile.write('<Std_Noise>%s</Std_Noise>%s' % (self.gds_format_double(self.Std_Noise, input_name='Std_Noise'), eol_))1583 if self.AOT_initial_Dm1 is not None:1584 showIndent(outfile, level, pretty_print)1585 outfile.write('<AOT_initial_Dm1>%s</AOT_initial_Dm1>%s' % (self.gds_format_double(self.AOT_initial_Dm1, input_name='AOT_initial_Dm1'), eol_))1586 if self.First_AOT is not None:1587 showIndent(outfile, level, pretty_print)1588 outfile.write('<First_AOT>%s</First_AOT>%s' % (self.gds_format_double(self.First_AOT, input_name='First_AOT'), eol_))1589 if self.Second_AOT is not None:1590 showIndent(outfile, level, pretty_print)1591 outfile.write('<Second_AOT>%s</Second_AOT>%s' % (self.gds_format_double(self.Second_AOT, input_name='Second_AOT'), eol_))1592 if self.TOA_Reflectance_Min is not None:1593 showIndent(outfile, level, pretty_print)1594 outfile.write('<TOA_Reflectance_Min>%s</TOA_Reflectance_Min>%s' % (self.gds_format_double(self.TOA_Reflectance_Min, input_name='TOA_Reflectance_Min'), eol_))1595 if self.TOA_Reflectance_Max is not None:1596 showIndent(outfile, level, pretty_print)1597 outfile.write('<TOA_Reflectance_Max>%s</TOA_Reflectance_Max>%s' % (self.gds_format_double(self.TOA_Reflectance_Max, input_name='TOA_Reflectance_Max'), eol_))1598 if self.TOA_Reflectance_Step is not None:1599 showIndent(outfile, level, pretty_print)1600 outfile.write('<TOA_Reflectance_Step>%s</TOA_Reflectance_Step>%s' % (self.gds_format_double(self.TOA_Reflectance_Step, input_name='TOA_Reflectance_Step'), eol_))1601 if self.Min_Difference_Thresholds_Calculation is not None:1602 showIndent(outfile, level, pretty_print)1603 outfile.write('<Min_Difference_Thresholds_Calculation>%s</Min_Difference_Thresholds_Calculation>%s' % (self.gds_format_double(self.Min_Difference_Thresholds_Calculation, input_name='Min_Difference_Thresholds_Calculation'), eol_))1604 def build(self, node):1605 already_processed = set()1606 self.buildAttributes(node, node.attrib, already_processed)1607 for child in node:1608 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]1609 self.buildChildren(child, node, nodeName_)1610 return self1611 def buildAttributes(self, node, attrs, already_processed):1612 pass1613 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):1614 if nodeName_ == 'MT_AOT_Band_Code_D':1615 MT_AOT_Band_Code_D_ = child_.text1616 MT_AOT_Band_Code_D_ = self.gds_validate_integer_list(MT_AOT_Band_Code_D_, node, 'MT_AOT_Band_Code_D')1617 self.MT_AOT_Band_Code_D = MT_AOT_Band_Code_D_1618 # validate type MT_AOT_Band_Code_DType1619 self.validate_MT_AOT_Band_Code_DType(self.MT_AOT_Band_Code_D)1620 elif nodeName_ == 'MT_AOT_Band_Reflectance_Composite_Dm1':1621 MT_AOT_Band_Reflectance_Composite_Dm1_ = child_.text1622 MT_AOT_Band_Reflectance_Composite_Dm1_ = self.gds_validate_integer_list(MT_AOT_Band_Reflectance_Composite_Dm1_, node, 'MT_AOT_Band_Reflectance_Composite_Dm1')1623 self.MT_AOT_Band_Reflectance_Composite_Dm1 = MT_AOT_Band_Reflectance_Composite_Dm1_1624 # validate type MT_AOT_Band_Reflectance_Composite_Dm1Type1625 self.validate_MT_AOT_Band_Reflectance_Composite_Dm1Type(self.MT_AOT_Band_Reflectance_Composite_Dm1)1626 elif nodeName_ == 'MT_AOT_Band_LUT_Composite_Dm1':1627 MT_AOT_Band_LUT_Composite_Dm1_ = child_.text1628 MT_AOT_Band_LUT_Composite_Dm1_ = self.gds_validate_integer_list(MT_AOT_Band_LUT_Composite_Dm1_, node, 'MT_AOT_Band_LUT_Composite_Dm1')1629 self.MT_AOT_Band_LUT_Composite_Dm1 = MT_AOT_Band_LUT_Composite_Dm1_1630 # validate type MT_AOT_Band_LUT_Composite_Dm1Type1631 self.validate_MT_AOT_Band_LUT_Composite_Dm1Type(self.MT_AOT_Band_LUT_Composite_Dm1)1632 elif nodeName_ == 'Var_Band_Code_D':1633 sval_ = child_.text1634 try:1635 ival_ = int(sval_)1636 except (TypeError, ValueError) as exp:1637 raise_parse_error(child_, 'requires integer: %s' % exp)1638 if ival_ <= 0:1639 raise_parse_error(child_, 'requires positiveInteger')1640 ival_ = self.gds_validate_integer(ival_, node, 'Var_Band_Code_D')1641 self.Var_Band_Code_D = ival_1642 elif nodeName_ == 'Var_Band_Code_Dm1':1643 sval_ = child_.text1644 try:1645 ival_ = int(sval_)1646 except (TypeError, ValueError) as exp:1647 raise_parse_error(child_, 'requires integer: %s' % exp)1648 if ival_ <= 0:1649 raise_parse_error(child_, 'requires positiveInteger')1650 ival_ = self.gds_validate_integer(ival_, node, 'Var_Band_Code_Dm1')1651 self.Var_Band_Code_Dm1 = ival_1652 elif nodeName_ == 'Relative_Var_Max':1653 sval_ = child_.text1654 try:1655 fval_ = float(sval_)1656 except (TypeError, ValueError) as exp:1657 raise_parse_error(child_, 'requires float or double: %s' % exp)1658 fval_ = self.gds_validate_float(fval_, node, 'Relative_Var_Max')1659 self.Relative_Var_Max = fval_1660 elif nodeName_ == 'W_MT_equation2':1661 sval_ = child_.text1662 try:1663 fval_ = float(sval_)1664 except (TypeError, ValueError) as exp:1665 raise_parse_error(child_, 'requires float or double: %s' % exp)1666 fval_ = self.gds_validate_float(fval_, node, 'W_MT_equation2')1667 self.W_MT_equation2 = fval_1668 elif nodeName_ == 'Stdev_Band_Code':1669 sval_ = child_.text1670 try:1671 ival_ = int(sval_)1672 except (TypeError, ValueError) as exp:1673 raise_parse_error(child_, 'requires integer: %s' % exp)1674 if ival_ <= 0:1675 raise_parse_error(child_, 'requires positiveInteger')1676 ival_ = self.gds_validate_integer(ival_, node, 'Stdev_Band_Code')1677 self.Stdev_Band_Code = ival_1678 elif nodeName_ == 'Stdev_Min':1679 sval_ = child_.text1680 try:1681 fval_ = float(sval_)1682 except (TypeError, ValueError) as exp:1683 raise_parse_error(child_, 'requires float or double: %s' % exp)1684 fval_ = self.gds_validate_float(fval_, node, 'Stdev_Min')1685 self.Stdev_Min = fval_1686 elif nodeName_ == 'Std_Noise':1687 sval_ = child_.text1688 try:1689 fval_ = float(sval_)1690 except (TypeError, ValueError) as exp:1691 raise_parse_error(child_, 'requires float or double: %s' % exp)1692 fval_ = self.gds_validate_float(fval_, node, 'Std_Noise')1693 self.Std_Noise = fval_1694 elif nodeName_ == 'AOT_initial_Dm1':1695 sval_ = child_.text1696 try:1697 fval_ = float(sval_)1698 except (TypeError, ValueError) as exp:1699 raise_parse_error(child_, 'requires float or double: %s' % exp)1700 fval_ = self.gds_validate_float(fval_, node, 'AOT_initial_Dm1')1701 self.AOT_initial_Dm1 = fval_1702 elif nodeName_ == 'First_AOT':1703 sval_ = child_.text1704 try:1705 fval_ = float(sval_)1706 except (TypeError, ValueError) as exp:1707 raise_parse_error(child_, 'requires float or double: %s' % exp)1708 fval_ = self.gds_validate_float(fval_, node, 'First_AOT')1709 self.First_AOT = fval_1710 elif nodeName_ == 'Second_AOT':1711 sval_ = child_.text1712 try:1713 fval_ = float(sval_)1714 except (TypeError, ValueError) as exp:1715 raise_parse_error(child_, 'requires float or double: %s' % exp)1716 fval_ = self.gds_validate_float(fval_, node, 'Second_AOT')1717 self.Second_AOT = fval_1718 elif nodeName_ == 'TOA_Reflectance_Min':1719 sval_ = child_.text1720 try:1721 fval_ = float(sval_)1722 except (TypeError, ValueError) as exp:1723 raise_parse_error(child_, 'requires float or double: %s' % exp)1724 fval_ = self.gds_validate_float(fval_, node, 'TOA_Reflectance_Min')1725 self.TOA_Reflectance_Min = fval_1726 elif nodeName_ == 'TOA_Reflectance_Max':1727 sval_ = child_.text1728 try:1729 fval_ = float(sval_)1730 except (TypeError, ValueError) as exp:1731 raise_parse_error(child_, 'requires float or double: %s' % exp)1732 fval_ = self.gds_validate_float(fval_, node, 'TOA_Reflectance_Max')1733 self.TOA_Reflectance_Max = fval_1734 elif nodeName_ == 'TOA_Reflectance_Step':1735 sval_ = child_.text1736 try:1737 fval_ = float(sval_)1738 except (TypeError, ValueError) as exp:1739 raise_parse_error(child_, 'requires float or double: %s' % exp)1740 fval_ = self.gds_validate_float(fval_, node, 'TOA_Reflectance_Step')1741 self.TOA_Reflectance_Step = fval_1742 elif nodeName_ == 'Min_Difference_Thresholds_Calculation':1743 sval_ = child_.text1744 try:1745 fval_ = float(sval_)1746 except (TypeError, ValueError) as exp:1747 raise_parse_error(child_, 'requires float or double: %s' % exp)1748 fval_ = self.gds_validate_float(fval_, node, 'Min_Difference_Thresholds_Calculation')1749 self.Min_Difference_Thresholds_Calculation = fval_1750# end class Multi_Temporal_MethodType1751class Spectro_Temporal_MethodType(GeneratedsSuper):1752 subclass = None1753 superclass = None1754 def __init__(self, A_Coefficient=None, B_Coefficient=None, MT_Weight_Threshold=None):1755 self.original_tagname_ = None1756 self.A_Coefficient = A_Coefficient1757 self.B_Coefficient = B_Coefficient1758 self.MT_Weight_Threshold = MT_Weight_Threshold1759 def factory(*args_, **kwargs_):1760 if CurrentSubclassModule_ is not None:1761 subclass = getSubclassFromModule_(1762 CurrentSubclassModule_, Spectro_Temporal_MethodType)...

Full Screen

Full Screen

SetPoints.py

Source:SetPoints.py Github

copy

Full Screen

...75 try:76 fval_ = float(sval_)77 except (TypeError, ValueError), exp:78 raise_parse_error(child_, 'requires float or double: %s' % exp)79 fval_ = self.gds_validate_float(fval_, node, 'item')80 self.item.append(fval_)81# end class CoolingSetpointScheduleType82class CoolingSetpointDRScheduleType(GeneratedsSuper):83 """The cooling set point schedule for houses that employ demand84 response (DR). The actual schedule for a demand response event85 will combine the non-DR and DR schedules using the penetration86 rate. [degrees F] The value must be a comma-separated list of87 hourly values (24 numbers) or weekday/weekend hourly values (4888 numbers)."""89 subclass = None90 superclass = None91 def __init__(self, item=None):92 if item is None:93 self.item = SuperList()94 else:95 self.item = item96 def factory(*args_, **kwargs_):97 if CoolingSetpointDRScheduleType.subclass:98 return CoolingSetpointDRScheduleType.subclass(*args_, **kwargs_)99 else:100 return CoolingSetpointDRScheduleType(*args_, **kwargs_)101 factory = staticmethod(factory)102 def get_item(self): return self.item103 def set_item(self, item): self.item = item104 def add_item(self, value): self.item.append(value)105 def insert_item(self, index, value): self.item[index] = value106 def export(self, outfile, level, namespace_='', name_='CoolingSetpointDRScheduleType', namespacedef_=''):107 showIndent(outfile, level)108 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))109 already_processed = SuperList()110 self.exportAttributes(outfile, level, already_processed, namespace_, name_='CoolingSetpointDRScheduleType')111 if self.hasContent_():112 outfile.write('>\n')113 self.exportChildren(outfile, level + 1, namespace_, name_)114 showIndent(outfile, level)115 outfile.write('</%s%s>\n' % (namespace_, name_))116 else:117 outfile.write('/>\n')118 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='CoolingSetpointDRScheduleType'):119 pass120 def exportChildren(self, outfile, level, namespace_='', name_='CoolingSetpointDRScheduleType', fromsubclass_=False):121 for _item in self.item:122 showIndent(outfile, level)123 outfile.write('<%sitem>%s</%sitem>\n' % (namespace_, self.gds_format_float(_item, input_name='item'), namespace_))124 def hasContent_(self):125 if (126 self.item127 ):128 return True129 else:130 return False131 def exportLiteral(self, outfile, level, name_='CoolingSetpointDRScheduleType'):132 level += 1133 self.exportLiteralAttributes(outfile, level, [], name_)134 if self.hasContent_():135 self.exportLiteralChildren(outfile, level, name_)136 def exportLiteralAttributes(self, outfile, level, already_processed, name_):137 pass138 def exportLiteralChildren(self, outfile, level, name_):139 showIndent(outfile, level)140 outfile.write('item=[\n')141 level += 1142 for _item in self.item:143 showIndent(outfile, level)144 outfile.write('%f,\n' % _item)145 level -= 1146 showIndent(outfile, level)147 outfile.write('],\n')148 def build(self, node):149 self.buildAttributes(node, node.attrib, [])150 for child in node:151 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]152 self.buildChildren(child, node, nodeName_)153 def buildAttributes(self, node, attrs, already_processed):154 pass155 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):156 if nodeName_ == 'item':157 sval_ = child_.text158 try:159 fval_ = float(sval_)160 except (TypeError, ValueError), exp:161 raise_parse_error(child_, 'requires float or double: %s' % exp)162 fval_ = self.gds_validate_float(fval_, node, 'item')163 self.item.append(fval_)164# end class CoolingSetpointDRScheduleType165class HeatingSetpointScheduleType(GeneratedsSuper):166 """Heating setpoint schedule. [degrees F] The value must be a comma-167 separated list of hourly values (24 numbers) or weekday/weekend168 hourly values (48 numbers)."""169 subclass = None170 superclass = None171 def __init__(self, item=None):172 if item is None:173 self.item = SuperList()174 else:175 self.item = item176 def factory(*args_, **kwargs_):177 if HeatingSetpointScheduleType.subclass:178 return HeatingSetpointScheduleType.subclass(*args_, **kwargs_)179 else:180 return HeatingSetpointScheduleType(*args_, **kwargs_)181 factory = staticmethod(factory)182 def get_item(self): return self.item183 def set_item(self, item): self.item = item184 def add_item(self, value): self.item.append(value)185 def insert_item(self, index, value): self.item[index] = value186 def export(self, outfile, level, namespace_='', name_='HeatingSetpointScheduleType', namespacedef_=''):187 showIndent(outfile, level)188 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))189 already_processed = SuperList()190 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HeatingSetpointScheduleType')191 if self.hasContent_():192 outfile.write('>\n')193 self.exportChildren(outfile, level + 1, namespace_, name_)194 showIndent(outfile, level)195 outfile.write('</%s%s>\n' % (namespace_, name_))196 else:197 outfile.write('/>\n')198 def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='HeatingSetpointScheduleType'):199 pass200 def exportChildren(self, outfile, level, namespace_='', name_='HeatingSetpointScheduleType', fromsubclass_=False):201 for _item in self.item:202 showIndent(outfile, level)203 outfile.write('<%sitem>%s</%sitem>\n' % (namespace_, self.gds_format_float(_item, input_name='item'), namespace_))204 def hasContent_(self):205 if (206 self.item207 ):208 return True209 else:210 return False211 def exportLiteral(self, outfile, level, name_='HeatingSetpointScheduleType'):212 level += 1213 self.exportLiteralAttributes(outfile, level, [], name_)214 if self.hasContent_():215 self.exportLiteralChildren(outfile, level, name_)216 def exportLiteralAttributes(self, outfile, level, already_processed, name_):217 pass218 def exportLiteralChildren(self, outfile, level, name_):219 showIndent(outfile, level)220 outfile.write('item=[\n')221 level += 1222 for _item in self.item:223 showIndent(outfile, level)224 outfile.write('%f,\n' % _item)225 level -= 1226 showIndent(outfile, level)227 outfile.write('],\n')228 def build(self, node):229 self.buildAttributes(node, node.attrib, [])230 for child in node:231 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]232 self.buildChildren(child, node, nodeName_)233 def buildAttributes(self, node, attrs, already_processed):234 pass235 def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):236 if nodeName_ == 'item':237 sval_ = child_.text238 try:239 fval_ = float(sval_)240 except (TypeError, ValueError), exp:241 raise_parse_error(child_, 'requires float or double: %s' % exp)242 fval_ = self.gds_validate_float(fval_, node, 'item')243 self.item.append(fval_)...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run autotest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful