Skip to content

Commit 0286f16

Browse files
committed
matlab func docs
1 parent 881b94f commit 0286f16

45 files changed

Lines changed: 545 additions & 408 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lib/io/PLidar_read_data.m

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
function [data] = PLidar_read_data(mDate, folder, dVersion, hRange, tRange)
22
% PLIDAR_READ_DATA read Polarization lidar data.
3-
% Example:
4-
% [data] = PLidar_read_data(mDate, folder, dVersion, hRange)
5-
% Inputs:
3+
%
4+
% USAGE:
5+
% [data] = PLidar_read_data(mDate, folder, dVersion, hRange, tRange)
6+
%
7+
% INPUTS:
68
% mDate: datenum
79
% measurement date.
810
% folder: char
@@ -17,7 +19,8 @@
1719
% bottom and top of the range you want to load. (m)
1820
% tRange: 2-element array
1921
% temporal range for data profiles.
20-
% Outputs:
22+
%
23+
% OUTPUTS:
2124
% data: struct
2225
% height: array
2326
% height of each bin above ground. (m)
@@ -39,12 +42,14 @@
3942
% overflow flag for CH1. ('1' means overflowed)
4043
% overflowCH2: matrix (height * time)
4144
% overflow flag for CH2. ('1' means overflowed)
42-
% History:
43-
% 2020-03-15. First Edition by Zhenping
44-
% 2022-05-20. Add CMA polarization data by Zhenping
45-
% 2025-05-09. Add WHU 1030 vis lidar data by Zhenping
46-
% Contact:
47-
% zp.yin@whu.edu.cn
45+
%
46+
% EXAMPLE:
47+
%
48+
% HISTORY:
49+
% 2020-03-15: First Edition by Zhenping
50+
% 2022-05-20: Add CMA polarization data by Zhenping
51+
% 2025-05-09: Add WHU 1030 vis lidar data by Zhenping
52+
% .. Authors: - zp.yin@whu.edu.cn
4853

4954
if nargin < 4
5055
error('Not enough inputs');

lib/io/PLidar_readdata.m

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
function data = PLidar_readdata(folder, tRange, hRange, varargin)
22
% PLIDAR_READDATA read PLidar data in the given temporal and spatial range.
3-
% Examples:
4-
% data = PLidar_readdata('/data/PLidar', ...
5-
% [datenum(2011, 1, 1), datenum(2011, 1, 2, 12, 0, 0)], ...
6-
% [300, 5000]);
7-
% Inputs:
3+
%
4+
% USAGE:
5+
% data = PLidar_readdata(folder, tRange, hRange)
6+
%
7+
% INPUTS:
88
% folder: char
99
% base directory of the PLidar data.
1010
% tRange: 2-element array
1111
% start and stop time of the data that you want to load.
1212
% hRange: 2-element array
1313
% bottom and top height of the data that you want to load. [m]
14-
% Keywords:
14+
%
15+
% KEYWORDS:
1516
% dVersion: integer
1617
% data version (default: 2).
1718
% 1: glued by old algorithm with 30-m resolution
1819
% 2: glued by new algorithm with 3.75-m resolution (default)
1920
% 3: CMA polarization lidar
2021
% 4: WHU 1030 vis lidar
21-
% Returns:
22+
%
23+
% OUTPUTS:
2224
% data: struct
2325
% time: (datenum) array
2426
% measurement time of each data profile.
@@ -38,8 +40,10 @@
3840
% background signal for each profile at channel 1.
3941
% BGCH2: array
4042
% background signal for each profile at channel 2.
41-
% History:
42-
% 2020-03-03 First version by Zhenping
43+
%
44+
% HISTORY:
45+
% 2020-03-03: first edition by Zhenping
46+
% .. Authors: - zp.yin@whu.edu.cn
4347

4448
p = inputParser;
4549
p.KeepUnmatched = true;

lib/io/convert_mat_2_txt.m

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
function convert_mat_2_txt(matFile, txtFile)
22
% CONVERT_MAT_2_TXT convert mat file to txt file.
3-
% Inputs:
3+
%
4+
% USAGE:
5+
% [output] = convert_mat_2_txt(matFile, txtFile)
6+
%
7+
% INPUTS:
48
% matFile: char
59
% absolute path of the MAT file.
610
% txtFile: char
711
% absolute path of the TXT file.
8-
% History:
9-
% 2020-07-06. First edition by Zhenping
10-
% Contact:
11-
% zp.yin@whu.edu.cn
12+
%
13+
% OUTPUTS:
14+
% output
15+
%
16+
% EXAMPLE:
17+
%
18+
% HISTORY:
19+
% 2020-07-06: First edition by Zhenping
20+
% .. Authors: - zp.yin@whu.edu.cn
1221

1322
if exist(matFile, 'file') ~= 2
1423
return;

lib/io/loadLidarData.m

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
function [data] = loadLidarData(lidarFolder, stationID, tRange, varargin)
22
% LOADLIDARDATA load lidar data.
3+
%
34
% USAGE:
4-
% [data] = loadLidarData(lidarFolder, stationID, tRange, varargin)
5+
% [data] = loadLidarData(lidarFolder, stationID, tRange)
6+
%
57
% INPUTS:
68
% lidarFolder: char
79
% folder of lidar data.
@@ -11,19 +13,21 @@
1113
% start/stop time of lidar data request.
1214
% channelIndex: array
1315
% channel index.
16+
%
1417
% KEYWORDS:
1518
% hRange: 2-element array
1619
% vertical range of lidar data request (default: [0, 15000]). (m)
20+
%
1721
% OUTPUTS:
1822
% data: struct
1923
% altitude: numeric
2024
% height: array
2125
% mTime: array
2226
% rawSig: matrix (height x time)
23-
% EXAMPLE:
27+
%
2428
% HISTORY:
2529
% 2021-07-21: first edition by Zhenping
26-
% .. Authors: - zhenping@tropos.de
30+
% .. Authors: - zp.yin@whu.edu.cn
2731

2832
p = inputParser;
2933
p.KeepUnmatched = true;

lib/io/load_settings.m

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
function config = load_settings(settingFile, settingTemplate)
22
% LOAD_SETTINGS load setting file and overwrite the template settings.
3-
% Inputs:
3+
%
4+
% USAGE:
5+
% config = load_settings(settingFile, settingTemplate)
6+
%
7+
% INPUTS:
48
% settingFile: char
59
% absolute path of the setting file (YAML).
610
% settingTemplate: char
711
% absolute path of the template setting file (YAML).
8-
% Outputs:
12+
%
13+
% OUTPUTS:
914
% config: struct
1015
% settings.
11-
% History:
12-
% 2020-07-08. First edition by Zhenping.
13-
% Contact:
14-
% zp.yin@whu.edu.cn
16+
%
17+
% HISTORY:
18+
% 2020-07-08: First edition by Zhenping.
19+
% .. Authors: - zp.yin@whu.edu.cn
1520

1621
if exist(settingFile, 'file') ~= 2
1722
error('setting file does not exist.\n%s', settingFile);

lib/io/read_ERA5.m

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
function [alt, temp, pres, relh, ERA5file, wind, wins] = read_ERA5(measTime, ERA5site, folder)
22
% READ_ERA5 read the ERA5 file
3-
% Example:
4-
% [alt, temp, pres, relh] = read_ERA5(measTime, ERA5site, folder)
5-
% Inputs:
3+
%
4+
% USAGE:
5+
% [alt, temp, pres, relh, ERA5file, wind, wins] = read_ERA5(measTime, ERA5site, folder)
6+
%
7+
% INPUTS:
68
% measTime: datenum
79
% measurement time.
810
% ERA5site: char
911
% the location for ERA5 site.
10-
% Outputs:
12+
%
13+
% OUTPUTS:
1114
% alt: array
1215
% altitute for each range bin. [m]
1316
% temp: array
@@ -25,10 +28,12 @@
2528
% wind direction. [degree]
2629
% wins: array
2730
% wind speed. [m/s]
28-
% History:
29-
% 2020-10-26. First Edition by Zhenping
30-
% Contact:
31-
% zp.yin@whu.edu.cn
31+
%
32+
% EXAMPLE:
33+
%
34+
% HISTORY:
35+
% 2020-10-26: first edition by Zhenping
36+
% .. Authors: - zp.yin@whu.edu.cn
3237

3338
[thisyear, thismonth, thisday, ~, ~, ~] = datevec(measTime);
3439
dirInfo = dir(fullfile(folder, ERA5site, sprintf('%04d', thisyear), ...

lib/io/read_gdas1.m

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
function [alt, temp, pres, relh, gdas1file] = read_gdas1(measTime, gdas1site, folder)
22
% READ_GDAS1 read the gdas1 file
3-
% Example:
4-
% [alt, temp, pres, relh] = read_gdas1(measTime, gdas1site, folder)
5-
% Inputs:
3+
%
4+
% USAGE:
5+
% [alt, temp, pres, relh, gdas1file] = read_gdas1(measTime, gdas1site, folder)
6+
%
7+
% INPUTS:
68
% measTime: datenum
79
% measurement time.
810
% gdas1site: char
911
% the location for gdas1. Our server will automatically produce the
1012
% gdas1 products for all our pollynet location. You can find it in
1113
% /lacroshome/cloudnet/data/model/gdas1
12-
% Outputs:
14+
%
15+
% OUTPUTS:
1316
% alt: array
1417
% altitute for each range bin. [m]
1518
% temp: array
@@ -22,11 +25,11 @@
2225
% relative humidity for each range bin. If no valid data, NaN will be
2326
% filled. [%]
2427
% gdas1file: char
25-
% filename of gdas1 file.
26-
% History:
27-
% 2018-12-22. First Edition by Zhenping
28-
% Contact:
29-
% zhenping@tropos.de
28+
% filename of gdas1 file.
29+
%
30+
% HISTORY:
31+
% 2018-12-22: First Edition by Zhenping
32+
% .. Authors: - zp.yin@whu.edu.cn
3033

3134
[thisyear, thismonth, thisday, thishour, ~, ~] = ...
3235
datevec(round(measTime / datenum(0, 1, 0, 3, 0, 0)) * ...

lib/io/read_gridTemp.m

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
function [temp2D] = read_gridTemp(mTime, altitude, varargin)
2-
% READ_GRIDTEMP read gridded temperature field.
3-
% Example:
2+
% READ_GRIDTEMP description
3+
%
4+
% USAGE:
45
% % Usecase 1: read GDAS1 data
56
% temp2D = read_gridTemp(mTime, altitude, 'meteor_data', 'GDAS1', 'station', 'wuhan', 'GDAS1Folder', '/GDAS1');
67
% % Usecase 2: read Radiosonde data
78
% temp2D = read_gridTemp(mTime, altitude, 'meteor_data', 'Radiosonde', 'RadiosondeFolder', '/Radiosonde', 'station', 'wuhan');
89
% % Usecase 3: read ERA-5 data.
910
% temp2D = read_gridTemp(mTime, altitude, 'meteor_data', 'ERA-5', 'ERA5Folder', '/ERA-5', 'station', 'wuhan');
10-
% Inputs:
11+
%
12+
% INPUTS:
1113
% mTime: array
1214
% measurement time. (UTC)
1315
% altitude: array
1416
% height above mean sea level. (m)
15-
% Keywords:
17+
%
18+
% KEYWORDS:
1619
% meteor_data: char
1720
% meteorological data source.
1821
% 'GDAS1' (default), 'Radiosonde', or 'ERA-5'
@@ -28,13 +31,14 @@
2831
% - 2: radiosonde file for MUA (default)
2932
% ERA5Folder: char
3033
% ERA-5 data folder.
31-
% Outputs:
34+
%
35+
% OUTPUTS:
3236
% temp2D: matrix (altitude * time)
3337
% gridded temperature.
34-
% History:
35-
% 2020-05-28. First Edition by Zhenping
36-
% Contact:
37-
% zp.yin@whu.edu.cn
38+
%
39+
% HISTORY:
40+
% 2020-05-28: first edition by Zhenping
41+
% .. Authors: - zp.yin@whu.edu.cn
3842

3943
p = inputParser;
4044
p.KeepUnmatched = true;

lib/io/read_gridTemp_ERA5.m

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
function temp2D = read_gridTemp_ERA5(mTime, altitude, folder, ERA5site, deltaTime)
22
% READ_GRIDTEMP_ERA5 read gridded ERA5 data
3-
% Example:
3+
%
4+
% USAGE:
45
% temp2D = read_gridTemp_ERA5(mTime, altitude, folder, ERA5site, deltaTime)
5-
% Inputs:
6+
%
7+
% INPUTS:
68
% mTime: array
79
% measurement time. (UTC)
810
% altitude: array
@@ -13,14 +15,15 @@
1315
% ERA5 site (default: 'wuhan').
1416
% deltaTime: numeric
1517
% delta time for profile searching.
16-
% Outputs:
18+
%
19+
% OUTPUTS:
1720
% temp: matrix (altitude * time)
1821
% temperature for each range bin. If no valid data, NaN will be
1922
% filled. [C]
20-
% History:
21-
% 2020-10-26. First Edition by Zhenping
22-
% Contact:
23-
% zp.yin@whu.edu.cn
23+
%
24+
% HISTORY:
25+
% 2020-10-26: First Edition by Zhenping
26+
% .. Authors: - zp.yin@whu.edu.cn
2427

2528
if ~ exist('ERA5site', 'var')
2629
ERA5site = 'wuhan';

0 commit comments

Comments
 (0)