;+ ; NAME: G_DDATE ; ; PURPOSE: ; To get the dates and times of the (dark) images that have been ; stored by either of the two procedures JULIAN or JS_STATS. ; ; CATEGORY: ; ; CALLING SEQUENCE: ; G_DDATE, FILENAME, DARR ; ; INPUTS: ; FILENAME: A STRING containing the path and filename of a single file. ; ; KEYWORD PARAMETERS: ; None. ; ; OUTPUTS: ; DARR: A STRING ARRAY containing the date and times of the images. ; ; COMMON BLOCKS: ; None. ; ; SIDE EFFECTS: ; None. ; ; RESTRICTIONS: ; The files that this procedure works on are the files ouputed by one ; of the two procedures JULIAN and JS_STATS. Consequently, the only ; files that this procedure will work with are: ; c:\idl\data\dark\julian0.drk ; c:\idl\data\dark\julian1.drk ; c:\idl\data\dark\julian0.sts ; c:\idl\data\dark\julian1.sts ; ; PROCEDURE: ; The dates and times are actually stored in Julain Seconds. They are ; retreived from the file and then put into temperal order. Then, the ; Julian Seconds are converted into a year, month , day and hour, minute ; second format and returned as a STRING in the ARRAY DARR. ; ; MODIFICATION HISTORY: ; Written May 1994, by T A Oliynyk. ;- PRO g_ddate,filename,darr jsarr=DBLARR(1) OPENR,unit,filename,/GET_LUN dstats=ASSOC(unit,BYTARR(1206)) FOR i=0,719 DO BEGIN record=dstats(i) n=FIX(record,4) IF n GT 1 THEN BEGIN js=DOUBLE(record,406,n) jsarr=[jsarr,js] ENDIF ENDFOR jsarr=jsarr(1:*) jsarr=jsarr(SORT(jsarr)) darr=STRARR(6) FOR i=0,N_ELEMENTS(jsarr)-1 DO BEGIN js2ymds,jsarr(i),y,m,d,s s=LONG(s) h=s/3600 min=(s mod 3600)/60 sec=s-h*3600-min*60 y=STRTRIM(y,2) m=STRTRIM(m,2) d=STRTRIM(d,2) h=STRTRIM(h,2) min=STRTRIM(min,2) sec=STRTRIM(sec,2) date=y+'/'+m+'/'+d+' time: '+h+':'+min+':'+sec+' ' darr=[darr,date] ENDFOR CLOSE,unit FREE_LUN,unit END