from os.path import join from pyrad.optics.clouds.ice import IceCloudOptics from pyrad.optics.clouds.liquid import LiquidCloudOptics from pyrad.utils.grids import UniformGrid1D ice_clouds = IceCloudOptics(join("pyrad_data", "clouds", "chou_suarez.nc")) ice_cloud_optics = ice_clouds.optics(iwc=0.2, ice_particle_size=10, spectral_grid=UniformGrid1D( 600., 900., .01), mode="longwave") liquid_clouds = LiquidCloudOptics(join("pyrad_data", "clouds", "hu_stamnes.nc")) liquid_cloud_optics = liquid_clouds.optics(lwc=0.2, liquid_droplet_radius=10., spectral_grid=UniformGrid1D( 500., 800., .1))
def test_fu_liou_lw(self): clouds = IceCloudOptics(join("pyrad_data", "clouds", "fu_liou.nc")) clouds.optics(ice_content=50., equivalent_radius=10., grid=UniformGrid1D(500., 1500., 10), mode="longwave")
#Calculate cloud optics. cloud_fraction = asarray([0.99]) ice_water_content = asarray([50.]) #g m-3 liquid_water_content = asarray([50.]) #g m-3 altitude = asarray([5., 10.]) scale_length = 2. overlap = overlap_parameter(altitude, scale_length) water = TotalWaterPDF() lwc, iwc = water.sample_condensate(cloud_fraction, liquid_water_content, ice_water_content, overlap) liquid_clouds = LiquidCloudOptics( join("tests", "pyrad_data", "clouds", "hu_stamnes.nc")) liquid_droplet_radius = 10. #micron liquid_cloud_optics = liquid_clouds.optics(lwc, liquid_droplet_radius, spectral_grid) ice_clouds = IceCloudOptics( join("tests", "pyrad_data", "clouds", "chou_suarez.nc")) ice_particle_size = 10. #micron ice_cloud_optics = ice_clouds.optics(iwc, ice_particle_size, spectral_grid, mode="longwave") #Calculate aerosol optics. concentration = 1. # relative_humidity = 50.5 #[%]. mixture = 80.3 #[%]. sulfate = AerosolOptics( join("tests", "pyrad_data", "aerosols", "sulfate_optics.nc")) aerosol_optics = sulfate.optics(concentration, spectral_grid, relative_humidity, mixture)
def test_chou_suarez_sw(self): clouds = IceCloudOptics(join("pyrad_data", "clouds", "chou_suarez.nc")) clouds.optics(ice_content=50., equivalent_radius=10., grid=UniformGrid1D(500., 1500., 10), mode="shortwave")