Commits
427 427 | |
428 428 | def checkreffreq(self,imname,theval=0): |
429 429 | testname = inspect.stack()[2][3] |
430 430 | |
431 431 | retres=True |
432 432 | |
433 433 | _ia.open(imname) |
434 434 | csys = _ia.coordsys() |
435 435 | _ia.close() |
436 436 | reffreq = csys.referencevalue()['numeric'][3] |
437 - | csys.close() |
437 + | csys.done() |
438 438 | if abs(reffreq - theval)/theval > self.epsilon : |
439 439 | retres=False |
440 440 | else: |
441 441 | retres=True |
442 442 | |
443 443 | pstr = "[" + testname + "] Ref-Freq is " + str(reffreq) + " ("+self.verdict(retres)+" : should be " + str(theval) + ")" |
444 444 | |
445 445 | print(pstr) |
446 446 | pstr=pstr+"\n" |
447 447 | return pstr |
487 487 | print(pstr) |
488 488 | pstr=pstr+"\n" |
489 489 | #self.checkfinal(pstr) |
490 490 | return pstr |
491 491 | |
492 492 | def getcoordsys(self,imname): |
493 493 | try: |
494 494 | _ia.open(imname) |
495 495 | csys = _ia.coordsys() |
496 496 | csys_rec = csys.torecord() |
497 - | csys.close() |
497 + | csys.done() |
498 498 | finally: |
499 499 | _ia.close() |
500 500 | |
501 501 | return csys_rec |
502 502 | |
503 503 | def check_keywords(self, imlist): |
504 504 | """ |
505 505 | Keyword related checks (presence/absence of records and entries in these records, |
506 506 | in the keywords of the image table). |
507 507 | |