;+ ; NAME: ; CCG_MEANS ; ; PURPOSE: ; Calculate annual, monthly, or ; daily averages. Return arrays ; of averages, number and standard ; deviation. ; ; CATEGORY: ; Miscellaneous. ; ; CALLING SEQUENCE: ; CCG_MEANS, xarr=xarr,yarr=yarr,year=1,xres,yres,sd,n ; CCG_MEANS, xarr=xarr,yarr=yarr,month=1,xres,yres,sd,n ; CCG_MEANS, xarr=xarr,yarr=yarr,day=1,xres,yres,sd,n ; ; INPUTS: ; xarr: Decimal date array. ; yarr: Corresponding values. ; ; OPTIONAL INPUT PARAMETERS: ; year: If non-zero calculate annual averages. ; month: If non-zero calculate monthly averages. ; day: If non-zero calculate daily averages. ; ; OUTPUTS: ; xres: Decimal date array for annual, monthly, or ; daily averages. Interval is centered, i.e., ; 1985.5. ; ; yres: Corresponding averages array. ; ; sd: Array of standard deviations of the ; the calculated averages. ; ; n: Number of individual values used in ; determining average. ; ; COMMON BLOCKS: ; None. ; ; SIDE EFFECTS: ; None. ; ; RESTRICTIONS: ; None. ; ; PROCEDURE: ; CCG_MEANS may be called from the IDL command line or ; from an IDL procedure. ; Example: ; CCG_FREAD, $ ; file='/projects/ch4/in-situ/mlo_data/year/mlo93.ch4',nc=6,var ; ; ; CCG_DATE2DEC, $ ; yr=var(1,*),mo=var(2,*),dy=var(3,*),hr=var(4,*),dec=dec ; ; ; CCG_MEANS, $ ; xarr=dec,yarr=var(5,*),month=1,xres,yres,sd,n ; . ; . ; . ; ; ; MODIFICATION HISTORY: ; ; Written, KAM, March 1994. ;-