function  get_sp_sotsp_conti_filenames, dir_path=dir_path
;
;+
;    Name:               get_sp_sotsp_conti_filenames
;
;    Purpose:            Create a vector of all available SP obsids suitable for use by make_some_spcubes.pro 
;
;    Keyword Parameters:
;                        dir_path=dir_path ;example for non-default path: dir_path='/net/vela/Volumes/venus/hinode/sot/level1hao/2010/*/*/SP3D/*'
;
;    Output:             driver for sp_make_cube_index.pro that accepts a vector of obsid strings/names.   (Can be a vector of 'one'.)
;
;    Calling Sequence and examples:
;                        IDL>sp_sotsp_conti_obsid_to_process_vector = get_sp_filenames()
;                        or, 
;                        
;
;    History:
;                        2019-04-18 PGS         Clean-up
;
;-
;
;if ~keyword_set(dir_path) then dir_path  = '/links/archive1/hinode/sot/level2hao/201[4,5,6,7,8,9]/*/*/SP3D/*'
;if ~keyword_set(dir_path) then dir_path  = '/links/archive1/hinode/sot/level2hao/20?[0,1,2,3,4,5,6,7,8,9]/*/*/SP3D/*'
if ~keyword_set(dir_path) then dir_path  = '/archive/archive1/hinode/sot/level2hao/20?[0,1,2,3,4,5,6,7,8,9]/*/*/SP3D/*'
files2 = file_search(dir_path, /fully_qualify_path,/expand_environment)
number_of_files2 = n_elements(files2)
files=strarr(number_of_files2)
file3_exist = intarr(number_of_files2)
print, 'look'
if (number_of_files2 gt 0) then begin
  for i=0, (number_of_files2-1) do begin
    temp_file_name = files2(i)
    files(i) = strmid(temp_file_name, (strlen(files2(i))) - 15,15)
  endfor
endif

;at this point we have two arrays, one of full paths (files2), and one of just the scanid (files)

;for each of these files, look and see if there is a corresponding level1d (and level1dhao?) sotsp_conti_*.fits file.
;IDL> x = strmid(temp, strpos(temp,'level2hao')+strlen('level2hao/'))

;base_dir_level1d = "/archive/archive1/hinode/sot/level1d/"
files3 = str_replace(files2,'level2hao','level1d')+'/'+files+'.fits'
files4 = str_replace(files2,'level2hao','level1d')+'/sotsp_conti_'+files+'.fits'
;stop, 'try a file_test to be sure it works, before entering loop.'
for j=0, number_of_files2-1 do begin
    print, 'testing for the existence of: ', files4(j)
    if file_test(files4(j)) then file3_exist(j) = 1
endfor
;stop, 'look at file3_exist'
nz= where(file3_exist eq 0)
;stop, 'are these the scan ids.'
return, files(nz)
;return, files3(nz)
end
