- Timestamp:
- 12/26/04 20:48:59 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapmath.py
r143 r150 50 50 return scantable(_quot(source, reference)) 51 51 52 def scale(scan, factor, insitu=False ):52 def scale(scan, factor, insitu=False, all=True): 53 53 """ 54 54 Return a scan where all spectra are scaled by the give 'factor' … … 56 56 scan: a scantable 57 57 factor: the scaling factor 58 Note: 59 This currently applies the all beams/IFs/pols 58 insitu: if False (default) a new scantable is returned. 59 Otherwise, the scaling is done in-situ 60 all: if True (default) apply to all spectra. Otherwise 61 apply only to the selected (beam/pol/if)spectra only 60 62 """ 61 63 if not insitu: 62 64 from asap._asap import scale as _scale 63 return scantable(_scale(scan, factor ))65 return scantable(_scale(scan, factor, all)) 64 66 else: 65 67 from asap._asap import scale_insitu as _scale 66 _scale(scan, factor )68 _scale(scan, factor, all) 67 69 return 68 70 69 71 70 def add(scan, offset ):72 def add(scan, offset, insitu=False, all=True): 71 73 """ 72 Return a scan where the offset is added.74 Return a scan where all spectra have the offset added 73 75 Parameters: 74 76 scan: a scantable 75 offset: the value to add 76 Note: 77 This currently applies the all beams/IFs/pols 77 offset: the offset 78 insitu: if False (default) a new scantable is returned. 79 Otherwise, the addition is done in-situ 80 all: if True (default) apply to all spectra. Otherwise 81 apply only to the selected (beam/pol/if)spectra only 78 82 """ 79 from asap._asap import add as _add 80 return scantable(_add(scan, offset)) 81 82 83 if not insitu: 84 from asap._asap import add as _add 85 return scantable(_add(scan, offset, all)) 86 else: 87 from asap._asap import add_insitu as _add 88 _add(scan, offset, all) 89 return 90 83 91 def bin(scan, binwidth=5): 84 92 """
Note:
See TracChangeset
for help on using the changeset viewer.