PRO combined_subtitle, a, pi_list, title, ps=ps
web_code='CDAWeb'
if keyword_set(ps) then begin
endif else begin
xyouts,!d.x_size/2,!d.y_size-!d.y_ch_size,title,/DEVICE,ALIGNMENT=0.5,charsize=1.5
endelse
pos = strpos(pi_list, 'and', /reverse_search)
if (pos ge (strlen(pi_list)-4)) then pi_list = strmid(pi_list,0,pos-1)
pi = ' ' & s='' & b = tagindex('PROJECT',tag_names(a))
if (b[0] ne -1) then begin
if(n_elements(a.PROJECT) eq 1) then begin
pr = break_mystring(a.PROJECT,delimiter='>')
endif else begin
pr = break_mystring(a.PROJECT[0],delimiter='>')
endelse
if (pr[0] eq 'ISTP') then begin
s = 'Key Parameter and Survey data (labels K0,K1,K2)'
s = s + ' are preliminary browse data.' + '!C'
endif
s = s + ' Generated by '+ web_code + ' on ' + systime()
endif
if (strlen(pi_list) lt 5) then begin
b = tagindex('PI_NAME',tag_names(a))
if (b[0] ne -1) then begin
if(n_elements(a.PI_NAME) eq 1) then pi = a.PI_NAME
endif
b = tagindex('PI_AFFILIATION',tag_names(a))
if (b[0] ne -1) then begin
if((n_elements(a.PI_AFFILIATION) eq 1) and (a.PI_AFFILIATION[0] ne "")) then $
pi = pi + ' at '+ a.PI_AFFILIATION
endif
pi = 'Please acknowledge data provider, ' + pi + ' and '+ web_code +' when using these data.'
endif else pi = pi_list + ' and '+ web_code +' when using these data.'
if (s ne '') then begin
c = 1.0
if ((!d.x_ch_size * strlen(s)) gt !d.x_size) then begin
b = float(!d.x_ch_size * strlen(s)) / float(!d.x_size)
c = 1.0 - (b/11.0)
endif
pi_len = strlen(pi)
number_of_lines = 0
pi_final = ' '
if (c lt 0.75) then string_len = 160 else string_len = 145
if (pi_len gt string_len) then begin
pi_tmp = strsplit(pi, ' at ',/extract, /regex)
for t = 1, (n_elements(pi_tmp)-1) do pi_tmp[t] = ' at ' + pi_tmp[t]
lines = make_array(n_elements(pi_tmp),/string, value='')
l_num = 0L
ds = 1L
lines[0] = pi_tmp[0]
while (ds le (n_elements(pi_tmp)-1)) do begin
if ((strlen(lines[l_num]) + strlen(pi_tmp[ds])) le string_len) then begin
lines[l_num] = lines[l_num] + pi_tmp[ds]
endif else begin
l_num = l_num + 1
lines[l_num] = pi_tmp[ds]
endelse
ds = ds + 1
endwhile
goodlines = where(lines ne '', g_cnt)
pi_final = lines(goodlines[0])
for g = 1, g_cnt-1 do pi_final = pi_final + '!C' + lines(goodlines[g])
number_of_lines = g_cnt
endif else begin
pi_final = pi
number_of_lines = 1L
endelse
if (c ge 0.75) then begin
case number_of_lines of
6: begin
if keyword_set(ps) then begin
endif else begin
xyouts,!d.x_size/2,49L,pi_final,/DEVICE,ALIGNMENT=0.5,CHARSIZE=c
xyouts,!d.x_size/2,4L,s,/DEVICE,ALIGNMENT=0.5,CHARSIZE=c
endelse
end
5: begin
if keyword_set(ps) then begin
endif else begin
xyouts,!d.x_size/2,47L,pi_final,/DEVICE,ALIGNMENT=0.5,CHARSIZE=c
xyouts,!d.x_size/2,6L,s,/DEVICE,ALIGNMENT=0.5,CHARSIZE=c
endelse
end
4: begin
if keyword_set(ps) then begin
endif else begin
xyouts,!d.x_size/2,45L,pi_final,/DEVICE,ALIGNMENT=0.5,CHARSIZE=c
xyouts,!d.x_size/2,8L,s,/DEVICE,ALIGNMENT=0.5,CHARSIZE=c
endelse
end
3: begin
if keyword_set(ps) then begin
endif else begin
xyouts,!d.x_size/2,42L,pi_final,/DEVICE,ALIGNMENT=0.5,CHARSIZE=c
xyouts,!d.x_size/2,10L,s,/DEVICE,ALIGNMENT=0.5,CHARSIZE=c
endelse
end
2: begin
if keyword_set(ps) then begin
endif else begin
xyouts,!d.x_size/2,32L,pi_final,/DEVICE,ALIGNMENT=0.5,CHARSIZE=c
xyouts,!d.x_size/2,10L,s,/DEVICE,ALIGNMENT=0.5,CHARSIZE=c
endelse
end
else: begin
if not keyword_set(ps) then begin
xyouts,!d.x_size/2,22L,pi_final,/DEVICE,ALIGNMENT=0.5,CHARSIZE=c
xyouts,!d.x_size/2,10L,s,/DEVICE,ALIGNMENT=0.5,CHARSIZE=c
endif
end
endcase
endif
if (c lt 0.75) then begin
s = ''
if (pr[0] eq 'ISTP') then begin
s = 'Key Parameter and Survey data (labels K0,K1,K2) are '
s = s + 'preliminary browse data.' + '!C'
endif
gen_date = ' Generated by '+ web_code + ' on ' + systime()
case number_of_lines of
6: begin
xyouts,!d.x_size/2,49L,pi_final,/DEVICE,ALIGNMENT=0.5,CHARSIZE=c
xyouts,!d.x_size/2,4L,s,/DEVICE,ALIGNMENT=0.5,CHARSIZE=c
end
5: begin
xyouts,!d.x_size/2,47L,pi_final,/DEVICE,ALIGNMENT=0.5,CHARSIZE=c
xyouts,!d.x_size/2,6L,s,/DEVICE,ALIGNMENT=0.5,CHARSIZE=c
end
4: begin
xyouts,!d.x_size/2,45L,pi_final,/DEVICE,ALIGNMENT=0.5,CHARSIZE=c
xyouts,!d.x_size/2,8L,s,/DEVICE,ALIGNMENT=0.5,CHARSIZE=c
end
3: begin
xyouts,!d.x_size/2,42L,pi_final,/DEVICE,ALIGNMENT=0.5,CHARSIZE=c
xyouts,!d.x_size/2,10L,s,/DEVICE,ALIGNMENT=0.5,CHARSIZE=c
end
2: begin
xyouts,!d.x_size/2,32L,pi_final,/DEVICE,ALIGNMENT=0.5,CHARSIZE=c
xyouts,!d.x_size/2,10L,s,/DEVICE,ALIGNMENT=0.5,CHARSIZE=c
end
else: begin
xyouts,!d.x_size/2,22L,pi_final,/DEVICE,ALIGNMENT=0.5,CHARSIZE=c
xyouts,!d.x_size/2,10L,s,/DEVICE,ALIGNMENT=0.5,CHARSIZE=c
end
endcase
endif
endif
end