libplanarradpy/planrad.py
def write_run_parameters_to_file(self):
        """All of the class properties are written to a text file

        Each property is on a new line with the key and value seperated with an equals sign '='
        This is the mane planarrad properties file used by slabtool
        """

        self.update_filenames()

        lg.info('Writing Inputs to file : ' + self.project_file)

        # First update the file names in case we changed the file values.  the file name includes the file values
        # self.updateFileNames()

        f = open(self.project_file, 'w')

        f.write('name = ' + self.project_file + '\n')
        f.write('band_count = ' + str(len(self.wavelengths)) + '\n')
        f.write('bs_name = ' + str(len(self.wavelengths)) + ' Bands (' + str(self.wavelengths[0]) + '-' + str(
            self.wavelengths[len(self.wavelengths) - 1]) + ' nm) \n')
        f.write('bs_code = ' + str(len(self.wavelengths)) + '\n')
        f.write('band_centres_data = ')
        f.write(",".join([str(wave) for wave in self.wavelengths]) + '\n')
        # f.write('band_widths_data = ')
        # for i in range(0, len(self.wavelengths) - 1):  # Find better way to do this!
        # width = self.wavelengths[i + 1] - self.wavelengths[i]
        #     f.write(str(width))
        #     if i < len(self.wavelengths) - 2:
        #         f.write(',')
        f.write('\n')
        f.write('ds_name = ' + self.ds_name + '\n')
        f.write('ds_code = ' + self.ds_code + '\n')
        f.write('partition = ' + self.partition + '\n')
        f.write('vn = ' + str(self.vn) + '\n')
        f.write('hn = ' + str(self.hn) + '\n')
        f.write('theta_points=')
        f.write(",".join([str(theta) for theta in self.theta_points]) + '\n')
        f.write('depth = ' + str(self.depth) + '\n')
        f.write('sample_point_distance = ' + str(self.sample_point_distance) + '\n')
        f.write('sample_point_delta_distance = ' + str(self.sample_point_delta_distance) + '\n')
        f.write('\n')
        f.write('sky_fp = ' + self.sky_file + '\n')  # need to create these files from sky tool
        f.write('water_surface_fp =' + self.water_surface_file)
        f.write('\n')
        f.write('atten_fp = ' + self.attenuation_file + '\n')
        f.write('scat_fp = ' + self.scattering_file + '\n')
        f.write('pf_fp = ' + self.phase_function_file + '\n')
        f.write('bottom_reflec_diffuse_fp = ' + self.bottom_reflectance_file + '\n')
        f.write('sky_type = ' + self.sky_type + '\n')
        f.write('sky_azimuth = ' + str(self.sky_azimuth) + '\n')
        f.write('sky_zenith = ' + str(self.sky_zenith) + '\n')
        f.write('sky_C = ' + str(self.sky_c) + '\n')
        f.write('sky_rdif = ' + str(self.sky_r_dif) + '\n')
        f.write('iface_type = ' + self.iface_type + '\n')
        f.write('iface_refrac_index_0 = ' + str(self.iface_0_ri) + '\n')
        f.write('iface_refrac_index_1 = ' + str(self.iface_1_ri) + '\n')
        #        f.write('iop_atten_data = 1\n')
        #        f.write('iop_absorp_data = 0\n')
        f.write('iop_type = ' + self.iop_type + '\n')
        f.write('iop_backscatter_proportion_list = ' + str(self.iop_backscatter_proportion_list) + '\n')
        f.write('bound_bottom_reflec_diffuse_data = ' + str(self.bound_bottom_reflec_diffuse_data) + '\n')
        f.write('sky_sub_quad_count = ' + self.sky_sub_quad_count + '\n')
        f.write('iface_sub_quad_count = ' + self.iface_sub_quad_count + '\n')
        f.write('pf_sub_quad_count = ' + self.pf_sub_quad_count + '\n')
        f.write('integrator = ' + self.integrator + '\n')
        f.write('euler_steps_per_optical_depth = ' + str(self.euler_steps_per_optical_depth) + '\n')
        f.write('midpoint_steps_per_optical_depth = ' + str(self.midpoint_steps_per_optical_depth) + '\n')
        f.write('runga4_steps_per_optical_depth = ' + str(self.runga4_steps_per_optical_depth) + '\n')
        f.write('runga4adap_min_steps_per_optical_depth = ' + str(self.runga4adap_min_steps_per_optical_depth) + '\n')
        f.write('runga4adap_max_steps_per_optical_depth = ' + str(self.runga4adap_max_steps_per_optical_depth) + '\n')
        f.write('runga4adap_min_error = ' + str(self.runga4adap_min_error) + '\n')
        f.write('runga4adap_max_error = ' + str(self.runga4adap_max_error) + '\n')
        f.write('\n')

        f.write('Ld_b_image_save_fp = ' + os.path.join(self.output_path,
                                                       'image_Ld_b.ppm') + '\n')  #todo update this in the constructor not here

        f.write('Ld_b_image_sens_k = ' + str(self.ld_b_image_sens_k) + '\n')
        f.write('\n')
        f.write('Ld_b_save_fp = ' + os.path.join(self.output_path,
                                                 'Ld_b_data') + '\n')
        f.write('\n')
        f.write('report_save_fp = ' + self.report_file)
        f.write('\n')
        f.write('verbose = ' + str(self.verbose) + '\n')
        f.close()
def write_run_parameters_to_file(self):
        """All of the class properties are written to a text file

        Each property is on a new line with the key and value seperated with an equals sign '='
        This is the mane planarrad properties file used by slabtool
        """

        self.update_filenames()

        lg.info('Writing Inputs to file : ' + self.project_file)

        # First update the file names in case we changed the file values.  the file name includes the file values
        # self.updateFileNames()

        f = open(self.project_file, 'w')

        f.write('name = ' + self.project_file + '\n')
        f.write('band_count = ' + str(len(self.wavelengths)) + '\n')
        f.write('bs_name = ' + str(len(self.wavelengths)) + ' Bands (' + str(self.wavelengths[0]) + '-' + str(
            self.wavelengths[len(self.wavelengths) - 1]) + ' nm) \n')
        f.write('bs_code = ' + str(len(self.wavelengths)) + '\n')
        f.write('band_centres_data = ')
        f.write(",".join([str(wave) for wave in self.wavelengths]) + '\n')
        # f.write('band_widths_data = ')
        # for i in range(0, len(self.wavelengths) - 1):  # Find better way to do this!
        # width = self.wavelengths[i + 1] - self.wavelengths[i]
        #     f.write(str(width))
        #     if i < len(self.wavelengths) - 2:
        #         f.write(',')
        f.write('\n')
        f.write('ds_name = ' + self.ds_name + '\n')
        f.write('ds_code = ' + self.ds_code + '\n')
        f.write('partition = ' + self.partition + '\n')
        f.write('vn = ' + str(self.vn) + '\n')
        f.write('hn = ' + str(self.hn) + '\n')
        f.write('theta_points=')
        f.write(",".join([str(theta) for theta in self.theta_points]) + '\n')
        f.write('depth = ' + str(self.depth) + '\n')
        f.write('sample_point_distance = ' + str(self.sample_point_distance) + '\n')
        f.write('sample_point_delta_distance = ' + str(self.sample_point_delta_distance) + '\n')
        f.write('\n')
        f.write('sky_fp = ' + self.sky_file + '\n')  # need to create these files from sky tool
        f.write('water_surface_fp =' + self.water_surface_file)
        f.write('\n')
        f.write('atten_fp = ' + self.attenuation_file + '\n')
        f.write('scat_fp = ' + self.scattering_file + '\n')
        f.write('pf_fp = ' + self.phase_function_file + '\n')
        f.write('bottom_reflec_diffuse_fp = ' + self.bottom_reflectance_file + '\n')
        f.write('sky_type = ' + self.sky_type + '\n')
        f.write('sky_azimuth = ' + str(self.sky_azimuth) + '\n')
        f.write('sky_zenith = ' + str(self.sky_zenith) + '\n')
        f.write('sky_C = ' + str(self.sky_c) + '\n')
        f.write('sky_rdif = ' + str(self.sky_r_dif) + '\n')
        f.write('iface_type = ' + self.iface_type + '\n')
        f.write('iface_refrac_index_0 = ' + str(self.iface_0_ri) + '\n')
        f.write('iface_refrac_index_1 = ' + str(self.iface_1_ri) + '\n')
        #        f.write('iop_atten_data = 1\n')
        #        f.write('iop_absorp_data = 0\n')
        f.write('iop_type = ' + self.iop_type + '\n')
        f.write('iop_backscatter_proportion_list = ' + str(self.iop_backscatter_proportion_list) + '\n')
        f.write('bound_bottom_reflec_diffuse_data = ' + str(self.bound_bottom_reflec_diffuse_data) + '\n')
        f.write('sky_sub_quad_count = ' + self.sky_sub_quad_count + '\n')
        f.write('iface_sub_quad_count = ' + self.iface_sub_quad_count + '\n')
        f.write('pf_sub_quad_count = ' + self.pf_sub_quad_count + '\n')
        f.write('integrator = ' + self.integrator + '\n')
        f.write('euler_steps_per_optical_depth = ' + str(self.euler_steps_per_optical_depth) + '\n')
        f.write('midpoint_steps_per_optical_depth = ' + str(self.midpoint_steps_per_optical_depth) + '\n')
        f.write('runga4_steps_per_optical_depth = ' + str(self.runga4_steps_per_optical_depth) + '\n')
        f.write('runga4adap_min_steps_per_optical_depth = ' + str(self.runga4adap_min_steps_per_optical_depth) + '\n')
        f.write('runga4adap_max_steps_per_optical_depth = ' + str(self.runga4adap_max_steps_per_optical_depth) + '\n')
        f.write('runga4adap_min_error = ' + str(self.runga4adap_min_error) + '\n')
        f.write('runga4adap_max_error = ' + str(self.runga4adap_max_error) + '\n')
        f.write('\n')

        f.write('Ld_b_image_save_fp = ' + os.path.join(self.output_path,
                                                       'image_Ld_b.ppm') + '\n')  #todo update this in the constructor not here

        f.write('Ld_b_image_sens_k = ' + str(self.ld_b_image_sens_k) + '\n')
        f.write('\n')
        f.write('Ld_b_save_fp = ' + os.path.join(self.output_path,
                                                 'Ld_b_data') + '\n')
        f.write('\n')
        f.write('report_save_fp = ' + self.report_file)
        f.write('\n')
        f.write('verbose = ' + str(self.verbose) + '\n')
        f.close()
def write_run_parameters_to_file ( self ) : self . update_filenames ( ) lg . info ( 'Writing Inputs to file : ' + self . project_file ) # First update the file names in case we changed the file values.  the file name includes the file values # self.updateFileNames() f = open ( self . project_file , 'w' ) f . write ( 'name = ' + self . project_file + '\n' ) f . write ( 'band_count = ' + str ( len ( self . wavelengths ) ) + '\n' ) f . write ( 'bs_name = ' + str ( len ( self . wavelengths ) ) + ' Bands (' + str ( self . wavelengths [ 0 ] ) + '-' + str ( self . wavelengths [ len ( self . wavelengths ) - 1 ] ) + ' nm) \n' ) f . write ( 'bs_code = ' + str ( len ( self . wavelengths ) ) + '\n' ) f . write ( 'band_centres_data = ' ) f . write ( "," . join ( [ str ( wave ) for wave in self . wavelengths ] ) + '\n' ) # f.write('band_widths_data = ') # for i in range(0, len(self.wavelengths) - 1):  # Find better way to do this! # width = self.wavelengths[i + 1] - self.wavelengths[i] #     f.write(str(width)) #     if i < len(self.wavelengths) - 2: #         f.write(',') f . write ( '\n' ) f . write ( 'ds_name = ' + self . ds_name + '\n' ) f . write ( 'ds_code = ' + self . ds_code + '\n' ) f . write ( 'partition = ' + self . partition + '\n' ) f . write ( 'vn = ' + str ( self . vn ) + '\n' ) f . write ( 'hn = ' + str ( self . hn ) + '\n' ) f . write ( 'theta_points=' ) f . write ( "," . join ( [ str ( theta ) for theta in self . theta_points ] ) + '\n' ) f . write ( 'depth = ' + str ( self . depth ) + '\n' ) f . write ( 'sample_point_distance = ' + str ( self . sample_point_distance ) + '\n' ) f . write ( 'sample_point_delta_distance = ' + str ( self . sample_point_delta_distance ) + '\n' ) f . write ( '\n' ) f . write ( 'sky_fp = ' + self . sky_file + '\n' ) # need to create these files from sky tool f . write ( 'water_surface_fp =' + self . water_surface_file ) f . write ( '\n' ) f . write ( 'atten_fp = ' + self . attenuation_file + '\n' ) f . write ( 'scat_fp = ' + self . scattering_file + '\n' ) f . write ( 'pf_fp = ' + self . phase_function_file + '\n' ) f . write ( 'bottom_reflec_diffuse_fp = ' + self . bottom_reflectance_file + '\n' ) f . write ( 'sky_type = ' + self . sky_type + '\n' ) f . write ( 'sky_azimuth = ' + str ( self . sky_azimuth ) + '\n' ) f . write ( 'sky_zenith = ' + str ( self . sky_zenith ) + '\n' ) f . write ( 'sky_C = ' + str ( self . sky_c ) + '\n' ) f . write ( 'sky_rdif = ' + str ( self . sky_r_dif ) + '\n' ) f . write ( 'iface_type = ' + self . iface_type + '\n' ) f . write ( 'iface_refrac_index_0 = ' + str ( self . iface_0_ri ) + '\n' ) f . write ( 'iface_refrac_index_1 = ' + str ( self . iface_1_ri ) + '\n' ) #        f.write('iop_atten_data = 1\n') #        f.write('iop_absorp_data = 0\n') f . write ( 'iop_type = ' + self . iop_type + '\n' ) f . write ( 'iop_backscatter_proportion_list = ' + str ( self . iop_backscatter_proportion_list ) + '\n' ) f . write ( 'bound_bottom_reflec_diffuse_data = ' + str ( self . bound_bottom_reflec_diffuse_data ) + '\n' ) f . write ( 'sky_sub_quad_count = ' + self . sky_sub_quad_count + '\n' ) f . write ( 'iface_sub_quad_count = ' + self . iface_sub_quad_count + '\n' ) f . write ( 'pf_sub_quad_count = ' + self . pf_sub_quad_count + '\n' ) f . write ( 'integrator = ' + self . integrator + '\n' ) f . write ( 'euler_steps_per_optical_depth = ' + str ( self . euler_steps_per_optical_depth ) + '\n' ) f . write ( 'midpoint_steps_per_optical_depth = ' + str ( self . midpoint_steps_per_optical_depth ) + '\n' ) f . write ( 'runga4_steps_per_optical_depth = ' + str ( self . runga4_steps_per_optical_depth ) + '\n' ) f . write ( 'runga4adap_min_steps_per_optical_depth = ' + str ( self . runga4adap_min_steps_per_optical_depth ) + '\n' ) f . write ( 'runga4adap_max_steps_per_optical_depth = ' + str ( self . runga4adap_max_steps_per_optical_depth ) + '\n' ) f . write ( 'runga4adap_min_error = ' + str ( self . runga4adap_min_error ) + '\n' ) f . write ( 'runga4adap_max_error = ' + str ( self . runga4adap_max_error ) + '\n' ) f . write ( '\n' ) f . write ( 'Ld_b_image_save_fp = ' + os . path . join ( self . output_path , 'image_Ld_b.ppm' ) + '\n' ) #todo update this in the constructor not here f . write ( 'Ld_b_image_sens_k = ' + str ( self . ld_b_image_sens_k ) + '\n' ) f . write ( '\n' ) f . write ( 'Ld_b_save_fp = ' + os . path . join ( self . output_path , 'Ld_b_data' ) + '\n' ) f . write ( '\n' ) f . write ( 'report_save_fp = ' + self . report_file ) f . write ( '\n' ) f . write ( 'verbose = ' + str ( self . verbose ) + '\n' ) f . close ( )
All of the class properties are written to a text file

        Each property is on a new line with the key and value seperated with an equals sign '='
        This is the mane planarrad properties file used by slabtool
All of the class properties are written to a text file