【物理应用】大气辐射和透射率模型及太阳和月亮模型(Matlab代码实现)

 💖💥💥💞💞欢迎来到本博客❤️❤️💥💥🥇
🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。
📝个人主页:研学社的博客
🥇 官方认证:Matlab领域优质创作者
🎉点赞➕评论➕收藏 == 养成习惯(一键三连)😋

希望大家多多支持🤗~一起加油 😁

⛳️座右铭:行百里者,半于九十

目录

📋1 概述

📝2 运行结果

📃3 参考文献

📋4 Matlab代码及文章阅读

📋1 概述

LOWTRAN7 是空军研究实验室 (AFRL) 于 1988 年 8 月发布的大气辐射和透射率模型。该项目是将 LOWTRAN7 太阳和月亮模型翻译成 matlab。应该注意的是,LOWTRAN7已被MODTRAN和SAMM取代。对于高质量的太阳和月亮图像,应改用AFRL的CBSD模型。LOWTRAN 7 是一种低分辨率传播模型和计算机代码,用于预测 0 至 50,000 cm- 1 的大气透射率以及天空热辐射和散射辐射,分辨率为 20 cm-1。

在 LOWTRAN7 中,可以计算来自太阳或月亮的直射光或散射光。太阳的辐照度是从光谱中插值的,并应用轨道校正来补偿地球的轨道离心率。月球的辐照度是使用Robert E. Turner等人开发和发表的数学模型计算的。 (1975)光学厚大气中的自然和人工照明,密歇根环境研究所,AD-A021 998,合同号。DAAA21-74-C-0331.(本文包括月球模型将光谱几何反照率(1988年所知)、相位因子和月球的角度范围应用于轨道校正的太阳光谱。结果显示在项目图像中。

📝2 运行结果

 

 

 部分代码:

%% *solar spectrum*
Lambda = 0.175:0.0001:5.0; % (micron)
V = 10000./Lambda; % (cm^-1)
sun = zeros(size(V));
for i = 1:numel(V)
[sun(i)] = SUN(V(i));
end
figure('Color','White','Units','Pixels','Position',[1 300 900 600]);
plot(Lambda,sun,'linewidth',2);
xlabel('Wavelength (\lambda) [\mum]');
ylabel('Solar Irradiance [W m^{-2} \mum^{-1}]');
title('LOWTRAN7 Exoatmosphere Solar Spectrum','fontsize',16);
set(gca,'fontsize',14,'fontweight','bold');

%% *position for time/day*
IDAY = 1:365;
THETAS = zeros(size(IDAY));
PHIS = zeros(size(IDAY));
figure('color','white','units','pixels','position',[60 200 1000 800]);
subplot(2,1,1);
for TIME = [0 6 12.25 18]
    for i  = 1:length(IDAY)
        [THETAS(i),PHIS(i)] = SUBSOL(TIME,IDAY(i));
    end
    plot(IDAY,PHIS,'linewidth',3,'DisplayName',['UTC=' num2str(TIME) 'h']);
    hold on;
end
xlabel('Day of Year'); ylabel('\phi (deg)'); 
leg = legend('location','southeast'); 
set(gca,'fontsize',14,'fontweight','bold');
xlim([0 365]); ylim([0 360]); set(gca,'ytick',[0 90 180 270 360]);
title({'LOWTRAN7 Subsolar Latitude (\theta) and Longtitude (\phi)'});
subplot(2,1,2);
plot(IDAY,THETAS,'k','linewidth',3); 
xlabel('Day of Year'); ylabel('\theta (Declination) (deg)');
set(gca,'fontsize',14,'fontweight','bold');
xlim([0 365]); ylim([-31 31]); set(gca,'ytick',[-31 -23.5 -15 -7.5 0 7.5 15 23.5 31]);
hold on;
% add Earth's Obliquity
plot([0 365],[23.5 23.5],'--b');
plot([0 365],[-23.5 -23.5],'--b');
plot([0 365],[0 0],'--b');
% add equinox and solstice dates
plot([81 81],[-30 30],'--b');
plot([172 172],[-30 30],'--b');
plot([267 267],[-30 30],'--b');
plot([354 354],[-30 30],'--b');

%% *source zenith angle at points along a line-of-sight*
j = 1;
figure('color','white','units','pixels','position',[200 150 1000 800]);
for PSIO = 0:60:180  % (deg) azimuth subtended between LOS and line to Sun
    subplot(2,2,j);
    IARBO = 0; % not a special case
    for DELO = 5:5:45 % (deg) Sun's zernith
        BETA = 1:34; % (deg) Earth center angle along the LOS
        xDEL = zeros(size(BETA));
        for i = 1:numel(BETA)
            [xDEL(i)] = DEL(PSIO,DELO,BETA(i),IARBO);
        end
        plot(BETA,xDEL, ...
            'DisplayName',['Solar Z_0 = ' num2str(DELO) '\circ']);
        hold on;
        ylim([0 90]); xlim([0 35]);
        xlabel('\beta [deg]'); ylabel('Solar Zenith at this \beta [deg]');
        title(['\Delta \phi LOS \rightarrow Sun = ' num2str(PSIO) '\circ']);
        set(gca,'fontsize',14,'fontweight','bold');
    end
    if (j == 4)
        k = legend('location','southeast');
        k.FontSize = 9;
    end
    j = j + 1;
end

%% *source zenith angle at points along a line-of-sight*
j = 1;
figure('color','white','units','pixels','position',[200 150 1000 800]);
for PSIO = 0:60:180  % (deg) azimuth subtended between LOS and line to Sun
    subplot(2,2,j);
    IARBO = 0; % not a special case
    for DELO = 5:5:45 % (deg) Sun's zernith
        BETA = 1:34; % (deg) Earth center angle along the LOS
        xPSI = zeros(size(BETA));
        for i = 1:numel(BETA)
            [xPSI(i),~] = PSI(PSIO,DELO,BETA(i),IARBO);
        end
        plot(BETA,xPSI, ...
            'DisplayName',['Solar Z_0 = ' num2str(DELO) '\circ']);
        hold on;
        xlim([0 35]); ylim([0 180]); set(gca,'ytick',[0 30 60 90 120 150 180]);
        xlabel('\beta [deg]'); ylabel('Solar Zenith at this \beta [deg]');
        title(['\Delta \phi LOS \rightarrow Sun = ' num2str(PSIO) '\circ']);
        set(gca,'fontsize',14,'fontweight','bold');
    end
    if (j == 4)
        k = legend('location','southeast');
        k.FontSize = 9;
    end
    j = j + 1;
end


%% *solar scattering*
%  for the inputs chosen, the plots look the same as the zenith at path pt
%  above
IARB = 0;
j = 1;
figure('color','white','units','pixels','position',[200 150 1000 800]);
for PSI = 0:60:180  % (deg) azimuth subtended between LOS and line to Sun
    subplot(2,2,j);
    IARBO = 0; % not a special case
    for SOURCEZEN = 5:5:45 % (deg) Source zernith
        
        PTHZEN = 0:90; % (deg) Path Zenisty
        xSCTANG = zeros(size(PTHZEN));
        for i = 1:numel(PTHZEN)
            [xSCTANG(i)] = SCTANG(SOURCEZEN,PTHZEN(i),PSI,IARB);
        end
        plot(PTHZEN,xSCTANG, ...
            'DisplayName',['Solar Z_0 = ' num2str(SOURCEZEN) '\circ']);
        hold on;
        ylim([0 90]); xlim([0 35]);
        xlabel('Path Zenith [deg]'); ylabel('Scattering Angle [deg]');
        title(['\Delta \phi LOS \rightarrow Sun = ' num2str(PSI) '\circ']);
        set(gca,'fontsize',14,'fontweight','bold');
    end

📃3 参考文献

部分理论来源于网络,如有侵权请联系删除。

[1]Meg Noah (2022). LOWTRAN7 Sun and Moon Models.

📋4 Matlab代码及文章阅读

  • 3
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
以下是一个基于暗通道先验的大气透射率估计图的 Matlab 代码: ```matlab function [t, A] = dark_channel(im, w) % 计算暗通道图像和大气透射率 % im:输入图像 % w:窗口大小 [h, w, ~] = size(im); n = h*w; im_flat = reshape(im, n, 3); % 将图像转换为[n,3]的二维矩阵 % 计算每个像素的最小值,得到暗通道图像 dc = min(im_flat, [], 2); dc = reshape(dc, h, w); % 计算暗通道图像的平均值,得到全局大气光A A = mean(reshape(im_flat(repmat(dc, [1 3]) == dc, :), [], 3)); % 计算大气透射率t t = 1 - 0.95*dc/max(A) + 0.05; t = min(max(t, 0), 1); % 用引导滤波和软抠图对t进行精细化处理 r = 60; % 引导滤波器窗口大小 eps = 0.0001; % 引导滤波器参数 t_smooth = guided_filter(im2double(im), t, r, eps); t_smooth = soft_matting(im2double(im), t_smooth, 0.1, 1e-5); % 返回精细化的大气透射率和全局大气光 t = reshape(t_smooth, h, w); A = reshape(A, 1, 1, 3); end ``` 其中,`im`是输入图像,`w`是窗口大小,返回值`t`是精细化的大气透射率图像,`A`是全局大气光。该函数首先计算暗通道图像和全局大气光,然后计算大气透射率。最后,使用引导滤波和软抠图对大气透射率进行精细化处理。 引导滤波和软抠图的实现可以使用以下两个函数: ```matlab function q = guided_filter(I, p, r, eps) % 引导滤波器 % I:输入图像 % p:导向图像 % r:窗口半径 % eps:正则化参数 [h, w, ~] = size(I); n = box_filter(ones(h, w), r); mean_I = box_filter(I, r) ./ n; mean_p = box_filter(p, r) ./ n; mean_Ip = box_filter(I.*p, r) ./ n; cov_Ip = mean_Ip - mean_I .* mean_p; mean_II = box_filter(I.*I, r) ./ n; var_I = mean_II - mean_I .* mean_I; a = cov_Ip ./ (var_I + eps); b = mean_p - a .* mean_I; mean_a = box_filter(a, r) ./ n; mean_b = box_filter(b, r) ./ n; q = mean_a .* I + mean_b; end function alpha = soft_matting(I, alpha, lambda, epsilon) % 软抠图 % I:输入图像 % alpha:二值分割图像 % lambda:平滑参数 % epsilon:正则化参数 [h, w, ~] = size(I); n = h*w; I_flat = reshape(I, n, 3); alpha_flat = reshape(alpha, n, 1); % 计算颜色相似度矩阵W eps = 1e-7; % 防止除以0 W = zeros(n, n); for i = 1:n for j = i+1:n d = sum((I_flat(i,:) - I_flat(j,:)).^2); W(i,j) = exp(-d/lambda); W(j,i) = W(i,j); end end % 计算矩阵D和L D = diag(sum(W, 2)); L = D - W; % 计算alpha的前景和背景权重 f = alpha_flat; b = 1 - alpha_flat; df = spdiags(f, 0, n, n); db = spdiags(b, 0, n, n); wf = sum(W, 2); wb = sum(W, 1)'; Lf = df*L*df + epsilon*spdiags(wf, 0, n, n); Lb = db*L*db + epsilon*spdiags(wb, 0, n, n); vf = df*alpha_flat; vb = db*(1-alpha_flat); % 解线性方程组获得alpha的最优解 A = [Lf, vf; vb', sum(b)]; x = A\[vf; zeros(n,1)]; alpha_flat = x(1:n); % 返回精细化的分割图像 alpha = reshape(alpha_flat, h, w); end ``` 这两个函数分别实现了引导滤波和软抠图。`guided_filter`函数使用了引导滤波器,它通过将输入图像和导向图像的均值、协方差等统计信息进行计算,来实现对导向图像的滤波。`soft_matting`函数实现了软抠图,它通过计算颜色相似度矩阵和前景、背景权重,来对二值分割图像进行精细化处理。 使用以上函数,可以得到一个基于暗通道先验的大气透射率估计图,并采用软抠图法和引导滤波法得到精细化大气透射率图。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

荔枝科研社

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值