year_perc = [var,0,-var] trends=(np.array(year_perc)/365)#.round(2) #print(trends) results.append(var) d_nom = 2 print(1.0*var) for trend in trends: TCP_results_trend = TCP_NTCP.completeTCPcalc(n=1000, alphabeta_use=3, alphabeta_sd_use=0.5, d=d_nom, d_shift=0, # no shift as start each treatment as if perfect d_sd=0.5, d_trend=trend, # vary the trend value max_d=100, dose_of_interest=74, dose_input = None, TCP_input = None, d_list = None, n0 = 175, weights_input = None) #print(TCP_results_trend[10]) results.append(TCP_results_trend[10]) plt.plot(TCP_results_trend[13],TCP_results_trend[12], label=trend) plt.legend(title='Daily variation (%)', loc='upper left') plt.title('Variation over year = ' + str(var) + '%')
warnings.filterwarnings("ignore", category=np.VisibleDeprecationWarning) #%% ## the TCP function TCP_calc = True NTCP_calc = True if TCP_calc == True: TCP_results = TCP_NTCP.completeTCPcalc(n=1000, alphabeta_use=3, alphabeta_sd_use=0,## supply as percent d=2, d_shift=0, d_sd=1, d_trend=0, # vary the trend value max_d=100, dose_of_interest=74, dose_input = [74], TCP_input = [0.8], d_list = None, n0 = None, weights_input = None) plt.plot(TCP_results['nom_doses'],TCP_results['TCP_pop'], color='darkgreen',lw=1,alpha=1) plt.plot(TCP_results['dose_input'],TCP_results['TCP_input'],color='green',ls='',marker='o',alpha=0.5) for i in range(TCP_results['n']): plt.plot(TCP_results['nom_doses'],TCP_results['TCPs'][i],color='green',ls='-',alpha=0.1) ## should be able to get the list of doses etc from the TCP calc to ## then use within the NTCP calc. if NTCP_calc == True: