Changeset 1697
- Timestamp:
- 02/11/10 11:46:14 (15 years ago)
- Location:
- trunk/python
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/__init__.py
r1691 r1697 450 450 get_elevation - get the elevation of the scans 451 451 get_parangle - get the parallactic angle of the scans 452 get_coordinate - get the spectral coordinate for the given row, 453 which can be used for coordinate conversions 452 454 get_unit - get the current unit 453 455 set_unit - set the abcissa unit to be used from this … … 581 583 plot - plot a scantable 582 584 plot_lines - plot a linecatalog overlay 585 plotazel - plot azimuth and elevation versus time 586 plotpointing - plot telescope pointings 583 587 save - save the plot to a file ('png' ,'ps' or 'eps') 584 588 set_mode - set the state of the plotter, i.e. … … 632 636 mask_not - boolean operations on masks created with 633 637 scantable.create_mask 638 skydip - gain opacity values from a sky dip observation 634 639 635 640 Note: -
trunk/python/coordinate.py
r1600 r1697 2 2 3 3 class coordinate(_coordinate): 4 """Representation of the spectral lcoordinate of the data (frequency axis).4 """Representation of the spectral coordinate of the data (frequency axis). 5 5 """ 6 6 def to_frequency(self, pixel, unit='Hz'): -
trunk/python/lagflagger.py
r1585 r1697 1 1 from asap import scantable 2 from pylab import *2 from matplotlib.pylab import * 3 3 from numpy import array, ma, logical_not 4 4 from numpy.fft import fft, ifft … … 25 25 self.fftaxes.cla() 26 26 self.resultaxes.cla() 27 27 28 28 29 29 def flag(self): … … 57 57 inp = raw_input("Commit flags (c), keep (k) or ignore(i)? ")\ 58 58 .lower() 59 if inp.startswith("c") 59 if inp.startswith("c"): 60 60 self.flags.append([flagstart, flagend]) 61 61 self._scan.set_spectrum(yi.real, i) -
trunk/python/scantable.py
r1691 r1697 1 import os 1 2 try: 2 3 from functools import wraps as wraps_dec … … 22 23 return val 23 24 return wrap 25 26 27 def is_scantable(filename): 28 return (os.path.isdir(filename) 29 and not os.path.exists(filename+'/table.f1') 30 and os.path.exists(filename+'/table.info')) 24 31 25 32 … … 59 66 Scantable.__init__(self, filename) 60 67 else: 61 if isinstance(filename, str):# or \ 62 # (isinstance(filename, list) or isinstance(filename, tuple)) \ 63 # and isinstance(filename[-1], str): 64 import os.path 68 if isinstance(filename, str): 65 69 filename = os.path.expandvars(filename) 66 70 filename = os.path.expanduser(filename) … … 69 73 if rcParams['verbose']: 70 74 asaplog.push(s) 71 #print asaplog.pop().strip()72 75 return 73 76 raise IOError(s) 74 if os.path.isdir(filename) \ 75 and not os.path.exists(filename+'/table.f1'): 76 # crude check if asap table 77 if os.path.exists(filename+'/table.info'): 78 ondisk = rcParams['scantable.storage'] == 'disk' 79 Scantable.__init__(self, filename, ondisk) 80 if unit is not None: 81 self.set_fluxunit(unit) 82 self.set_freqframe(rcParams['scantable.freqframe']) 83 else: 84 msg = "The given file '%s'is not a valid " \ 85 "asap table." % (filename) 86 if rcParams['verbose']: 87 print msg 88 return 89 else: 90 raise IOError(msg) 77 if is_scantable(filename): 78 ondisk = rcParams['scantable.storage'] == 'disk' 79 Scantable.__init__(self, filename, ondisk) 80 if unit is not None: 81 self.set_fluxunit(unit) 82 self.set_freqframe(rcParams['scantable.freqframe']) 91 83 else: 92 84 self._fill([filename], unit, average) … … 260 252 filename: the name of a file to write the putput to 261 253 Default - no file output 262 verbose: print extra info such as the frequency table263 The default (False) is taken from .asaprc264 254 """ 265 255 info = Scantable._summary(self, True) … … 347 337 are only applied to thi selection. 348 338 Parameters: 349 selection: a selector object (default unset the selection) 339 selection: a selector object (default unset the selection), 340 341 or 342 343 any combination of 344 "pols", "ifs", "beams", "scans", "cycles", "name", "query" 345 350 346 Examples: 351 347 sel = selector() # create a selection object 352 348 self.set_scans([0, 3]) # select SCANNO 0 and 3 353 349 scan.set_selection(sel) # set the selection 350 scan.summary() # will only print summary of scanno 0 an 3 351 scan.set_selection() # unset the selection 352 # or the equivalent 353 scan.set_selection(scans=[0,3]) 354 354 scan.summary() # will only print summary of scanno 0 an 3 355 355 scan.set_selection() # unset the selection
Note:
See TracChangeset
for help on using the changeset viewer.