def get_solver(self, dynamic_medium): """ Define an RteSolverArray object Parameters ---------- medium: shdom.Medium The atmospheric Medium for which the RTE is solved Returns ------- rte_solver: shdom.RteSolverArray object A solver array initialized to the input medium and numerical and scene arguments """ if self.args.solar_spectrum: solar_spectrum = shdom.SolarSpectrum() solar_fluxes = solar_spectrum.get_monochrome_solar_flux( self.args.wavelength) solar_fluxes = solar_fluxes / max(solar_fluxes) else: solar_fluxes = np.full_like(self.args.wavelength, 1.0) numerical_params = shdom.NumericalParameters( num_mu_bins=self.args.num_mu, num_phi_bins=self.args.num_phi, split_accuracy=self.args.split_accuracy, adapt_grid_factor=self.args.adapt_grid_factor, solution_accuracy=self.args.solution_accuracy) for wavelength, solar_flux in zip([dynamic_medium.wavelength], solar_fluxes): scene_params = shdom.SceneParameters( wavelength=wavelength, source=shdom.SolarSource(self.args.solar_azimuth, self.args.solar_zenith, solar_flux), surface=shdom.LambertianSurface( albedo=self.args.surface_albedo)) dynamic_solver = shdom.DynamicRteSolver( scene_params=scene_params, numerical_params=numerical_params) dynamic_solver.set_dynamic_medium(dynamic_medium) dynamic_solver.solve(maxiter=100) return dynamic_solver
def get_rte_solver(self,measurements, medium_estimator): scene_params_list = [] numerical_params_list = [] wavelengths = measurements.wavelength if not isinstance(wavelengths,list): wavelengths = [wavelengths] for wavelength, sun_azimuth, sun_zenith in zip(wavelengths, measurements.sun_azimuth_list, measurements.sun_zenith_list): scene_params = shdom.SceneParameters( wavelength=wavelength, surface=shdom.LambertianSurface(albedo=0.005), source=shdom.SolarSource(azimuth=sun_azimuth, zenith=sun_zenith) ) scene_params_list.append(scene_params) numerical_params = shdom.NumericalParameters(num_mu_bins=8, num_phi_bins=16, split_accuracy=0.1) numerical_params_list.append(numerical_params) dynamic_solver = shdom.DynamicRteSolver(scene_params=scene_params_list, numerical_params=numerical_params_list) dynamic_solver.set_dynamic_medium(medium_estimator) return dynamic_solver