Changeset 895 for trunk/python/asapreader.py
- Timestamp:
- 03/08/06 14:29:58 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapreader.py
r719 r895 1 from asap._asap import s dreader1 from asap._asap import stfiller 2 2 from asap import print_log 3 3 4 class reader(s dreader):4 class reader(stfiller): 5 5 """ 6 6 This class allows the user to import single dish files … … 46 46 from os.path import expandvars 47 47 filename = expandvars(filename) 48 s dreader.__init__(self, filename, theif, thebeam)48 stfiller.__init__(self, filename, theif, thebeam) 49 49 print_log() 50 50 51 def read(self ,integrations=None):51 def read(self): 52 52 """ 53 53 Reads in an returns a specified sequence of integrations. 54 54 If no list is given all integrations a read in. 55 Parameters:56 integrations: a 'range' of integration numbers, e.g.57 range(100) or [0,1,2,3,4,10,11,100]58 If not given (default) all integrations59 are read in60 Example:61 r.read([0,1,2,3,4]) # reads in the first 5 integatrions62 # NOT scans63 r.read(range(100)) # read in the first 100 integrations64 55 """ 65 56 from asap import scantable … … 68 59 integrations = [-1] 69 60 asaplog.push("Reading integrations from disk...") 70 sdreader._read(self,integrations) 71 tbl = sdreader._getdata(self) 72 sdreader._reset(self) # reset to the beginning of the file 61 stfiller._read(self) 62 tbl = stfiller._getdata(self) 73 63 if self.unit is not None: 74 64 tbl.set_fluxunit(self.unit) 75 65 print_log() 76 66 return scantable(tbl) 67 68 def close(self): 69 """ 70 Close the reader. 71 """ 72 self._close() 77 73 78 74 def summary(self, name=None): … … 85 81 r.summary() 86 82 """ 87 sdreader._reset(self) 88 sdreader._read(self,[-1]) 83 stfiller._read(self) 89 84 from asap import scantable 90 tbl = scantable(sdreader._getdata(self)) 91 sdreader._reset(self) 85 tbl = scantable(stfiller._getdata(self)) 92 86 tbl.summary(name) 87 del tbl 93 88 return
Note: See TracChangeset
for help on using the changeset viewer.