471 - | SdbaselineMethods.execute(self.datacolumn, self.bloutput, self.maskmode, self.chans, self.thresh, self.avg_limit, self.minwidth, |
472 - | self.edge, self.blfunc, self.order, self.npiece, self.applyfft, self.fftthresh, self.addwn, self.rejwn, self.blparam, |
473 - | self.clipniter, self.clipthresh, image_stack, ms_stack, self.image_shape) |
471 + | SdbaselineMethods.execute(self.datacolumn, self.bloutput, self.maskmode, self.chans, self.thresh, self.avg_limit, |
472 + | self.minwidth, self.edge, self.blfunc, self.order, self.npiece, self.applyfft, |
473 + | self.fftthresh, self.addwn, self.rejwn, self.blparam, self.clipniter, self.clipthresh, |
474 + | image_stack, ms_stack, self.image_shape) |
482 - | SdbaselineMethods.execute(self.datacolumn, self.bloutput, self.maskmode, self.chans, self.thresh, self.avg_limit, self.minwidth, |
483 - | self.edge, self.blfunc, self.order, self.npiece, self.applyfft, self.fftthresh, self.addwn, self.rejwn, self.blparam, |
484 - | self.clipniter, self.clipthresh, image_stack, ms_stack, self.image_shape) |
483 + | SdbaselineMethods.execute(self.datacolumn, self.bloutput, self.maskmode, self.chans, self.thresh, self.avg_limit, |
484 + | self.minwidth, self.edge, self.blfunc, self.order, self.npiece, self.applyfft, |
485 + | self.fftthresh, self.addwn, self.rejwn, self.blparam, self.clipniter, self.clipthresh, |
486 + | image_stack, ms_stack, self.image_shape) |
491 - | SdbaselineMethods.execute(self.datacolumn, self.bloutput, self.maskmode, self.chans, self.thresh, self.avg_limit, self.minwidth, |
492 - | self.edge, self.blfunc, self.order, self.npiece, self.applyfft, self.fftthresh, self.addwn, self.rejwn, self.blparam, |
493 - | self.clipniter, self.clipthresh, image_stack, ms_stack, self.image_shape) |
493 + | SdbaselineMethods.execute(self.datacolumn, self.bloutput, self.maskmode, self.chans, self.thresh, self.avg_limit, |
494 + | self.minwidth, self.edge, self.blfunc, self.order, self.npiece, self.applyfft, |
495 + | self.fftthresh, self.addwn, self.rejwn, self.blparam, self.clipniter, self.clipthresh, |
496 + | image_stack, ms_stack, self.image_shape) |
514 + | testdata_01 = ("testdata_01.im", 1.5, [64, 64, 4, 128]) |
515 + | testdata_02 = ("testdata_02.im", 2.0, [64, 64, 4, 128]) |
516 + | testdata_03 = ("testdata_03.im", 2.5, [64, 64, 4, 128]) |
517 + | testdata_err = ("testdata_err.im", 1, [65, 64, 4, 128]) |
523 + | self.create_image(self.testdata_01[0], self.testdata_01[1], self.testdata_01[2]) |
524 + | self.create_image(self.testdata_02[0], self.testdata_02[1], self.testdata_02[2]) |
525 + | self.create_image(self.testdata_03[0], self.testdata_03[1], self.testdata_03[2]) |
526 + | self.create_image(self.testdata_err[0], self.testdata_err[1], self.testdata_err[2]) |
527 + | |
528 + | def create_image(self, datapath, val=1, shape=[0, 0, 0, 0]): |
529 + | _ia = image() |
530 + | ary = _ia.makearray(v=val, shape=shape) |
531 + | _ia.fromarray(outfile=datapath, pixels=ary, overwrite=True) |
532 + | _ia.done() |
549 + | @test_base.exception_case(ValueError, 'operands could not be broadcast together with shapes') |
550 + | def test_7_3(self): |
551 + | image_stack = CasaImageStack(top=UnerasableFolder(self.testdata_01[0])) |
552 + | image_stack.push(EraseableFolder(self.testdata_02[0])) |
553 + | image_stack.push(EraseableFolder(self.testdata_err[0])) |
554 + | output = "output_7_3.im" |
555 + | ImageSubtractionMethods.execute(output, image_stack) |
556 + | |
557 + | def test_7_4(self): |
558 + | image_stack = CasaImageStack(top=UnerasableFolder(self.testdata_01[0])) |
559 + | image_stack.push(EraseableFolder(self.testdata_err[0])) |
560 + | output = "output_7_4.im" |
561 + | ImageSubtractionMethods.execute(output, image_stack) |
562 + | self.assertTrue(os.path.exists(output)) |
563 + | self.assertFalse(os.path.exists(self.testdata_err[0])) |
564 + | |
565 + | def test_7_5(self): |
566 + | image_stack = CasaImageStack(top=UnerasableFolder(self.testdata_01[0])) |
567 + | image_stack.push(EraseableFolder(self.testdata_02[0])) |
568 + | image_stack.push(EraseableFolder(self.testdata_03[0])) |
569 + | output = "output_7_5.im" |
570 + | ImageSubtractionMethods.execute(output, image_stack) |
571 + | with tool_manager(output, image) as ia: |
572 + | arr = ia.getchunk() |
573 + | self.assertTrue(np.array_equal(arr, np.full((64, 64, 4, 128), 2.0))) |
574 + | |
575 + | def test_7_6(self): |
576 + | image_stack = CasaImageStack(top=UnerasableFolder(self.testdata_01[0])) |
577 + | image_stack.push(EraseableFolder(self.testdata_02[0])) |
578 + | output = "output_7_6.im" |
579 + | ImageSubtractionMethods.execute(output, image_stack) |
580 + | with tool_manager(output, image) as ia: |
581 + | arr = ia.getchunk() |
582 + | self.assertTrue(np.array_equal(arr, np.full((64, 64, 4, 128), 2.0))) |
583 + | |