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

# 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('_imagemetadata', [dirname(__file__)]) 

        except ImportError: 

            import _imagemetadata 

            return _imagemetadata 

        if fp is not None: 

            try: 

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

            finally: 

                fp.close() 

            return _mod 

    _imagemetadata = swig_import_helper() 

    del swig_import_helper 

else: 

    import _imagemetadata 

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 imagemetadata(_object): 

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

    __swig_setmethods__ = {} 

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

    __swig_getmethods__ = {} 

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

    __repr__ = _swig_repr 

    def __init__(self): 

        """__init__(self) -> imagemetadata""" 

        this = _imagemetadata.new_imagemetadata() 

        try: self.this.append(this) 

        except: self.this = this 

    __swig_destroy__ = _imagemetadata.delete_imagemetadata 

    __del__ = lambda self : None; 

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

        """ 

        add(self, key = string(""), value = initialize_variant("")) -> bool 

 

        Summary 

                Add a key-value pair if possible. 

 

        Description 

                 

                Add a key-value pair if possible. 

             

 

        Input Parameters: 

                key              The name of the FITS or other keyword.  

                value            Associated value to add.  

                 

        Example: 

                 

        imd.open('myim.im') 

        # add a keyword 'test' with value 'first' 

        if add('test', 'first'): 

            print 'test=first has been added' 

        else: 

            print 'Unable to add key test' 

        imd.done() 

             

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

                       

        """ 

        return _imagemetadata.imagemetadata_add(self, *args, **kwargs) 

 

    def close(self): 

        """ 

        close(self) -> bool 

 

        Summary 

                Close the image metadata tool. Synonym for done(). 

 

        Description 

                 

 

        This function closes the image metadata tool.  This means that it detaches the 

        tool from its underlying metadata object. Methods cannot be run on it until it 

        is opened with another or the same image. 

 

 

        Example: 

                 

 

        imd.open('myim.im') 

        # do stuff 

        imd.close() 

 

 

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

                       

        """ 

        return _imagemetadata.imagemetadata_close(self) 

 

    def done(self): 

        """ 

        done(self) -> bool 

 

        Summary 

                Close the image metadata tool. Synonym for close(). 

 

        Description 

                 

 

        This function closes the image metadata tool.  This means that it detaches the 

        tool from its underlying metadata object. Methods cannot be run on it until it 

        is opened with another or the same image. 

 

             

        Example: 

                 

 

        imd.open('myim.im') 

        # do stuff 

        imd.done() 

 

             

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

                       

        """ 

        return _imagemetadata.imagemetadata_done(self) 

 

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

        """ 

        get(self, key = string("")) -> variant 

 

        Summary 

                Get the value associated with the specified, case-insensitive FITS keyword. 

 

        Description 

                 

                Get the value associated with the specified, case-insensitive FITS keyword. 

             

 

        Input Parameters: 

                key              The name of the FITS or other keyword.  

                 

        Example: 

                 

        imd.open('myim.im') 

        imtype = imd.get('imtype') 

        imd.done() 

             

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

                       

        """ 

        return _imagemetadata.imagemetadata_get(self, *args, **kwargs) 

 

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

        """ 

        list(self, verbose = True) -> record 

 

        Summary 

                Get a dictionary of FITS-like header items. 

 

        Description 

                 

                Get a listing of traditional FITS-like 'header' items. 

             

 

        Input Parameters: 

                verbose          If true, print listing to logger True  

                 

        Example: 

                 

        imd.open('myim.im') 

        mylist = imd.list(False) 

        imd.done() 

        crval1 = mylist{'crval1'} 

             

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

                       

        """ 

        return _imagemetadata.imagemetadata_list(self, *args, **kwargs) 

 

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

        """ 

        open(self, infile) -> bool 

 

        Summary 

                Open this image metadata tool providing access to an image's metadata. 

 

        Description 

                 

 

        This method creates access to the specified image's metadata. 

 

             

 

        Input Parameters: 

                infile           Image name. The image can be in any \casa\ supported format.  

                 

        Example: 

                 

 

        immd.open('myim.im') 

        # do stuff with the tool and then close it. 

        immd.done() 

 

             

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

                       

        """ 

        return _imagemetadata.imagemetadata_open(self, *args, **kwargs) 

 

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

        """ 

        remove(self, key = string(""), value = initialize_variant("")) -> bool 

 

        Summary 

                Remove or clear the value of a keyword if possible. 

 

        Description 

                 

                Remove or clear the value of a keyword if possible. If key='masks', a value specifying the mask 

                to remove may be specified. If no value is specified, all masks are removed. 

             

 

        Input Parameters: 

                key              The name of the FITS or other keyword.  

                value            Value to remove if the key is multi-valued. Only used in the case of key='masks'.  

                 

        Example: 

                 

        imd.open('myim.im') 

        # clear the brightness unit 

        if imd.remove('bunit'): 

            print 'bunit has been cleared' 

        else: 

            print 'Unable to clear bunit' 

        imd.done() 

             

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

                       

        """ 

        return _imagemetadata.imagemetadata_remove(self, *args, **kwargs) 

 

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

        """ 

        set(self, key = string(""), value = initialize_variant("")) -> bool 

 

        Summary 

                Set a keyword to the specified value if possible. 

 

        Description 

                 

                Set a key-value pair if possible. 

             

 

        Input Parameters: 

                key              The name of the FITS or other keyword.  

                value            Associated value to set.  

                 

        Example: 

                 

             

            Note that when setting the reference value of a polarizaiton axis, one must 

            provide an array of stokes/polarization strings (['I', 'Q', 'XX']) that is the 

            same length as the stokes axis. If the stokes axis is degenerate, one can alternatively 

            provide a string indicating the stokes value. 

             

        imd.open('myim.im') 

        # Set keyword 'telescope' with value 'Argus Array' 

        if imd.set('telescope', 'Argus Array'): 

            print 'telescope has been updated' 

        else: 

            print 'Unable to update telescope.' 

        imd.done() 

 

        # set polarizations for an image with three pixels on the stokes axis crval3 

        imd.open('myim.im') 

        if imd.set('crval3', [XY, LL, 'Q']): 

            print 'polarization values have been updated' 

        else: 

            print 'Unable to update polarization values.' 

        imd.done() 

 

             

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

                       

        """ 

        return _imagemetadata.imagemetadata_set(self, *args, **kwargs) 

 

imagemetadata_swigregister = _imagemetadata.imagemetadata_swigregister 

imagemetadata_swigregister(imagemetadata) 

 

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