Changeset 1633 for branches/alma/python
- Timestamp:
- 09/16/09 17:11:16 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alma/python/asapmath.py
r1631 r1633 850 850 return s 851 851 852 ## def apexcal( scantab, calmode ):853 ##"""854 ## Calibrate APEXdata.852 def calibrate( scantab, scannos=[], calmode='none', verify=None ): 853 """ 854 Calibrate data. 855 855 856 ## Parameters: 857 ## scantab: scantable 858 ## calmode: calibration mode 859 ## """ 860 ## from asap._asap import stmath 861 ## stm = stmath() 862 ## if ( calmode == 'ps' ): 863 ## asaplog.push( 'APEX position-switch calibration' ) 864 ## print_log() 865 ## elif ( calmode == 'fs' ): 866 ## asaplog.push( 'APEX frequency-switch calibration' ) 867 ## print_log() 868 ## elif ( calmode == 'wob' ): 869 ## asaplog.push( 'APEX wobbler-switch calibration' ) 870 ## print_log() 871 ## elif ( calmode == 'otf' ): 872 ## asaplog.push( 'APEX On-The-Fly calibration' ) 873 ## print_log() 874 ## else: 875 ## asaplog.push( '%s: unknown calibration mode' % calmode ) 876 ## print_log('ERROR') 856 Parameters: 857 scantab: scantable 858 scannos: list of scan number 859 calmode: calibration mode 860 verify: verify calibration 861 """ 862 print 'param: %s, %s, %s' %(scannos, calmode, verify) 863 antname = scantab.get_antennaname() 864 if ( calmode == 'nod' ): 865 asaplog.push( 'Calibrating nod data.' ) 866 print_log() 867 scal = calnod( scantab, scannos=scannos, verify=verify ) 868 elif ( calmode == 'quotient' ): 869 asaplog.push( 'Calibrating using quotient.' ) 870 print_log() 871 scal = scantab.auto_quotient( verify=verify ) 872 elif ( calmode == 'ps' ): 873 asaplog.push( 'Calibrating %s position-switched data.' % antname ) 874 print_log() 875 if ( antname.find( 'APEX' ) != -1 or antname.find( 'ALMA' ) != -1 ): 876 scal = almacal( scantab, scannos, calmode, verify ) 877 else: 878 scal = calps( scantab, scannos=scannos, verify=verify ) 879 elif ( calmode == 'fs' or calmode == 'fsotf' ): 880 asaplog.push( 'Calibrating %s frequency-switched data.' % antname ) 881 print_log() 882 if ( antname.find( 'APEX' ) != -1 or antname.find( 'ALMA' ) != -1 ): 883 scal = almacal( scantab, scannos, calmode, verify ) 884 else: 885 scal = calfs( scantab, scannos=scannos, verify=verify ) 886 elif ( calmode == 'otf' ): 887 asaplog.push( 'Calibrating %s On-The-Fly data.' % antname ) 888 print_log() 889 scal = almacal( scantab, scannos, calmode, verify ) 890 else: 891 asaplog.push( 'No calibration.' ) 892 scal = scantab.copy() 893 894 return scal 895 896 def almacal( scantab, scannos=[], calmode='none', verify=False ): 897 """ 898 Calibrate APEX and ALMA data 899 900 Parameters: 901 scantab: scantable 902 scannos: list of scan number 903 calmode: calibration mode 904 verify: verify calibration 905 """ 906 from asap._asap import stmath 907 stm = stmath() 908 antname = scantab.get_antennaname() 909 ssub = scantab.get_scan( scannos ) 910 scal = scantable( stm.cwcal( ssub, calmode, antname ) ) 911 return scal
Note:
See TracChangeset
for help on using the changeset viewer.