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

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

        except ImportError: 

            import _spectralline 

            return _spectralline 

        if fp is not None: 

            try: 

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

            finally: 

                fp.close() 

            return _mod 

    _spectralline = swig_import_helper() 

    del swig_import_helper 

else: 

    import _spectralline 

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

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

    __swig_setmethods__ = {} 

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

    __swig_getmethods__ = {} 

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

    __repr__ = _swig_repr 

    def __init__(self): 

        """__init__(self) -> spectralline""" 

        this = _spectralline.new_spectralline() 

        try: self.this.append(this) 

        except: self.this = this 

    __swig_destroy__ = _spectralline.delete_spectralline 

    __del__ = lambda self : None; 

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

        """ 

        splattotable(self, filenames = std::vector< string >(1, ""), table = string("")) -> spectralline 

 

        Summary 

                Convert a downloaded Splatalogue spectral line list to a casa table. 

 

        Description 

                 

            This method reads a spectral line list(s) downloaded from Splatalogue (www.splatalogue.net) and loads it into a CASA table which 

            can be queried via eg this tool's search function. 

             

            REQUIRMENTS OF THE DOWNLOADED FILES 

             

            The downloaded files must be in a specific format for this method to succeed. The columns are the 

            important things; one can filter the results as one desires using Splatalogue, but the particular columns must be present as described 

            below. The columns which must be present in the downloaded file in this exact order are: 'Species', 'NRAO Recommended', 'Chemical Name', 

            'Freq in GHz', 'Resolved QNs', 'CDMS/JPL Intensity', 'Sij\^2; (D2)', 

            'Log10 (Aij)', 'EL (K)', 'EU (K)', 'Linelist'. In order to get these columns in this order, one should 

            select exactly the following items on the Splatalogue search interface. Under 'Specify Ranges' one should select 'GHz' for the frequency unit. 

            Under 'Line Strength Display' select exactly 'CDMS/JPL Intensity', 

            'Sij u2', and 'Aij'. Under 'Energy Levels', one should select exactly 'Elower (K)' and 'Eupper (K)'. Under 'Miscellaneous', one should 

            select exactly 'Display Ordered Frequency ONLY' and 'Display NRAO Recommended Frequencies'. One should then initiate the search and on 

            the resulting page, one should select the Tab Field Separator and then export the list. The resulting list should be in the proper 

            format for importing into CASA. 

             

            RETURN VALUE 

            This method returns an open spectralline tool which references the new table. The new table can also be opened by  

            a spectralline tool using the open method (eg sl.open(tablename)).  

             

 

        Input Parameters: 

                filenames        Files containing Splatalogue dumps  

                table            Output table name.  

                 

        Example: 

                 

        newsl = sl.splattotable('mysplatlist.txt', 'mynewsl.tbl') 

        # search the new spectral line tool 

        newsl.search([0,1000]) 

             

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

                       

        """ 

        return _spectralline.spectralline_splattotable(self, *args, **kwargs) 

 

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

        """ 

        open(self, table = string("")) -> bool 

 

        Summary 

                Open a spectralline tool using the specified table. 

 

        Description 

                 

            This method opens a CASA Splatalogue spectral line table. The table should have been created with 

            splattotable(), search(), or any other sl method which creates a new CASA spectral line table. If no 

            table name is supplied, the default CASA spectral line table included in the system will be opened.  The 

            opened tool can then be used to query the table via eg the sl.search() method. This method returns true 

            if the table was successfully opened. 

             

 

        Input Parameters: 

                table            CASA table containing Splatalogue data.  

                 

        Example: 

                 

            # open user created spectral line table 

            isopen = sl.open('mysplat.tbl') 

            if (isopen) 

              sl.search([0,1000]) 

               

            # open system default spectral line table 

            isopen = sl.open() 

            if (isopen) 

              sl.search([0,1000]) 

             

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

                       

        """ 

        return _spectralline.spectralline_open(self, *args, **kwargs) 

 

    def close(self): 

        """ 

        close(self) -> bool 

 

        Summary 

                close the spectralline tool 

 

        Description 

                 

            The associated table is closed inside casapy and 

            is no longer available for use. 

             

        Example: 

                 

            sl.close() 

             

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

                       

        """ 

        return _spectralline.spectralline_close(self) 

 

    def done(self): 

        """ 

        done(self) -> bool 

 

        Summary 

                End the spectralline tool 

 

        Description 

                 

            Effectively a synonym for function close. 

             

        Example: 

                 

            sl.done() 

             

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

                       

        """ 

        return _spectralline.spectralline_done(self) 

 

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

        """ 

        search(self, outfile = string(""), freqrange = initialize_vector(1, (double)0),  

            species = initialize_variant(""),  

            reconly = False, chemnames = initialize_variant(""),  

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

            intensity = initialize_vector(1, (double)-1),  

            smu2 = initialize_vector(1, (double)-1),  

            loga = initialize_vector(1, (double)-1), el = initialize_vector(1, (double)-1),  

            eu = initialize_vector(1, (double)-1),  

            rrlinclude = True,  

            rrlonly = False, verbose = True, logfile = string(""),  

            append = False) -> spectralline 

 

        Summary 

                Search a Splatalogue table that has been converted to a casa table 

 

        Description 

                 

            Search the table associated with this tool. The return value is a spectralline tool with a new table containing the search 

            results. This new table can be written to disk by specifying its name in the outfile parameter. If outfile is not specified 

            (ie outfile=''), the resulting table is held in memory and deleted upon a call to close() or done() for the newly created tool 

            or upon exiting casapy. Because Splatalogue does not have values for intensity, smu2, loga, el, and eu 

            for radio recombination lines (rrls), one must specify to include rrls in the specified frequency range in the output. In this case, 

            RRLs will be included ignoring any filters on intensity, smu2, loga, el, and eu. One can also specify to list only RRLs. One can specify 

            to list the search results to the logger via the verbose parameter. If verbose is false, no logger output is listed, although the results 

            can be listed later by running the list() method on the newly created spectral line tool. If verbose=true, one can also specify that 

            the results be listed to a logfile and if this file already exists, one can specify that the results be appended to it or to overwrite 

            it with the results. 

             

 

        Input Parameters: 

                outfile          Results table name. Blank means do not write the table to disk.  

                freqrange        Frequency range in GHz. 0  

                species          Species to search for.  

                reconly          List only NRAO recommended frequencies. false  

                chemnames        Chemical names to search for.  

                qns              Resolved quantum numbers to search for.  

                intensity        CDMS/JPL intensity range. -1 -\& do not use an intensity range. -1  

                smu2             S*mu*mu range in Debye**2. -1 -\& do not use an S*mu*mu range. -1  

                loga             log(A) (Einstein coefficient) range. -1 -\& do not use a loga range. -1  

                el               Lower energy state range in Kelvin. -1 -\& do not use an el range. -1  

                eu               Upper energy state range in Kelvin. -1 -\& do not use an eu range. -1  

                rrlinclude       Include RRLs in the result set? true  

                rrlonly          Include only RRLs in the result set? false  

                verbose          List result set to logger (and optionally logfile)? true  

                logfile          List result set to this logfile (only used if verbose=true).  

                append           If true, append to logfile if it already exists, if false overwrite logfile it it exists. Only used if verbose=true and logfile not blank. false  

                 

        Example: 

                 

            sl.open('myspectrallines.tbl') 

            # do a search postponing listing the results to the logger. 

            slrestool = sl.search(outfile='myresults.tbl', freqrange = [200,300], species=['HOCN', 'HOCO+']) 

            # now list the results 

            slrestool.list() 

            # or one could also do the following after exiting and restarting casapy 

            sl.open('myresults.tbl') 

            sl.list() 

             

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

                       

        """ 

        return _spectralline.spectralline_search(self, *args, **kwargs) 

 

    def list(self): 

        """ 

        list(self) 

 

        Summary 

                List the spectral lines in the associated table to the logger. 

 

        Description 

                 

            List the spectral lines in the associated table to the logger. Note that listing tables containing more than 10,000 spectral lines can take quite a bit of time. 

             

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

                       

        """ 

        return _spectralline.spectralline_list(self) 

 

    def torecord(self): 

        """ 

        torecord(self) -> record 

 

        Summary 

                Return data on the spectral lines in the table as a record. 

 

        Description 

                 

                Return data on the spectral lines in the table as a record. 

             

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

                       

        """ 

        return _spectralline.spectralline_torecord(self) 

 

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

        """ 

        species(self, verbose = False, logfile = string(""), append = False) -> record 

 

        Summary 

                List the unique species in the associated table to the logger. 

 

        Description 

                 

            Return the unique species in the associated table as a list. 

             

 

        Input Parameters: 

                verbose          List result set to logger (and optionally logfile)? false  

                logfile          List result set to this logfile (only used if verbose=true).  

                append           If true, append to logfile if it already exists, if false overwrite logfile it it exists. Only used if show=true and logfile not blank. false  

                 

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

                       

        """ 

        return _spectralline.spectralline_species(self, *args, **kwargs) 

 

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

        """ 

        chemnames(self, verbose = False, logfile = string(""), append = False) -> record 

 

        Summary 

                List the unique chemical names in the associated table to the logger. 

 

        Description 

                 

            Return the unique chemical names in the associated table as a list. 

             

 

        Input Parameters: 

                verbose          List result set to logger (and optionally logfile)? false  

                logfile          List result set to this logfile (only used if verbose=true).  

                append           If true, append to logfile if it already exists, if false overwrite logfile it it exists. Only used if show=true and logfile not blank. false  

                 

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

                       

        """ 

        return _spectralline.spectralline_chemnames(self, *args, **kwargs) 

 

    def nrows(self): 

        """ 

        nrows(self) -> int 

 

        Summary 

                Get the number of rows in the associated spectral line table. 

 

        Description 

                 

            Get the number of rows in the associated spectral line table. 

             

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

                       

        """ 

        return _spectralline.spectralline_nrows(self) 

 

spectralline_swigregister = _spectralline.spectralline_swigregister 

spectralline_swigregister(spectralline) 

 

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