Skip to content

Commit

Permalink
update v1.1.0
Browse files Browse the repository at this point in the history
In this version, we
- update the evaluation code
- add annotations to map the steps in Figure 1 to different code sections in FindPolynyaMain.m
  • Loading branch information
Mou-si authored Aug 22, 2024
1 parent 7003d82 commit 07e5acc
Show file tree
Hide file tree
Showing 19 changed files with 1,354 additions and 854 deletions.
2 changes: 2 additions & 0 deletions Evaluate/CreateAllSets.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
FindPolynyaMain('NameList_DailyTracem')
FindPolynyaMain('NameList_DailyTracep')
FindPolynyaMain('NameList_NoFastIce')
FindPolynyaMain('NameList_SIC30')
FindPolynyaMain('NameList_SIC40')
FindPolynyaMain('NameList_SIC50')
FindPolynyaMain('NameList_SIC60')
FindPolynyaMain('NameList_SIC70')
Expand Down
38 changes: 24 additions & 14 deletions Evaluate/Figure8.m
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@
ylabel('Polynya Numbers', 'FontSize', 8)

%%
axes('Position', [0.1, 0.12, 0.45, 0.38])
axes('Position', [0.1, 0.12, 0.47, 0.38])
yyaxis left
h = errorbar((5 : 8), ...
h = errorbar((7 : 10), ...
[nanmean(PSSM_125km_85_14d.Area), ...
nanmean(PSSM_125km_80_14d.Area), ...
nanmean(PSSM_125km_75_14d.Area), ...
Expand All @@ -135,39 +135,48 @@
set(h, 'LineStyle', 'None', 'Color', [0, 0 ,0.6], 'LineWidth', 1.5, ...
'Marker', 'o', 'MarkerSize', 5);
hold on
h = errorbar((1 : 4), ...
[nanmean(SIC_625km_50_20d.Area), ...
h = errorbar((1 : 6), ...
[nanmean(SIC_625km_30_20d.Area), ...
nanmean(SIC_625km_40_20d.Area), ...
nanmean(SIC_625km_50_20d.Area), ...
nanmean(SIC_625km_60_20d.Area), ...
nanmean(SIC_625km_70_20d.Area), ...
nanmean(SIC_625km_80_20d.Area)], ...
[nanstd(SIC_625km_50_20d.Area), ...
[nanstd(SIC_625km_30_20d.Area), ...
nanstd(SIC_625km_40_20d.Area), ...
nanstd(SIC_625km_50_20d.Area), ...
nanstd(SIC_625km_60_20d.Area), ...
nanstd(SIC_625km_70_20d.Area), ...
nanstd(SIC_625km_80_20d.Area)] ./ 2);
set(h, 'LineStyle', 'None', 'Color', [0.6, 0 ,0], 'LineWidth', 1.5, ...
'Marker', 'o', 'MarkerSize', 5);
set(gca, 'XLim', [0.2, 6.8], 'YLim', [0, 350000], ...
'xtick', 1 : 6, ...
'xticklabel', {'SIC50', 'SIC60', 'SIC70', 'SIC80', 'PSSM85', 'PSSM70'}, ...
set(gca, 'XLim', [0.2, 10.8], 'YLim', [0, 350000], ...
'xtick', 1 : 10, ...
'xticklabel', {'SIC30', 'SIC40', 'SIC50', 'SIC60', 'SIC70', 'SIC80', ...
'PSSM85', 'PSSM80', 'PSSM75', 'PSSM70'}, ...
'XTickLabelRotation', 45, ...
'FontSize', 8, ...
'YColor', 'k', 'XColor', 'k')
ylabel('Area (\times10^5 km^2)', 'FontSize', 8)

yyaxis right
h = bar((1 : 4), ...
[length(SIC_625km_50_20d.IDs{1}), ...
h = bar((1 : 6), ...
[length(SIC_625km_30_20d.IDs{1}), ...
length(SIC_625km_40_20d.IDs{1}), ...
length(SIC_625km_50_20d.IDs{1}), ...
length(SIC_625km_60_20d.IDs{1}), ...
length(SIC_625km_70_20d.IDs{1}), ...
length(SIC_625km_80_20d.IDs{1}); ...
length(SIC_625km_30_20d.IDs{2}), ...
length(SIC_625km_40_20d.IDs{2}), ...
length(SIC_625km_50_20d.IDs{2}), ...
length(SIC_625km_60_20d.IDs{2}), ...
length(SIC_625km_70_20d.IDs{2}), ...
length(SIC_625km_80_20d.IDs{2})], ...
'stacked');
set(h(1), 'LineStyle', 'None', 'BarWidth', 0.7, 'FaceColor', [0.9, 0.1, 0.1]);
set(h(2), 'LineStyle', 'None', 'BarWidth', 0.7, 'FaceColor', [0.8, 0.1, 0.1]);
h = bar((5 : 8), ...
h = bar((7 : 10), ...
[length(PSSM_125km_85_14d.IDs{1}), ...
length(PSSM_125km_80_14d.IDs{1}), ...
length(PSSM_125km_75_14d.IDs{1}), ...
Expand All @@ -179,10 +188,11 @@
'stacked');
set(h(1), 'LineStyle', 'None', 'BarWidth', 0.7, 'FaceColor', [0.1, 0.1, 0.9]);
set(h(2), 'LineStyle', 'None', 'BarWidth', 0.7, 'FaceColor', [0.8, 0.1, 0.1]);
set(gca, 'XLim', [0.2, 8.8], 'Ylim', [0, 250], ...
'xtick', 1 : 8, ...
set(gca, 'XLim', [0.2, 10.8], 'Ylim', [0, 250], ...
'xtick', 1 : 10, ...
'xticklabel', ...
{'SIC50', 'SIC60', 'SIC70', 'SIC80', 'PSSM85', 'PSSM80', 'PSSM75', 'PSSM70'}, ...
{'SIC30', 'SIC40', 'SIC50', 'SIC60', 'SIC70', 'SIC80', ...
'PSSM85', 'PSSM80', 'PSSM75', 'PSSM70'}, ...
'XTickLabelRotation', 45, ...
'FontSize', 8, ...
'YColor', 'k', 'XColor', 'k')
Expand Down
24 changes: 22 additions & 2 deletions Evaluate/GetAreaandUncertainty.m
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,23 @@
'Area', 'Area_U', 'IDs_d', 'IDs_y', 'IDs');

%%
Path = 'G:\DEEP-AAShare\SIC70_6.25km_20d\DEEP_s6250_AMSR_SIC_';
Path = 'G:\DEEP-AAShare\SIC30_6.25km_20d\DEEP_s6250_AMSR_SIC_';
[Area, IDs_d, IDs_y, IDs] = GetAreaNum(Time, Path, YearLength);
Area_U = bootstrp(length(Area), @mean, Area);
Area_U = [prctile(Area_U, 2.5), prctile(Area_U, 97.5)];
Area = Area * 6.25 * 6.25;
Area_U = Area_U * 6.25 * 6.25;
save([SavePath, 'SIC_6.25km_70_20d.mat'], ...
save([SavePath, 'SIC_6.25km_30_20d.mat'], ...
'Area', 'Area_U', 'IDs_d', 'IDs_y', 'IDs');

%%
Path = 'G:\DEEP-AAShare\SIC40_6.25km_20d\DEEP_s6250_AMSR_SIC_';
[Area, IDs_d, IDs_y, IDs] = GetAreaNum(Time, Path, YearLength);
Area_U = bootstrp(length(Area), @mean, Area);
Area_U = [prctile(Area_U, 2.5), prctile(Area_U, 97.5)];
Area = Area * 6.25 * 6.25;
Area_U = Area_U * 6.25 * 6.25;
save([SavePath, 'SIC_6.25km_40_20d.mat'], ...
'Area', 'Area_U', 'IDs_d', 'IDs_y', 'IDs');

%%
Expand All @@ -160,6 +170,16 @@
save([SavePath, 'SIC_6.25km_50_20d.mat'], ...
'Area', 'Area_U', 'IDs_d', 'IDs_y', 'IDs');

%%
Path = 'G:\DEEP-AAShare\SIC70_6.25km_20d\DEEP_s6250_AMSR_SIC_';
[Area, IDs_d, IDs_y, IDs] = GetAreaNum(Time, Path, YearLength);
Area_U = bootstrp(length(Area), @mean, Area);
Area_U = [prctile(Area_U, 2.5), prctile(Area_U, 97.5)];
Area = Area * 6.25 * 6.25;
Area_U = Area_U * 6.25 * 6.25;
save([SavePath, 'SIC_6.25km_70_20d.mat'], ...
'Area', 'Area_U', 'IDs_d', 'IDs_y', 'IDs');

%%
Path = 'G:\DEEP-AAShare\SIC80_6.25km_20d\DEEP_s6250_AMSR_SIC_';
[Area, IDs_d, IDs_y, IDs] = GetAreaNum(Time, Path, YearLength);
Expand Down
144 changes: 144 additions & 0 deletions Evaluate/NameLists/NameList_SIC30.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
function In = NameList
% Name list of main function
% you can run the function by FindPolyunyaMain.m
% Var Name
% TIME
% TimeTotal total time needs to detect polynyas
% StartTime time start to detect polynyas, default is
% the fisrt of TimeTotal NewYear
% READ SIC FILES
% SICFile a struct storing the information of SIC
% | files need to be read
% |-SICFile.Dir the path of the folder storing SIC files
% |-SICFile.Name1 name of SIC files before the timestamp
% |-SICFile.Name2 name of SIC files after the timestamp
% |-SICFile.LandMask land mask for SIC files
% SICLon longitude for SIC
% SICLat latitude for SIC
% DETECT OPEN SEA & ICE
% Lim the threshold for the openwater/ice
% LASTING OPEN WATER
% SeriesLength the length of time series to detect lasting
% openwater
% FrequencyThreshold the threshold for detecting lasting
% openwater
% MapRange remapping to get membership of openwater
% WARM SEASON
% HeatLossFlag is the HeatLoss Mode for judging warm
% season on
% RESTART
% RestartDir path of the folder to store restart files
% RestartStride the stride to store a restart file

%%
clear all;
%% Time
In.TimeTotal = ... The time you want to identify polynyas
[datetime('2003-02-01') : datetime('2003-10-15'), ...
datetime('2004-02-01') : datetime('2011-08-31'), ...
datetime('2012-08-01') : datetime('2023-01-31')];
% In.TimeTotal = ... The time you want to identify polynyas
% datetime('2017-02-01') : datetime('2018-01-31');
TimeTotalmmdd = str2double(string(datestr(In.TimeTotal, 'mmdd')));
In.TimeTotal = In.TimeTotal(TimeTotalmmdd >= 0401 & TimeTotalmmdd <= 1031);
% In.TimeTotal = [In.TimeTotal(1 : 2813), datetime('2017-11-01') : datetime('2017-11-15'), In.TimeTotal(2814 : end)];
% datetime('2014-02-01') : datetime('2015-01-31');

In.TimeGap = [datetime('2003-12-01'), datetime('2012-07-01')];
In.StartTime = In.TimeTotal(1);
In.NewYear = '02-01';

%% Read Data
% we will read data as [SICDir \ SICFileName1 Timestr SICFileName2]
In.SICFile.Dir = ...
'G:\Antaratica_ASI_SIC_6250';
In.SICFile.Name1 = ...% {'asi-AMSR2-s3125-'};
{'asi-s6250-', 'asi-s6250-', 'asi-AMSR2-s6250-'};
In.SICFile.Name2 = ...% {'-v5.4.hdf'};
{'-v5.4.hdf', '-v5.4.hdf', '-v5.4.hdf'};
In.SICFile.VarName = ...
'ASI Ice Concentration';
% read the Lon & Lat
In.SICLon = hdfread(...
[In.SICFile.Dir, '\LongitudeLatitudeGrid-s6250-Antarctic.hdf'], 'Longitudes');
In.SICLat = hdfread(...
[In.SICFile.Dir, '\LongitudeLatitudeGrid-s6250-Antarctic.hdf'], 'Latitudes');
% In.SICLon = load('G:\Antaratica_ASI_SIC_6250\LonLat_25000.mat');
% In.SICLat = In.SICLon.Lat;
% In.SICLon = In.SICLon.Lon;
% read land mask
In.SICFile.LandMask = ncread([In.SICFile.Dir, '\LandMaskAMSR6250.nc'], 'LandMask');
% set the resolution
In.Resolution = 6.25;

%% Land Fast Ice
In.FastIceFlag = FastIceParameter;

%% Detect Opensea & Ice
In.Lim = ... The threshold for the openwater/ice
30;

%% Lasting Open Water
In.SeriesLength = ... The length of identify time series
14;
% the FrequencyThreshold is calculated as FrequencyThreshold ./ SeriesLength
In.FrequencyThres = ... the threshold for frequent openwater. it is a 1*2 vector
[0.7, 0.5];

In.MapRange = ... Remapping for membership of openwater
[30, 30];

%% Match
global IDCpacity
IDCpacity = ... It is a constant for OverlapDye.m. If it
1000000;

%% Physical ID to Logical ID
global ReincarnationTol
ReincarnationTol = ... The tolerance for the Reincarnation
4;
In.CombineMergeThres = 0.5;
In.MinPolynyaArea = 3;

%% Rebirth
In.RebirthOverlapThres = ...
0.2;
In.RebirthOverlapThresYear = ...
0.4;
In.TimeFilterAfter = ...
20;

%% Warm Season
% In.HeatLossFlag = HeatLossParms;

%% Air Temperature Judge
In.TempeJudgeFlag = AirTemperatureParameter;

%% Cross Year Track
In.CrossYearOverlapThres = ...
0.2;
In.SeriesLengthThres = ...
0.3;
In.SeriesLengthThresYear = ...
0.2;

%% Restart
In.RestartDir = ...
'C:\Users\13098\Documents\冰间湖识别\Data\tempData';
In.RestartStride = ...
120;

%% CacheFile
In.Cache = ...
'C:\Users\13098\Documents\冰间湖识别\Data\tempData';

%% SaveResults
In.Save.Path = ...
'G:\DEEP-AAShare\SIC30_6.25km_20d';
In.Save.FileName1 = ...
'DEEP_s6250_AMSR_SIC_';
In.Save.FileName2 = ...
'_v1.0.nc';

end
% run the function by FindPolyunyaMain.m
Loading

0 comments on commit 07e5acc

Please sign in to comment.