try:
                upper_y = 1.1 * np.amax(
                    cosmic_variance[np.abs(cosmic_variance) > cutoff])
            except:
                upper_y = cutoff
            plotrange_y.append([lower_y, upper_y])

            # now set the appearence of the plot:
            plotrange_x = np.array(plotrange_x)
            plotrange_y = np.array(plotrange_y)
            # log scale:
            if not do_lin:
                ax.set_xscale('log')
                ax.set_yscale('log')
            # ranges:
            x_min = fu.v_nice_number(np.amin(plotrange_x[:, 0]), 1)
            x_max = fu.v_nice_number(np.amax(plotrange_x[:, 1]), 1)
            if (x_min != x_max):
                ax.set_xlim([x_min, x_max])
            y_min = fu.v_nice_number(np.amin(plotrange_y[:, 0]), 2)
            y_max = fu.v_nice_number(np.amax(plotrange_y[:, 1]), 0)
            if (y_min != y_max):
                ax.set_ylim([y_min, y_max])
            # labels
            if (ind != num):
                ax.set_xticklabels([])
            if (ind == num):
                ax.set_xlabel('$\ell$')
            if (ind2 == 1):
                ax.set_ylabel(
                    '$ \Delta C_{\ell} \,\, / \,\, C_{\ell} \,\, \%$')
Esempio n. 2
0
            elif params is not None:
                fishers_temp = fishers_temp.marginalise(params=params)

            for num, fish in enumerate(fishers_temp.get_fisher_list()):
                #output fisher matrices again
                fish.save_to_file(outroot + '__Fisher_Out_' + str(num) + "-" +
                                  fish.name,
                                  simple_header=True)
                print(fish.name)
                fishpars = fish.get_param_names()
                print("parameter names")
                print(str(fishpars))

                # get the bounds:
                Bounds_68 = list(
                    fu.v_nice_number(fish.get_confidence_bounds(0.680),
                                     mode=1))
                Bounds_95 = list(
                    fu.v_nice_number(fish.get_confidence_bounds(0.950),
                                     mode=1))
                Bounds_99 = list(
                    fu.v_nice_number(fish.get_confidence_bounds(0.997),
                                     mode=1))
                # get the fiducial:
                fiducial = []
                for num, par in enumerate(fish.get_param_fiducial()):
                    fiducial.append(
                        fu.significant_digits((par, Bounds_68[num]), mode=1))
                # get the names:
                if use_latex:
                    parameter_names_latex = copy.deepcopy(
                        fish.get_param_names_latex())
Esempio n. 3
0
 # do some first printing for Latex:
 if use_latex:
     out_file.write( '\\begin{tabular}{ |'+''.join(['l|' for i in range(latex_num_col) ])+' }\n' )
         
 for key, params in numbounds:
     params = Config.get("bounds", key).split(",")
     
     fishers_temp = fishers
     if eliminate is not False:
        fishers_temp = fishers_temp.reshuffle( params=params )
     elif params is not None:
        fishers_temp = fishers_temp.marginalise( params=params )
     
     for num, fish in enumerate(fishers_temp.get_fisher_list()):
         # get the bounds:
         Bounds_68 = list( fu.v_nice_number( fish.get_confidence_bounds( 0.680 ), mode=1 ) )
         Bounds_95 = list( fu.v_nice_number( fish.get_confidence_bounds( 0.950 ), mode=1 ) )
         Bounds_99 = list( fu.v_nice_number( fish.get_confidence_bounds( 0.997 ), mode=1 ) )
         # get the fiducial:
         fiducial = []
         for num, par in enumerate(fish.get_param_fiducial()):
             fiducial.append( fu.significant_digits( (par, Bounds_68[num]), mode=1 ) )
         # get the names:
         if use_latex:
             parameter_names_latex = copy.deepcopy(fish.get_param_names_latex())
         else:
             parameter_names       = copy.deepcopy(fish.get_param_names())
         # do the printing:
         if use_latex:
             print_table = []
             for par,fid,bound in zip( parameter_names_latex,fiducial,Bounds_68 ):
Esempio n. 4
0
 # get the plot bounds for cosmic variance:
 try: lower_y = 0.9*np.amin(cosmic_variance[np.abs(cosmic_variance)>cutoff])
 except: lower_y = cutoff
 try: upper_y = 1.1*np.amax(cosmic_variance[np.abs(cosmic_variance)>cutoff])
 except: upper_y = cutoff
 plotrange_y.append( [ lower_y,upper_y ] )
 
 # now set the appearence of the plot:
 plotrange_x = np.array( plotrange_x )
 plotrange_y = np.array( plotrange_y )
 # log scale:
 if not do_lin:
     ax.set_xscale('log')
     ax.set_yscale('log')
 # ranges:
 x_min = fu.v_nice_number( np.amin(plotrange_x[:,0]),1)
 x_max = fu.v_nice_number( np.amax(plotrange_x[:,1]),1)
 if ( x_min != x_max ):
     ax.set_xlim( [ x_min,x_max ] )
 y_min = fu.v_nice_number( np.amin(plotrange_y[:,0]),2)
 y_max = fu.v_nice_number( np.amax(plotrange_y[:,1]),0)
 if ( y_min != y_max ):
     ax.set_ylim( [ y_min,y_max ] )
 # labels
 if ( ind != num ):
     ax.set_xticklabels( [] )
 if ( ind == num ):
     ax.set_xlabel('$\ell$')
 if ( ind2 == 1):
     ax.set_ylabel( '$ \Delta C_{\ell} \,\, / \,\, C_{\ell} \,\, \%$' )
 
Esempio n. 5
0
 
 # open the file if wanted:
 if outroot is not None:
     out_file = open(outroot,"w")
 
 # do some first printing for Latex:
 if args.latex:
     if outroot is not None:
         out_file.write( '\\begin{tabular}{ |'+''.join(['l|' for i in range(latex_num_col) ])+' }\n' )
     else:
         print '\\begin{tabular}{ |'+''.join(['l|' for i in range(latex_num_col) ])+' }'
         
 # print the confidence bounds on the Fisher matrices:
 for num, fish in enumerate(fishers.get_fisher_list()):
     # get the bounds:
     Bounds_68 = list( fu.v_nice_number( fish.get_confidence_bounds( 0.680 ), mode=1 ) )
     Bounds_95 = list( fu.v_nice_number( fish.get_confidence_bounds( 0.950 ), mode=1 ) )
     Bounds_99 = list( fu.v_nice_number( fish.get_confidence_bounds( 0.997 ), mode=1 ) )
     # get the fiducial:
     fiducial = []
     for num, par in enumerate(fish.get_param_fiducial()):
         fiducial.append( fu.significant_digits( (par, Bounds_68[num]), mode=1 ) )
     # get the names:
     if args.latex:
         parameter_names_latex = fish.get_param_names_latex()
     else:
         parameter_names       = fish.get_param_names()
     # do the printing:
     if args.latex:
         print_table = []
         for par,fid,bound in zip( parameter_names_latex,fiducial,Bounds_68 ):