;+
; NAME:
;       bcs_path
; PURPOSE:
;       Derives path name for BCS files. If Env. Variable BCS_PATH is
;	set, this defines search path (Default is "/bdat*/").
;	Intended for use at sites with large amount of BCS data online.
; CATEGORY:
; CALLING SEQUENCE:
;       dirs = bcs_path(options)
; INPUTS:
;	options	   Can be:
;		   1) Options supplied in YODAT; filename in Yohkoh style;
;		   (e.g. bda970120 or bda970120.*) is 2nd parameter.
;		   2) just filename in Yohkoh style
; OPTIONAL INPUT PARAMETERS:
; KEYWORD PARAMETERS:
; OUTPUTS:
;	dirs	string containing directory spec. for filename
; OPTIONAL OUTPUT PARAMETERS:
; COMMON BLOCKS:
; SIDE EFFECTS:
;	Adds .* to filename if not present
; RESTRICTIONS:
; PROCEDURE:
; MODIFICATION HISTORY:
;       RDB   28-Nov-97  Written
;-

function bcs_paths,options

bcs_path = get_logenv('BCS_PATH')
if bcs_path eq '' then bcs_path = '/bdat*/'

;	if three parameter options from YODAT, filename is 2nd
if n_elements(options) eq 3 then filnam = options(1) $
   else filnam = options
break_file, filnam, aa_dsk_log, aa_dir, aa_filnam, aa_ext, aa_ver

yr_week = anytim2weekid(fid2ex(strmid(aa_filnam+'.0000',3,11)),/string)
dirs = bcs_path + yr_week+'*/'

if aa_ext eq '' then filnam = aa_filnam + '.*' + aa_ver
if n_elements(options) eq 3 then options(1) = filnam $
   else options = filnam
;print,'dirs: ',dirs
;print,'filename: ',filnam

return,dirs
end
