function GET_PACKET_FNAMES,date
;+
; NAME:
;	GET_PACKET_FNAMES
;
; PURPOSE:
;	This function returns all of the packet file names for the specified date(s).
;
; CATEGORY:
;	LASCO PACKETS
;
; CALLING SEQUENCE:
;	Result = GET_PACKET_FNAMES ( Date )
;
; INPUTS:
;	Date:	A string or array of strings specifying the date in the format YYMMDD
;
; OUTPUTS:
;	This function returns a string array of file names for the specified dates.
;
; COMMON BLOCKS:
;	None
;
; RESTRICTIONS:
;	If the environment variable, TMPCKTS, is not defined then the current 
;	working directory must be the directory where the files are located.
;
; PROCEDURE:
;	The file names have a basic root structure for a given date and then have
;	the hour at the end.  For example the SVM HK 1 packets for 1998/03/06 would 
;	have the structure:
;		SVMHK1980306_00  for hour 0
;		SVMHK1980306_01  for hour 1
;		SVMHK1980306_02  for hour 2
;	and so on.
;	This routine simply searches for all of the files of type SVMHK1980306*
;
;
; EXAMPLE:
;		hk = GET_PACKET_FNAMES ('SVMHK1960306')
;
; MODIFICATION HISTORY:
; 	Written by:	R.A. Howard, 1998
;	Sep, 1998	Extracted from the versionof READALLSV1
;
; @(#)get_packet_fnames.pro	1.1 09/24/98 :LASCO IDL LIBRARY
;
;
;-
dir = GETENV('TMPCKTS')
IF (dir EQ '')  THEN dir='./' ELSE dir=dir+'/'
nf = N_ELEMENTS(date)
IF (nf EQ 1)  THEN files = FINDFILE(dir+date+'*') ELSE BEGIN
   nfirst=1
   FOR i=0,nf-1 DO BEGIN
       ff = FINDFILE(dir+date(i)+'*',COUNT=nff)
       IF (nff GT 0)  THEN BEGIN
          IF (nfirst EQ 1)  THEN tempff=ff ELSE tempff=[tempff,ff]
          nfirst = 0
       ENDIF
   ENDFOR
   IF (nfirst EQ 0)  THEN files = tempff ELSE files=''
ENDELSE
s=SIZE(files)
IF (s(0) EQ 1) THEN RETURN,files 
PRINT,'Error in GET_PACKET_FNAMES:  No files found matching date = '+date
RETURN,-1
END

