function yyyydoy_2_decyr,yyyydoy ;------------------------------------------------------------------------------ ; ; Purpose: ; Convert date as yyyydoy to decimal year, i.e. 2002.5 ; ; Input: ; yyyydoy...date, e.g. Jan 1, 2001 = 2001001 ; ; Output: ; result.....date as yyyy.yy ; ; This routine will turn 2 digit years into 4 digit years, e.g., 99 = 1999 ; ; Source: Mark Hervig ; ;------------------------------------------------------------------------------ nin = n_elements(yyyydoy) result = fltarr(nin) ;- parse out YYYY & DOY yy = long(yyyydoy / 1000L) doy = long(yyyydoy - yy * 1000L) for i = 0L,nin-1L do begin juldat2,12,31,yy(i),julian,cdate,doy_max result(i) = yy(i) + doy(i) / float(doy_max) endfor ;- trim if (nin eq 1) then result = result(0) ;- done return,result end