Commit e9d483bf authored by Carl Schaffer's avatar Carl Schaffer
Browse files

Merge branch 'limits_fov_fix' into 'master'

adding dynamic file search to limits_fov

See merge request !17
parents 82b7ae96 838d67be
Pipeline #3909 passed with stage
function limits_fov,filein
files=file_search(filein+'*',count=nfiles)
pathin='./'
if nfiles eq 0 then begin
files=file_search('level0/'+filein+'*',count=nfiles)
if nfiles eq 0 then begin
message,'No TIP maps found.'
date_string=String(filein)
date_string=date_string.Extract("[0-9]{2}[a-z]{3}[0-9]{2}")
print,date_string
year=strmid(date_string,5,2)
day=strmid(date_string,0,2)
month=strmid(date_string,2,3)
case month of
'jan':month='01'
'feb':month='02'
'mar':month='03'
'apr':month='04'
'may':month='05'
'jun':month='06'
'jul':month='07'
'aug':month='08'
'sep':month='09'
'oct':month='10'
'nov':month='11'
'dec':month='12'
endcase
candidate="../"+'20'+year+month+day+'/'
start_path='./'
search_successful=0
foreach possible_folder , [start_path,start_path+'level0', candidate, candidate+'level0'] do begin
print, 'Checking for '+string(filein)+' in '+string(possible_folder)
files=file_search(possible_folder+'/'+filein+'*',count=nfiles)
if nfiles ne 0 then begin
pathin=possible_folder+'/'
search_successful=1
break
endif
pathin='level0/'
endforeach
if search_successful ne 1 then begin
message,'No TIP maps found.'
exit
endif
print, 'Using data from ',pathin
iraw=where(strpos(files,'c',/reverse_search) ne strlen(files)-1 and $
strpos(files,'m',/reverse_search) ne strlen(files)-1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment