- Distance should be calculated from cyclone eye and each lightning location.
- Flashes that are within 300km range should be filtered out.
- Computing the angle for these lightnings
Distribution of Lightning in different circles for different distances
조회 수: 4 (최근 30일)
이전 댓글 표시
Consider the cyclone eye cordinate is 15.0, 88.4. The lightning data is E:\LIGHT\a.nc
[ncid = netcdf.open(ncFilePath, 'NOWRITE');
lat = netcdf.getVar(ncid, netcdf.inqVarID(ncid, 'lat'));
lon = netcdf.getVar(ncid, netcdf.inqVarID(ncid, 'lon'));
time = netcdf.getVar(ncid, netcdf.inqVarID(ncid, 'time'));
LTNG = netcdf.getVar(ncid, netcdf.inqVarID(ncid, 'lghtn_count'));
netcdf.close(ncid);]
So I wanted an Azimuthal distribution of lightning flashes in a circle within a distance of 300 km from the cyclone eye.
댓글 수: 0
답변 (1개)
Shishir Reddy
2024년 9월 9일
Hi Joydeb
As per my understanding, for a given data of lightning flashes, you would like to analyse the azimuthal distribution of flashes that are within a 300 km radius from the cyclone eye. I am assuming that you have latitudes, longitudes of all the lightning flashes and they are stored in ‘lat’ and ‘lon’ vectors respectively. Since I have the limited understanding of the data, here are some general steps that can be followed.
Refer to the sample MATLAB script below for implementation of these steps:
eyeLat = 15.0;
eyeLon = 88.4;
for i = 1:length(lat)
dLat = deg2rad(lat(i) - eyeLat);
dLon = deg2rad(lon(i) - eyeLon);
a = sin(dLat/2)^2 + cos(deg2rad(eyeLat)) * cos(deg2rad(lat(i))) * sin(dLon/2)^2;
c = 2 * atan2(sqrt(a), sqrt(1-a));
distances(i) = 6371 * c; % Earth radius in kilometers
azimuths(i) = atan2(sin(dLon) * cos(deg2rad(lat(i))), ...
cos(deg2rad(eyeLat)) * sin(deg2rad(lat(i))) -sin(deg2rad(eyeLat)) * cos(deg2rad(lat(i))) * cos(dLon));
end
withinRadius = distances <= radius;
filteredAzimuths = azimuths(withinRadius);
Finally, the results can be analysed by plotting using the ‘polarhistogram’ function.
polarhistogram(filteredAzimuths, 36); % 36 bins for each 10-degree intervals
For more information regarding ‘polarhistogram’ function, kindly refer the following documentation
I hope this helps.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!