PRO longtermfit_lc print,'input yyyy' yr='' read,yr load,'/davis/s2/wang/d2wwg/lcreek/output/rot/lc'+yr+'.rot',rot ;Use is as follows: ; phitheta_fit_wc,plt,yyyy,medfilt,arr,newamin,newomega,co ;where ; | plt = 1 to plot the data and resulting fit to a ; | postscript file: ; | /data/davis/cheas/wcreek/data/rot/rot_son.ps ; | where 'son' is a string described below ; | yyyy = 4-digit year ; input | medfilt = 1 to use median filtered angles for fit ; | 0 to not use median filtered angles for fit ; | son = a string denoting the level and time period ; | for the sonic (e.g., 'son6_5') ; | arr = input array (wcyyyy.rot without header) ; | Format expected is that given by ; ; | newamin = magnitude of fitted sine function ; output | newomega = phase of fitted sine function ; | co = coefficient matrix from polynomial fit ; ; The fitted function is: ;theta_fitted=aminnew*sin(phi-omeganew)+co(3)*phi^3+co(2)*phi^2+co(1)*phi+co(0) phitheta_fit_lc_try,1,yr,1,rot,newamin,newomega,co print,'OK' END