Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

260

261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

285

286

287

288

289

290

291

292

293

294

295

296

297

298

299

300

301

302

303

304

305

306

307

308

309

310

311

312

313

314

315

316

317

318

319

320

321

322

323

324

325

326

327

328

329

330

331

332

333

334

335

336

337

338

339

340

341

342

343

344

345

346

347

348

349

350

351

352

353

354

355

356

357

358

359

360

361

362

363

364

365

366

367

368

369

370

371

372

373

374

375

376

377

378

379

380

381

382

383

384

385

386

387

388

389

390

391

392

393

394

395

396

397

398

399

400

401

402

403

404

405

406

407

408

409

410

411

412

413

414

415

416

417

418

419

420

421

422

423

424

425

426

427

428

429

430

431

432

433

434

435

436

437

438

439

440

441

442

443

444

445

446

447

448

449

450

451

452

453

454

455

456

457

458

459

460

461

462

463

464

465

466

467

468

469

470

471

472

473

474

475

476

477

478

479

480

481

482

483

484

485

486

487

488

489

490

491

492

493

494

495

496

497

498

499

500

501

502

503

504

505

506

507

508

509

510

511

512

513

514

515

516

517

518

519

520

521

522

523

524

525

526

527

528

529

530

531

532

533

534

535

536

537

538

539

540

541

542

543

544

545

546

547

548

549

550

551

552

553

554

555

556

557

558

559

560

561

562

563

564

565

566

567

568

569

570

571

572

573

574

575

576

577

578

579

580

581

582

583

584

585

586

587

588

589

590

591

592

593

594

595

596

597

598

599

600

601

602

603

604

605

606

607

608

609

610

611

612

613

614

615

616

617

618

619

620

621

622

623

624

625

626

627

628

629

630

631

632

633

634

635

636

637

638

639

640

641

642

643

644

645

646

647

648

649

650

651

652

653

654

655

656

657

658

659

660

661

662

663

664

665

666

667

668

669

670

671

672

673

674

675

676

677

678

679

680

681

682

683

684

685

686

687

688

689

690

691

692

693

694

695

696

697

698

699

700

701

702

703

704

705

706

707

708

709

710

711

712

713

714

715

716

717

718

719

720

721

722

723

724

725

726

727

728

729

730

731

732

733

734

735

736

737

738

739

740

741

742

743

744

745

746

747

748

749

750

751

752

753

754

755

756

757

758

759

760

761

762

763

764

765

766

767

768

769

770

771

772

773

774

775

776

777

778

779

780

781

782

783

784

785

786

787

788

789

790

791

792

793

794

795

796

797

798

799

800

801

802

803

804

805

806

807

808

809

810

811

812

813

814

815

816

817

818

819

820

821

822

823

824

825

826

827

828

829

830

831

832

833

834

835

836

837

838

839

840

841

842

843

844

845

846

847

848

849

850

851

852

853

854

855

856

857

858

859

860

861

862

863

864

865

866

867

868

869

870

871

872

873

874

875

876

877

878

879

880

881

882

883

884

885

886

887

888

889

890

891

892

893

894

895

896

897

898

899

900

901

902

903

904

905

906

907

908

909

910

911

912

913

914

915

916

917

918

919

920

921

922

923

924

925

926

927

928

929

930

931

932

933

934

935

936

937

938

939

940

941

942

943

944

945

946

947

948

949

950

951

952

953

954

955

956

957

958

959

960

961

962

963

964

965

966

967

968

969

970

971

972

973

974

975

976

977

978

979

980

981

982

983

984

985

986

987

988

989

990

991

992

993

994

995

996

997

998

999

1000

1001

1002

1003

1004

1005

1006

1007

1008

1009

1010

1011

1012

1013

1014

1015

1016

1017

1018

1019

1020

1021

1022

1023

1024

1025

1026

1027

1028

1029

1030

1031

1032

1033

1034

1035

1036

1037

1038

1039

1040

1041

1042

1043

1044

1045

1046

1047

1048

1049

1050

1051

1052

1053

1054

1055

1056

1057

1058

1059

1060

1061

1062

1063

1064

1065

1066

1067

1068

1069

1070

1071

1072

1073

1074

1075

1076

1077

1078

1079

1080

1081

1082

1083

1084

1085

1086

1087

1088

1089

1090

1091

1092

1093

1094

1095

1096

1097

1098

1099

1100

1101

1102

1103

1104

1105

1106

1107

1108

1109

1110

1111

1112

1113

1114

1115

1116

1117

1118

1119

1120

1121

1122

1123

1124

1125

1126

1127

1128

1129

1130

1131

1132

1133

1134

1135

1136

1137

1138

1139

1140

1141

1142

1143

1144

1145

1146

1147

1148

1149

1150

1151

1152

1153

1154

1155

1156

1157

1158

1159

1160

1161

1162

1163

1164

1165

1166

1167

1168

1169

1170

1171

1172

1173

1174

1175

1176

1177

1178

1179

1180

1181

1182

1183

1184

1185

1186

1187

1188

1189

1190

1191

1192

1193

1194

1195

1196

1197

1198

1199

1200

1201

1202

1203

1204

1205

1206

1207

1208

1209

1210

1211

1212

1213

1214

1215

1216

1217

1218

1219

1220

1221

1222

1223

1224

1225

1226

# This file was automatically generated by SWIG (http://www.swig.org). 

# Version 2.0.4 

# 

# Do not make changes to this file unless you know what you are doing--modify 

# the SWIG interface file instead. 

 

 

 

from sys import version_info 

if version_info >= (2,6,0): 

    def swig_import_helper(): 

        from os.path import dirname 

        import imp 

        fp = None 

        try: 

            fp, pathname, description = imp.find_module('_deconvolver', [dirname(__file__)]) 

        except ImportError: 

            import _deconvolver 

            return _deconvolver 

        if fp is not None: 

            try: 

                _mod = imp.load_module('_deconvolver', fp, pathname, description) 

            finally: 

                fp.close() 

            return _mod 

    _deconvolver = swig_import_helper() 

    del swig_import_helper 

else: 

    import _deconvolver 

del version_info 

try: 

    _swig_property = property 

except NameError: 

    pass # Python < 2.2 doesn't have 'property'. 

def _swig_setattr_nondynamic(self,class_type,name,value,static=1): 

    if (name == "thisown"): return self.this.own(value) 

    if (name == "this"): 

        if type(value).__name__ == 'SwigPyObject': 

            self.__dict__[name] = value 

            return 

    method = class_type.__swig_setmethods__.get(name,None) 

    if method: return method(self,value) 

    if (not static): 

        self.__dict__[name] = value 

    else: 

        raise AttributeError("You cannot add attributes to %s" % self) 

 

def _swig_setattr(self,class_type,name,value): 

    return _swig_setattr_nondynamic(self,class_type,name,value,0) 

 

def _swig_getattr(self,class_type,name): 

    if (name == "thisown"): return self.this.own() 

    method = class_type.__swig_getmethods__.get(name,None) 

    if method: return method(self) 

    raise AttributeError(name) 

 

def _swig_repr(self): 

    try: strthis = "proxy of " + self.this.__repr__() 

    except: strthis = "" 

    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) 

 

try: 

    _object = object 

    _newclass = 1 

except AttributeError: 

    class _object : pass 

    _newclass = 0 

 

 

class deconvolver(_object): 

    """Proxy of C++ casac::deconvolver class""" 

    __swig_setmethods__ = {} 

    __setattr__ = lambda self, name, value: _swig_setattr(self, deconvolver, name, value) 

    __swig_getmethods__ = {} 

    __getattr__ = lambda self, name: _swig_getattr(self, deconvolver, name) 

    __repr__ = _swig_repr 

    def __init__(self): 

        """__init__(self) -> deconvolver""" 

        this = _deconvolver.new_deconvolver() 

        try: self.this.append(this) 

        except: self.this = this 

    __swig_destroy__ = _deconvolver.delete_deconvolver 

    __del__ = lambda self : None; 

    def open(self, *args, **kwargs): 

        """ 

        open(self, dirty = string(""), psf = string(""), warn = True) -> bool 

 

        Summary 

                Open a new dirty image and PSF 

 

        Description 

                 

        Close the current images and open a new dirty image and PSF 

        instead. The current state of { t deconvolver} is retained, except for 

        the data selection. 

 

 

        Input Parameters: 

                dirty            Dirty image to be processed  

                psf              point spread function to be processed  

                warn             Produce warning messages if psf is not provided true  

                 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_open(self, *args, **kwargs) 

 

    def reopen(self): 

        """ 

        reopen(self) -> bool 

 

        Summary 

                Reopen the dirty image and PSF 

 

        Description 

                 

        Close and reopen the current dirty and PSF images, and make 

        new convolvers and cleaners.  The main benefit of this method 

        is to flush the residual image and replace it with the dirty image. 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_reopen(self) 

 

    def close(self): 

        """ 

        close(self) -> bool 

 

        Summary 

                Close the deconvolver tool 

 

        Description 

                 

        This is used to close { t deconvolver} tools. Note that the 

        data is written to disk. The {  t deconvolver} process keeps running 

        until a done tool function call is performed. 

 

        Example: 

                 

 

        dc.open('3C273XC1.dirty', '3C273XC1.psf')       

        dc.clean(model='3C273XC1.clean'); 

        dc.close() 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_close(self) 

 

    def done(self): 

        """ 

        done(self) -> bool 

 

        Summary 

                Terminate the deconvolver process 

 

        Description 

                 

        This is used to totally stop the {      t deconvolver} process. It is a good idea 

        to conserve memory use on your machine by stopping the process once 

        you no longer need it. 

 

        Example: 

                 

 

        dc.open('3C273XC1.dirty', '3C273XC1.psf')       

        dc.clean(model='3C273XC1.clean'); 

        dc.close() 

        dc.done() 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_done(self) 

 

    def summary(self): 

        """ 

        summary(self) -> bool 

 

        Summary 

                Summarize the current state 

 

        Description 

                 

        Writes a summary of the properties of the deconvolver to the 

        default logger. This includes: 

        egin{itemize} 

        \item The names of the dirty image and PSF (set in construction or via the 

        open function. 

        \item The current beam fit 

        nd{itemize} 

 

        Example: 

                 

 

        dc.open('3C273XC1.dirty', '3C273XC1.psf')       

        dc.summary() 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_summary(self) 

 

    def boxmask(self, *args, **kwargs): 

        """ 

        boxmask(self, mask = string(""), blc = initialize_vector(1, (int)-1),  

            trc = initialize_vector(1, (int)-1), fillvalue = initialize_variant("1.0Jy"),  

            outsidevalue = initialize_variant("0.0Jy")) -> bool 

 

        Summary 

                Construct a mask from blc, trc 

 

        Description 

                 

        A mask image is an image with the same shape as the other images but 

        with values between 0.0 and 1.0 as a pixel value. Mask images are used in 

        deconvolver to control the region selected in a deconvolution.  

 

        In the Clark CLEAN, the mask image can usefully have any value between 

        0.0 and 1.0. Intermediate value discourage but do not rule out 

        selection of clean components in that region. This is accomplished by 

        multiplying the residual image by the mask prior to entering the minor 

        cycle. Note that if you do use a mask for the Clark or Hogbom Clean, 

        it must cover only a quarter of the image. boxmask does not enforce 

        this requirement. 

 

 

 

        Input Parameters: 

                mask             name of mask image  

                blc              Bottom left corner -1  

                trc              Top right corner -1  

                fillvalue        Value to fill in 1.0Jy  

                outsidevalue     outside value 0.0Jy  

                 

        Example: 

                 

 

        dc.boxmask(mask='bigmask', blc=[56,45,1,1], trc=[87,93,4,1]) 

        dc.clean(mask='bigmask', model='3C273XC1.clean.masked', niter=1000) 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_boxmask(self, *args, **kwargs) 

 

    def regionmask(self, *args, **kwargs): 

        """ 

        regionmask(self, mask = string(""), region = initialize_record(""),  

            boxes = initialize_variant(""), value = 1.0) -> bool 

 

        Summary 

                Construct a mask image from a region 

 

        Description 

                 

        A mask image is an image with the same shape as the other images but 

        with values between 0.0 and 1.0 as a pixel value. Mask images are used in 

        imager to control the region selected in a deconvolution.  

 

        In  Clark CLEAN, the mask image can usefully have any value between 

        0.0 and 1.0. Intermediate value is discouraged but do not rule out 

        selection of clean components in that region. This is accomplished by 

        multiplying the residual image by the mask prior to entering the minor 

        cycle. Note that if you do use a mask for the Clark or Hogbom Clean, 

        it must cover only a quarter of the image. {    t regionmask} does not enforce 

        this requirement.  

 

        The function regionmask also allows multiple regions to be used. A record of the regions can be made as in the example below.  

 

        Regions can be made in many different ways using the 

        regionmanager functions. An example 

        using wbox function is given 

        below. The default regionmanager tool 'rg' can be used for cases the user want to have flexibility in manipulating regions. The {       t region} parameter takes a record that comes from the regionmanager output. 

        The parameter boxes allow the user to sent in a list of 4 elements numbers representing blc's and trc's  

 

        If both the parameters, {       t regions} and {        t boxes} are used the a union is done with the two sets of region thus defined. 

 

 

 

          

 

 

 

        Input Parameters: 

                mask             name of mask image  

                region           Region record usually from regionmanager unset  

                boxes            list of 4 elements lists e.g [[xblc1, yblc1, xtrc1, ytrc1], [[xblc2, yblc2, xtrc2, ytrc2]]  

                value            Value to set the mask to 1.0  

                 

        Example: 

                 

 

 

        Makes a mask  then cleans using it. 

 

        dc.open(dirty.image', 'psf.image') 

        a=[100.0, 100.0, 200, 200.0] 

        b=[50, 50, 80, 80] 

        dc.regionmask(mask='bigmask', boxes[a,b]) 

        dc.clean(algorithm='hogbom', mask='bigmask', model='model.clean.masked', niter=1000) 

 

        Another example using rg.wbox function:  

        ia.open('dirty') 

        cs:=ia.coordsys() 

        rg.setcoordinates(cs.record()) 

        r1:=dg.wbox(blc=['173pix', '347pix'], trc=['183pix', '370pix']) 

        c.regionmask(mask='bigmask',region=r1) 

 

        Or using a dict of regions: 

 

        r2=rg.wbox(blc=['180pix', '344pix'], trc=['191pix', '369pix']) 

        r3=rg.wbox(blc=['189pix', '341pix'], trc=['204pix', '364pix']) 

        regs={'reg1'':r1, 'reg2':r2, 'reg3':r3} 

        rec=rg.makeunion(regs) 

        dc.regionmask(mask='bigmask',region=rec) 

 

        If quantities are to be used to define regions the following is a an example 

 

        dc.regionmask(mask='joetest',boxes=['15:23:32.902','+05.19.32.089','15:22:28.631','+05.28.52.474']) 

 

 

 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_regionmask(self, *args, **kwargs) 

 

    def clipimage(self, *args, **kwargs): 

        """ 

        clipimage(self, clippedimage = string(""), inputimage = string(""),  

            threshold = initialize_variant("0.0Jy")) -> bool 

 

        Summary 

                Zero all pixels where Stokes I is below 

        a threshold 

 

        Description 

                 

        All pixels in the image with Stokes I less than some threshold 

        are set to zero. This is useful prior to self-calibration where one  

        oftens wishes to remove negative pixels from the model. Note that 

        if the image has polarization information, then the polarized 

        part of a pixel is also set to zero if Stokes I is less than the 

        threshold. 

 

 

        Input Parameters: 

                clippedimage     name of clipped image  

                inputimage       name of input image  

                threshold        Threshold 0.0Jy  

                 

        Example: 

                 

 

        dc.clipimage(image='clean', threshold='50mJy') 

        ###the ft that model into an MS and do gaincal for e.g 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_clipimage(self, *args, **kwargs) 

 

    def clarkclean(self, *args, **kwargs): 

        """ 

        clarkclean(self, niter = 1000, gain = 0.1, threshold = initialize_variant("0Jy"),  

            displayprogress = False, model = string(""),  

            mask = string(""), histbins = 500,  

            psfpatchsize = initialize_vector(2,(int)51, (int)51),  

            maxextpsf = 0.2, speedup = 0.0,  

            maxnumpix = 10000, maxnummajcycles = -1, maxnumminoriter = -1) -> bool 

 

        Summary 

                Make a clean image using the Clark Clean 

        a threshold 

 

        Description 

                 

 

        In the Clark Clean algorithm, the cleaning is split into minor and major 

        cycles. In the minor cycles only the brightest points are cleaned, 

        using a subset of the point spread function.  In the major cycle, the 

        points thus found are subtracted correctly by using an FFT-based 

        convolution. 

 

 

        Input Parameters: 

                niter            Number of iterations 1000  

                gain             Loop Gain for CLEANing 0.1  

                threshold        Flux level at which to stop CLEANing 0Jy  

                displayprogress  Display the progress of the cleaning? false  

                model            Name of images  

                mask             Name of mask images used for CLEANing  

                histbins         Number of bins in the pixel-flux histogram 500  

                psfpatchsize     Size of PSF for minor cycle 51 51  

                maxextpsf        maximum external sidelobe, used to set depth of minor cycle clean 0.2  

                speedup          Cleaning speedup exponent 0.0  

                maxnumpix        Maximum number of pixels used in each minor cycle 10000  

                maxnummajcycles  Max number of major cycles; -1 = no restrictions -1  

                maxnumminoriter  Max number of minor iterations; -1 = no restrictions -1  

                 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_clarkclean(self, *args, **kwargs) 

 

    def fullclarkclean(self, *args, **kwargs): 

        """ 

        fullclarkclean(self, niter = 1000, gain = 0.1, threshold = initialize_variant("0Jy"),  

            model = string(""), mask = string(""),  

            cyclefactor = 1.5) -> record 

 

        Summary 

                Make a clean image using the Clark Clean 

        a threshold 

 

        Description 

                 

 

        This is similar to clarkclean except that it accepts casa standard images. I.e it has to have 4 axes with the canonical order of 

        (direction1, direction2, stokes, spectral).  

        This function further will clean more than the quarter of the image if the mask coverage is larger than a quarter of the image size. 

        It is useful for CLI level parallelization, i.e use imager to make a dirty image and psf and use this function to deconvolve.  

        If in doubt use  

        clarkclean 

          

 

 

        Input Parameters: 

                niter            Number of iterations 1000  

                gain             Loop Gain for CLEANing 0.1  

                threshold        Flux level at which to stop CLEANing 0Jy  

                model            Name of model image that will contain the clean components  

                mask             Name of mask image used for CLEANing  

                cyclefactor      Factor to determine how deep to go in a Clark minor cycle 1.5  

                 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_fullclarkclean(self, *args, **kwargs) 

 

    def dirtyname(self): 

        """ 

        dirtyname(self) -> string 

 

        Summary 

                Return the name of the dirty-image table 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_dirtyname(self) 

 

    def psfname(self): 

        """ 

        psfname(self) -> string 

 

        Summary 

                Return the name of the PSF-image table 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_psfname(self) 

 

    def make(self, *args, **kwargs): 

        """ 

        make(self, image = string(""), async = False) -> bool 

 

        Summary 

                Make an empty image 

 

        Description 

                 

        Make an empty image with the properties (co-ordinate system etc.) 

        borrowed from the dirty image. 

 

 

        Input Parameters: 

                image            Name of the new image on the disk  

                async            Run asynchronously in the background? false  

                 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_make(self, *args, **kwargs) 

 

    def convolve(self, *args, **kwargs): 

        """ 

        convolve(self, convolvemodel = string(""), model = string("")) -> bool 

 

        Summary 

                Convolves an image with the PSF 

 

        Description 

                 

        Convolves an image (e.g., the model image) with the PSF 

 

 

        Input Parameters: 

                convolvemodel    Name of the output image on the disk to hold the result of the convolution  

                model            The input image to be convolved with the PSF  

                 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_convolve(self, *args, **kwargs) 

 

    def makegaussian(self, *args, **kwargs): 

        """ 

        makegaussian(self, gaussianimage = string(""), bmaj = initialize_variant("0rad"),  

            bmin = initialize_variant("0rad"),  

            bpa = initialize_variant("0deg"), normalize = True,  

            async = False) -> bool 

 

        Summary 

                Make an image with a single gaussian 

        component 

 

        Description 

                 

        Make a model image with the a single gaussian.  The 

        properties of the output image (e.g. the co-ordinate system, etc.) are 

        borrowed from the dirty image. 

 

        The image is made as follows: 

 

           I(x,y)= Delta function of unit amplitude at (0,0) 

 

           Temp(x,y) = Gaussian(x,y,Amplitude, Center, Sigma, PA) 

 

           I(x,y) = Convovlution of Temp(x,y) with I(x,y). 

 

        If {    t normalize=T} I(x,y) = I(x,y)/(area under the gaussian). 

 

 

 

        Input Parameters: 

                gaussianimage    Name of the output image on the disk  

                bmaj             The major axis of the gaussian 0rad  

                bmin             The minor axis of the gaussian 0rad  

                bpa              The Position Angle of the gaussian 0deg  

                normalize        Normalize the area under the gaussian to 1.0? true  

                async            Run asynchronously in the background? false  

                 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_makegaussian(self, *args, **kwargs) 

 

    def state(self): 

        """ 

        state(self) -> bool 

 

        Summary 

                Return the ``state'' of the tool 

 

        Description 

                 

        Prints the name of the Dirty Image and the PSF and the parameters of 

        the gaussian fitted to the main lobe of the PSF (the ``Clean Beam''). 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_state(self) 

 

    def updatestate(self, *args, **kwargs): 

        """ 

        updatestate(self, f = string(""), method = string("INIT")) -> bool 

 

        Summary 

                [A GUI builders related function]Update the GUI to reflect the currect state 

 

        Description 

                 

        Updates the GUI to reflect the currect state of the tool.  This 

        function is used by toolmanager.  See documentation of the toolmanager 

        for details about ``methods'' used to update the GUI. 

 

 

        Input Parameters: 

                f                Glish variable for the GUI to be updated  

                method           The method to be used for updating DONE close INIT  

                 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_updatestate(self, *args, **kwargs) 

 

    def clean(self, *args, **kwargs): 

        """ 

        clean(self, algorithm = string("hogbom"), niter = 1000, gain = 0.1,  

            threshold = initialize_variant("0Jy"), displayprogress = False,  

            model = string(""), mask = string(""),  

            async = False) -> record 

 

        Summary 

                Make a clean image with Hogbom or MultiScale Clean 

 

        Description 

                 

             

            Makes a clean image using either the Hogbom or MultiScale 

            algorithms. The MultiScale algorithm is the default. The clean is 

            performed on the residual image calculated from the dirty image minus 

            the point spread function convolved with the model currently selected. 

            Thus if you want to restart a clean, simply set the model to the model 

            that was previously produced by clean. 

             

            Rather than explicit CLEAN boxes, mask images are used to constrain 

            the region that is to be deconvolved. To make mask images, 

            use either boxmask (to define a mask 

            via the corner locations blc and trc) or  

            mask (to define a mask via 

            thresholding an existing image). The default mask is the inner quarter 

            of the image. 

             

            The CLEAN deconvolution is joint in whatever Stokes parameters are 

            present. Thus it searchs for peaks in either $I$ or $I+|V|$ or 

            $I+\sqrt{Q^2+U^2+V^2}$, the rationale for the latter two forms being 

            to be biased towards finding strongly polarized pixels first (these 

            forms are also the maximum eigenvalue of the coherency matrix).  The 

            PSF is constrained to be the same in all polarizations (a feature of 

            this implementation, not of the Hamaker-Bregman-Sault formalism). 

             

            The clean algorithms possible are: 

            egin{description} 

            \item[Hogbom] The classic algorithm: delta function units of emission 

            are found iteratively by searching for the peak. Each point is 

            subtracted from the full residual image using the shifted and scaled 

            point spread function. 

             

            \item[Multi-Scale] As the Multi-Scale Clean algorithm is quite new, 

            we provide entensive information on its use. 

             

            In the Multi-scale Clean, the image is cleaned simultaneously with 

            several different beams given by the point spread function convolved 

            with components of various shapes and sizes.  The components we use in 

            this implementation are upside-down paraboloids multiplied by first 

            order spheroidal functions (ie, the same functions used in gridding 

            Fourier plane data).  The paraboloids are truncated at zero, and the 

            multiplication by the spheroidal function results in a smooth shape 

            with minimal power at long baselines.  This shape is scaled to the 

            component sizes specified in 

            setscales.  As these 

            functions have finite extent (unlike a Gaussian), they can easily be 

            used with mask images. 

             

            For each iteration, the scale size which is able to subtract the most 

            flux is chosen (but with a caveat, see below).  The model is then 

            built up out of the spheroidal functions of the various scale 

            sizes. The scale sizes are set by the 

            setscales function, which 

            will permit the user to specify the scale sizes explicitly, or will 

            optionally take the number of scale sizes to clean for and calculate 

            the scale sizes themselves from a power law. 

             

            Most images deconvolved with Multi-scale Clean will be dominated by 

            extended structure, and the largest scale size will initially remove 

            the most flux from the dirty image.  As the algorithm reduces the 

            residuals on the largest scale, the residuals on the smaller scales 

            will also be reduced, even without cleaning on those size scales (a 

            falling sea sinks all boats).  However, at some point, the residual 

            image will be dominated by features on smaller size scales.  These 

            smaller features will be both positive and negative (ie, to correct 

            for the largest size scale being the wrong shape for the true emission 

            features).  Later in the algorithm, the magnitude of the residuals on 

            all scales will be approximately equal.  At this stage, most of the 

            deconvolvable flux has been assimilated into the largest scale size 

            components and detailed corrections to the large scale components must 

            be made.  At this point, the user may consider switching to a faster 

            algorithm such as the Clark Clean. 

             

            Masking is fully available with Multi-scale Clean.  No component is 

            permitted to place any of its wings outside of the user-supplied 

            mask.  If the masking were based upon the different scale components' 

            center positions, then the large scale components could place their 

            wings outside the mask, but the smaller scale components would 

            not be able to make fine scale corrections.  Hence, the 

            Multi-scale Clean uses a different mask for each different size 

            scale internally.  If the mask is too restrictive or the scales 

            are too large, the algorithm may not be able to fit the large 

            scales into the mask at all, and the user is warned of this 

            condition. 

             

            Traditional Clean algorithms use a small loop gain such as 0.1 to 

            avoid confusing emission and sidelobes when extended emission is 

            present.  However, as MultiScale Clean can image large extended 

            structure in a single spheroidal component, a loop gain in the range 

            0.5 to 1.0 can be used.  If the largest residual oscillates between 

            positive and negative with iteration number, as it can for some 

            brightness distributions which include point sources, a lower loop 

            gain will improve the imaging and the convergence. 

             

            A mild bias favoring cleaning small scale emission has been built into 

            the Multi-scale algorithm.  To illustrate the requirement of this bias, 

            consider the case of a bright point source with very faint extended 

            emission.  Each scale may find its optimal component to subtract at 

            the position of the bright point source, but each successively larger 

            component will integrate more extended flux.  Hence, the largeest 

            scale component will be removed from the residuals.  If most of the 

            flux were in the point source, then several smaller negative 

            components must be subtracted from the largest component, and finally 

            the point component itself may be removed after the extended emission 

            has been taken care of.  To prevent this situation from occurring, 

            we bias the selection of small-sized components. 

             

            nd{description} 

             

            Note that for all of these functions except fullmsclean, only a 

            quarter of the image may be cleaned. If no mask is set, then the 

            cleaned region defaults to the inner quarter. If a mask larger than a 

            quarter of the image is set, then only the quarter starting at the 

            bottom left corner is used. Algorithm fullmsclean will deconvolve the 

            entire field. This is useful when performing a limited accuracy  

            deconvolution (as needed for example in wide-field imaging) but will 

            diverge if pushed too deep. 

             

            The clean threshold may be either absolute ('0.5Jy') or relative 

            ('1\%'). 

             

           

 

        Input Parameters: 

                algorithm        Algorithm to use fullmsclean msclean hogbom  

                niter            Number of Iterations, set to zero for no CLEANing 1000  

                gain             Loop Gain for CLEANing, try 0.7 for msclean or fullmsclean 0.1  

                threshold        Flux level at which to stop CLEANing 0Jy  

                displayprogress  Display progress false  

                model            Name of images  

                mask             Name of mask images used for CLEANing  

                async            Run asynchronously in the background? false  

                 

        Example: 

                 

             

            dc.clean(image='3C273XC1.clean.image', model='3C273XC1.clean.model', 

            mask='3C283XC1.mask', niter=1000, gain=0.25, threshold=0.03) 

 

           

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_clean(self, *args, **kwargs) 

 

    def setscales(self, *args, **kwargs): 

        """ 

        setscales(self, scalemethod = string("nscales"), nscales = 5, uservector = initialize_vector(3,(double)0.0, (double)3.0, (double)10.0)) -> bool 

 

        Summary 

                Set the scale sizes for MultiScale Clean 

 

        Description 

                 

        Set the scale sizes, all required PSF's and Dirty Images for 

        MultiScale Clean will be calculated. 

        You can either give the number of scales, in which case the the scale 

        sizes are set via a power law, or give a vector of scale sizes in pixels. 

 

 

        Input Parameters: 

                scalemethod      Method by which scales are set uservector nscales  

                nscales          Number of scales 5  

                uservector       Vector of scale sizes to use 0.0 3.0 10.0  

                 

        Example: 

                 

 

        dc.setscales(6); 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_setscales(self, *args, **kwargs) 

 

    def ft(self, *args, **kwargs): 

        """ 

        ft(self, model = string(""), transform = string(""), async = False) -> bool 

 

        Summary 

                Fourier transform the specified model 

 

        Description 

                 

        Fourier transform the specified model to an image. 

 

 

        Input Parameters: 

                model            Name of image  

                transform        Name of transform image  

                async            Run asynchronously in the background? false  

                 

        Example: 

                 

 

        deco.ft(model='3C273XC1.nnls.model', transform='3C273XC1.nnls.model.ft') 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_ft(self, *args, **kwargs) 

 

    def restore(self, *args, **kwargs): 

        """ 

        restore(self, model = string(""), image = string(""), bmaj = initialize_variant("0rad"),  

            bmin = initialize_variant("0rad"),  

            bpa = initialize_variant("0deg"),  

            async = False) -> bool 

 

        Summary 

                Restore the residuals 

 

        Description 

                 

        Restore the residuals to a smoothed version of the model. The model 

        images are convolved with the specified Gaussian beam and then the 

        residual images are added.  If the beam is not supplied, one will 

        be fit to the PSF. 

 

 

        Input Parameters: 

                model            Name of input model  

                image            Name of output restored image  

                bmaj             Major axis of beam 0rad  

                bmin             Minor axis of beam 0rad  

                bpa              0deg Position angle of beam  

                async            Run asynchronously in the background false  

                 

        Example: 

                 

 

        deco.restore(model='3C273XC1.clean', image='3C273XC1.clean.restored', 

        bmaj='2.0arcsec', bmin='2.0arcsec') 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_restore(self, *args, **kwargs) 

 

    def residual(self, *args, **kwargs): 

        """ 

        residual(self, model = string(""), image = string(""), async = False) -> bool 

 

        Summary 

                Find the residuals 

 

        Description 

                 

        Calculate the residuals corresponding to the model. 

        componentlist.  

 

 

        Input Parameters: 

                model            Names of input models  

                image            Names of output residual images  

                async            Run asynchronously in the background false  

                 

        Example: 

                 

 

        deco.residual(model='3C273XC1.clean', complist='3C273XC1.cl', 

        image='3C273XC1.clean.residual') 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_residual(self, *args, **kwargs) 

 

    def smooth(self, *args, **kwargs): 

        """ 

        smooth(self, model = string(""), image = string(""), bmaj = initialize_variant("0rad"),  

            bmin = initialize_variant("0rad"),  

            bpa = initialize_variant("0deg"),  

            normalize = True, async = False) -> bool 

 

        Summary 

                smooth the image 

 

        Description 

                 

        The model image is convolved with the specified Gaussian beam.  By 

        default (normalize=T), the beam volume is normalized to unity so that 

        the smoothing is flux preserving. The smoothing used in restoration is 

        not normalized. 

 

 

        Input Parameters: 

                model            Name of input model  

                image            Name of output smoothed image  

                bmaj             Major axis of beam 0rad  

                bmin             Minor axis of beam 0rad  

                bpa              Position angle of beam 0deg  

                normalize        Normalize volume of psf to unity true  

                async            Run asynchronously in the background false  

                 

        Example: 

                 

 

        - deco.smooth(model='3C273XC1.clean', image='3C273XC1.clean.restored', 

        bmaj='2.0arcsec', bmin='2.0arcsec') 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_smooth(self, *args, **kwargs) 

 

    def mem(self, *args, **kwargs): 

        """ 

        mem(self, entropy = string("entropy"), niter = 20, sigma = initialize_variant("0.001Jy"),  

            targetflux = initialize_variant("1.0Jy"),  

            constrainflux = False,  

            displayprogress = False, model = string(""),  

            prior = string(""), mask = string(""), imageplane = False,  

            async = False) -> bool 

 

        Summary 

                Make the mem image 

 

        Description 

                 

        Makes a mem image using the Cornwell-Evans algroithm, using either 

        maximum entropy (entropy) or maxmimum emptiness (emptiness).  The 

        maximum entropy algorithm is the default.  You can restart a MEM 

        deconvolution on an existing model image, but the alpha and beta 

        parameters are not yet saved. 

 

        Mask images can be used to restrict where the algorithm puts flux.  A 

        prior, or bias, image can provide a priori information to the 

        algorithm and effectively limit the support as well as a mask.  The 

        prior image can be constructed by smoothing an existing estimate for 

        the brightness distribution and clipping.  Any pixel values below 1e-6 

        will be clipped to this level, so zero or negative pixels will not 

        cause problems. 

 

        Currently, only one Stokes parameter may be deconvolved at a time. 

        Stokes $I$ images can be deconvolved with either maximum entropy  

        or maxmimum emptiness.  Stokes $Q$, $U$, or $V$ should be deconvolved 

        with maxmimum emptiness, which permits negative pixel values. 

        Joint polarization MEM deconvolution is planned for the future. 

 

        The mem entropies possible are: 

        egin{description} 

        \item[entropy]  The smoothness of the image, relative to some 

        prior (also called default or bias) image is maximized.   

        The functional form of the entropy is $H = \sum I ln (I/M)$, 

        where $I$ is the mem image brightness and $M$ is the prior image. 

        As the prior image is positive definite, the entropy constrains the mem  

        image pixels to be positive, hence only stokes $I$ can be imaged. 

        \item[emptiness] The number of pixels with absolute value of the flux 

        greater than the noise level is minimized.  This treats positive 

        and negative pixel values equally, so it is appropriate for any 

        Stokes image. 

        nd{description} 

 

        This MEM algorithm works in the image plane (ie, is ignorant of 

        visibility data), but performs the convolution by multiplication in 

        the Fourier plane.  Not to be confused with this usage of the term 

        'image plane', some problems are 'image plane' problems, such as a 

        single dish performing On-The-Fly mapping.  Independent noise is added 

        at each integration as the beam sweeps over the object (ie, in the 

        image plane).  This can lead to a noise signal at non-physically large 

        spatial frequencies.  This non-physical signal can be removed by 

        convolving the residual image with the PSF.  Also key to this problem 

        is that the PSF is of finite extent, permitting the deconvolution of 

        nearly the entire dirty image rather than just the inner quarter. 

        These options are accessed by setting { t imageplane} to T. 

 

 

 

        Input Parameters: 

                entropy          entropy to use emptiness entropy  

                niter            Number of Iterations, set to zero for no MEMing 20  

                sigma            Noise level to try to achieve 0.001Jy  

                targetflux       Total image flux to try to achieve 1.0Jy  

                constrainflux    Use targetflux as a constraint? (or starting flux) false  

                displayprogress  Display progress false  

                model            Name of input/output model image  

                prior            Name of prior (default) image used for mem  

                mask             Mask image restricting emission (all pixels 0 or 1)  

                imageplane       Is this an image plane problem (like single dish)? false  

                async            Run asynchronously in the background? false  

                 

        Example: 

                 

 

        deco.mem(entropy='entropy', niter=30, sigma=0.01, targetflux=10.0, 

        model='3C273XC1.mem.image', prior='3C283XC1.prior') 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_mem(self, *args, **kwargs) 

 

    def makeprior(self, *args, **kwargs): 

        """ 

        makeprior(self, prior = string(""), templateimage = string(""), lowclipfrom = initialize_variant("0.0Jy"),  

            lowclipto = initialize_variant("0.0Jy"),  

            highclipfrom = initialize_variant("9e20Jy"),  

            highclipto = initialize_variant("9e20Jy"),  

            blc = initialize_vector(1, (int)-1),  

            trc = initialize_vector(1, (int)-1),  

            async = False) -> bool 

 

        Summary 

                Make the mem's prior image, or make a mask 

 

        Description 

                 

        Makes a prior image for the mem function.  A general way to make a 

        prior image is to start with a low resolution image, obtained 

        from a smaller array configuration or a lower frequency observation, 

        from another image which has been smoothed, or from a single dish 

        image.  The low resolution image can then be doctored via clipping 

        and regioning to make it acceptable for the mem function. 

 

        Currently, only one Stokes parameter may be used at a time. 

 

 

 

        Input Parameters: 

                prior            output prior image  

                templateimage    starting point for prior image  

                lowclipfrom      Clip any pixel below this level 0.0Jy  

                lowclipto        Any clipped pixel will be given this value 0.0Jy  

                highclipfrom     Clip any pixel above this level 9e20Jy  

                highclipto       Any clipped pixel will be given this value 9e20Jy  

                blc              Bottom left hand corner for box; outside box is clipped -1  

                trc              Top right hand corner for box; outside box is clipped -1  

                async            Run asynchronously in the background? false  

                 

        Example: 

                 

 

        deco.makeprior(prior='3C283XC1.prior', templateimage='3C283XC1.mem.smooth', 

        clipfrom='0.01Jy', clipto='0.0001Jy', blc=[100,100], trc=[150,150]) 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_makeprior(self, *args, **kwargs) 

 

    def mtopen(self, *args, **kwargs): 

        """ 

        mtopen(self, ntaylor = 2, scalevector = initialize_vector(3,(double)0.0, (double)3.0, (double)10.0),  

            psfs = std::vector< string >(1, ""),  

            async = False) -> bool 

 

        Summary 

                Init : Make a series of images using a Multi-Term Clean algorithm 

 

        Description 

                 

             

            Makes a series of images. 

 

            For N terms in the polynomial, supply a list of 2N-1 Hessian elements (psfs), and the 

            scale sizes. 

             

           

 

        Input Parameters: 

                ntaylor          Number of terms in the taylor polynomial 2  

                scalevector      Vector of scale sizes to use 0.0 3.0 10.0  

                psfs             Intpu : List of names of 2N-1 psfs. This is valid only for a Taylor-polynomial model.  

                async            Run asynchronously in the background? false  

                 

        Example: 

                 

 

         xxx     

 

           

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_mtopen(self, *args, **kwargs) 

 

    def mtclean(self, *args, **kwargs): 

        """ 

        mtclean(self, residuals = std::vector< string >(1, ""), models = std::vector< string >(1, ""),  

            niter = 1000, gain = 0.1,  

            threshold = initialize_variant("0Jy"),  

            displayprogress = False, mask = string(""),  

            async = False) -> record 

 

        Summary 

                Make a series of images using a Multi-Term Clean algorithm 

 

        Description 

                 

             

            Makes a series of images. 

 

            Supply a list of N residual images and a corresponding list of 2N-1 Hessian elements (psfs). 

             

            This way, for each field or partial-run, one can choose how many terms to operate with,  

            changing this number depending on the signal-to-noise level.  

          

           

 

        Input Parameters: 

                residuals        Input : List of names of N residual images  

                models           Output : List of names of N model images  

                niter            Number of Iterations, set to zero for no CLEANing 1000  

                gain             Loop Gain for CLEANing, try 0.7 for msclean or fullmsclean 0.1  

                threshold        Flux level at which to stop CLEANing 0Jy  

                displayprogress  Display progress false  

                mask             Name of mask images used for CLEANing  

                async            Run asynchronously in the background? false  

                 

        Example: 

                 

 

         xxx     

 

           

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_mtclean(self, *args, **kwargs) 

 

    def mtrestore(self, *args, **kwargs): 

        """ 

        mtrestore(self, models = std::vector< string >(1, ""), residuals = std::vector< string >(1, ""),  

            images = std::vector< string >(1, ""),  

            bmaj = initialize_variant("0rad"),  

            bmin = initialize_variant("0rad"),  

            bpa = initialize_variant("0deg"), async = False) -> bool 

 

        Summary 

                Restore the Multi-Term residuals 

 

        Description 

                 

 

        The model images are smoothed by the specified Gaussian beam. 

        The principal solution is computed from the residuals. 

        The smoothed models are added to these new residuals.  

 

        This ensures that any undeconvolved source flux has been transformed 

        into the Taylor-coefficient basis, before being added into the smoothed 

        Taylor-coefficient model images. 

 

        ( If the beam is not supplied, one will be fit to the PSF ).  

 

 

        Input Parameters: 

                models           Input : Name of input model  

                residuals        Input : Name of residual image  

                images           Output : Name of output restored image  

                bmaj             Major axis of beam 0rad  

                bmin             Minor axis of beam 0rad  

                bpa              0deg Position angle of beam  

                async            Run asynchronously in the background false  

                 

        Example: 

                 

 

        deco.restore(model='3C273XC1.clean', image='3C273XC1.clean.restored', 

        bmaj='2.0arcsec', bmin='2.0arcsec') 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_mtrestore(self, *args, **kwargs) 

 

    def mtcalcpowerlaw(self, *args, **kwargs): 

        """ 

        mtcalcpowerlaw(self, images = std::vector< string >(1, ""), residuals = std::vector< string >(1, ""),  

            alphaname = string(""),  

            betaname = string(""), threshold = initialize_variant("0.0Jy"),  

            calcerror = False,  

            async = False) -> bool 

 

        Summary 

                Interpret Taylor coefficients as a power law, and compute spectral index 

 

        Description 

                 

 

        Take ratios of restored images to compute alpha and beta 

 

 

 

        Input Parameters: 

                images           Input : Names of input restored images  

                residuals        Input : Names of input residuals images ( for error calcs )  

                alphaname        Output : Name of output spectral-index image  

                betaname         Output : Name of output spectral-curvature image  

                threshold        Threshold 0.0Jy  

                calcerror        Calculate an error image for spectral index false  

                async            Run asynchronously in the background false  

                 

        Example: 

                 

 

        deco.restore(model='3C273XC1.clean', image='3C273XC1.clean.restored', 

        bmaj='2.0arcsec', bmin='2.0arcsec') 

 

 

        -------------------------------------------------------------------------------- 

                       

        """ 

        return _deconvolver.deconvolver_mtcalcpowerlaw(self, *args, **kwargs) 

 

deconvolver_swigregister = _deconvolver.deconvolver_swigregister 

deconvolver_swigregister(deconvolver) 

 

# This file is compatible with both classic and new-style classes.