;+
; PROJECT
;
;           Solar-B EIS
;
; NAME
;
;           EIS_GET_ZDBASE
;
; PURPOSE
;
;           Function to test whether any windows overlap. This is done for
;           each CCD separately.
;
; INPUTS
;
;           none
;
; OUPUTS
;
;           zdbase = 0 / 1 indicating OFFICIAL / USER
;
; CATEGORY
;
;           EIS Technical Planning
;           Database
;
; WRITTEN
;          JAR Feb-2006
;
; HISTORY
;          V0.1 JAR 16-Aug-2006
;               Changed routine to split up ZDBASE into an array of
;               pathnames. Then see if the environment variable
;               'official_database_directory' is there. If it is, then we
;               know ZDBASE is pointing to OFFICIAL.
;          v0.2 JAR 27-Aug-2008
;               Changed variable name to "official_db_dir" - to eliminate
;               conflict!
;
;
;-
;************************************************************************
FUNCTION eis_get_zdbase

; Get pathnames - make sure to expand all paths
zdbase_path = EXPAND_PATH(GETENV('ZDBASE')     , /ARRAY)
;official_database_directory
official_db_dir = EXPAND_PATH(GETENV('official_database_directory'))

;
index = WHERE(official_db_dir EQ zdbase_path , count)

IF (index[0] EQ -1) THEN zdbase = 1 ELSE zdbase = 0

RETURN , zdbase

END
