From 8ffaf9be9dce8c6d812de337f2108ac8cccbb9ff Mon Sep 17 00:00:00 2001 From: Scott Stewart Date: Thu, 12 Sep 2024 22:32:37 -0600 Subject: [PATCH 1/6] fix use of platform.id --- seaice_ecdr/initial_daily_ecdr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seaice_ecdr/initial_daily_ecdr.py b/seaice_ecdr/initial_daily_ecdr.py index 5d449f47..78f65f1e 100644 --- a/seaice_ecdr/initial_daily_ecdr.py +++ b/seaice_ecdr/initial_daily_ecdr.py @@ -820,7 +820,7 @@ def compute_initial_daily_ecdr_dataset( # NOTE: cdralgos uses ret_linfit1() for NH sets 1,2 and SH set2 # and uses ret_linfit2() for NH set 2 pre_AMSR_platforms = ("n07", "F08", "F11", "F13", "F17") - if hemisphere == "south" and platform in pre_AMSR_platforms: + if hemisphere == "south" and platform.id in pre_AMSR_platforms: bt_coefs["v1937_iceline"] = bt.get_linfit( land_mask=ecdr_ide_ds["non_ocean_mask"].data, tb_mask=ecdr_ide_ds["invalid_tb_mask"].data[0, :, :], From dc3c59ac28a13325c3b54e6a8818547d06092f07 Mon Sep 17 00:00:00 2001 From: Scott Stewart Date: Fri, 13 Sep 2024 10:51:09 -0600 Subject: [PATCH 2/6] abstract is_pre_AMSR() function --- seaice_ecdr/initial_daily_ecdr.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/seaice_ecdr/initial_daily_ecdr.py b/seaice_ecdr/initial_daily_ecdr.py index 78f65f1e..b3f9b615 100644 --- a/seaice_ecdr/initial_daily_ecdr.py +++ b/seaice_ecdr/initial_daily_ecdr.py @@ -354,6 +354,12 @@ def get_flagmask( return flagmask +def is_pre_AMSR_platform(platform: SUPPORTED_PLATFORM_ID): + """Returns True for SMMR, SSMI, SSMIS platforms""" + pre_AMSR_platforms = ("n07", "F08", "F11", "F13", "F17") + return platform.id in pre_AMSR_platforms + + def compute_initial_daily_ecdr_dataset( *, date: dt.date, @@ -815,12 +821,12 @@ def compute_initial_daily_ecdr_dataset( line_37v37h=bt_coefs["vh37_iceline"], ) - # TODO: note that we are using bt_ not <_day_si> vars... + # NOTE: note that we are using bt_ not <_day_si> vars... + # The bt_vars have been adjusted to match F13 TB distributions # NOTE: cdralgos uses ret_linfit1() for NH sets 1,2 and SH set2 # and uses ret_linfit2() for NH set 2 - pre_AMSR_platforms = ("n07", "F08", "F11", "F13", "F17") - if hemisphere == "south" and platform.id in pre_AMSR_platforms: + if hemisphere == "south" and is_pre_AMSR_platform(platform.id): bt_coefs["v1937_iceline"] = bt.get_linfit( land_mask=ecdr_ide_ds["non_ocean_mask"].data, tb_mask=ecdr_ide_ds["invalid_tb_mask"].data[0, :, :], @@ -829,7 +835,8 @@ def compute_initial_daily_ecdr_dataset( lnline=bt_coefs_init["v1937_lnline"], add=bt_coefs["add2"], water_mask=ecdr_ide_ds["bt_weather_mask"].data[0, :, :], - # these default to None; so using "ret_linfit1(), not ret_linfit2()" + # these default to None in bt.get_linfit() + # this is equivalent to using "ret_linfit1(), not ret_linfit2()" # tba=bt_h37, # iceline=bt_coefs["vh37_iceline"], # ad_line_offset=bt_coefs["ad_line_offset"], From 39ed8f70896cf946e245518e67f72361017bc31a Mon Sep 17 00:00:00 2001 From: Scott Stewart Date: Fri, 13 Sep 2024 10:52:22 -0600 Subject: [PATCH 3/6] remove debug output file --- seaice_ecdr/temporal_composite_daily.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/seaice_ecdr/temporal_composite_daily.py b/seaice_ecdr/temporal_composite_daily.py index ef534158..5d92d8e9 100644 --- a/seaice_ecdr/temporal_composite_daily.py +++ b/seaice_ecdr/temporal_composite_daily.py @@ -254,10 +254,6 @@ def temporally_composite_dataarray( if daily_climatology_mask is not None: temp_comp_2d[daily_climatology_mask] = 0 - if daily_climatology_mask is not None: - daily_climatology_mask.tofile("dailyclimmask.dat") - print("WROTE dailyclimmask.dat") - # Initialize arrays initial_missing_locs = np.isnan(temp_comp_2d.data) From 5f33c18d255c80599e682ebbf4877c56c9fde6fc Mon Sep 17 00:00:00 2001 From: Scott Stewart Date: Fri, 13 Sep 2024 10:54:05 -0600 Subject: [PATCH 4/6] fix platform.id typo --- seaice_ecdr/initial_daily_ecdr.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seaice_ecdr/initial_daily_ecdr.py b/seaice_ecdr/initial_daily_ecdr.py index b3f9b615..7f245627 100644 --- a/seaice_ecdr/initial_daily_ecdr.py +++ b/seaice_ecdr/initial_daily_ecdr.py @@ -354,10 +354,10 @@ def get_flagmask( return flagmask -def is_pre_AMSR_platform(platform: SUPPORTED_PLATFORM_ID): +def is_pre_AMSR_platform(platform_id: SUPPORTED_PLATFORM_ID): """Returns True for SMMR, SSMI, SSMIS platforms""" pre_AMSR_platforms = ("n07", "F08", "F11", "F13", "F17") - return platform.id in pre_AMSR_platforms + return platform_id in pre_AMSR_platforms def compute_initial_daily_ecdr_dataset( From 2ceb5e54b607c288bc48e42060c22c04715804ec Mon Sep 17 00:00:00 2001 From: Scott Stewart Date: Sat, 14 Sep 2024 00:31:37 -0600 Subject: [PATCH 5/6] use CDRv4 dailyclim for SMMR, despite its errors --- seaice_ecdr/temporal_composite_daily.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/seaice_ecdr/temporal_composite_daily.py b/seaice_ecdr/temporal_composite_daily.py index 5d92d8e9..975135b2 100644 --- a/seaice_ecdr/temporal_composite_daily.py +++ b/seaice_ecdr/temporal_composite_daily.py @@ -521,12 +521,26 @@ def get_daily_climatology_mask( daily_ds = None if hemisphere == "north" and resolution == "25": + # New mask. Valid/invalid extends into landmask + # daily_ds = Dataset( + # "/share/apps/G02202_V5/v05r01_ancillary/ecdr-ancillary-psn25-dailyclim.nc" + # ) + + # Mask used in v04r00. Includes landmask and may have mismatches + # between landmask and ocean, especially in Southern Hemisphere daily_ds = Dataset( - "/share/apps/G02202_V5/v05r01_ancillary/ecdr-ancillary-psn25-dailyclim.nc" + "/share/apps/G02202_V5/v05r01_ancillary/ecdr-ancillary-psn25-smmr-invalid-ice-v04r00.nc" ) elif hemisphere == "south" and resolution == "25": + # New mask. Valid/invalid extends into landmask + # daily_ds = Dataset( + # "/share/apps/G02202_V5/v05r01_ancillary/ecdr-ancillary-pss25-dailyclim.nc" + # ) + + # Mask used in v04r00. Includes landmask and may have mismatches + # between landmask and ocean, especially in Southern Hemisphere daily_ds = Dataset( - "/share/apps/G02202_V5/v05r01_ancillary/ecdr-ancillary-pss25-dailyclim.nc" + "/share/apps/G02202_V5/v05r01_ancillary/ecdr-ancillary-pss25-smmr-invalid-ice-v04r00.nc" ) if daily_ds is None: From e9674255378e96041b1a47506d5763fe54b79c84 Mon Sep 17 00:00:00 2001 From: Scott Stewart Date: Sun, 15 Sep 2024 20:07:33 -0600 Subject: [PATCH 6/6] correct F17 start date if not using AMSR2 --- seaice_ecdr/platforms/default_platform_start_dates.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/seaice_ecdr/platforms/default_platform_start_dates.yml b/seaice_ecdr/platforms/default_platform_start_dates.yml index b128f207..52a7260a 100644 --- a/seaice_ecdr/platforms/default_platform_start_dates.yml +++ b/seaice_ecdr/platforms/default_platform_start_dates.yml @@ -10,9 +10,11 @@ cdr_platform_start_dates: # TODO: we do not currently support AMSRE at the 25km resolution # - platform_id: "ame" # AMSR-E is first AMSR sat # start_date: "2002-06-01" - # F17 starts while AMSR-E is up, on 2008-01-01. We don't use F17 until - # 2011-10-04. + # TODO: The following note is OBE. + # F17 starts while AMSR-E is up, on 2008-01-01. + # If using AMSR-E, don't use F17 until 2011-10-04. + # In CDRv4, F17 begins producing data 2008-01-01 - platform_id: "F17" - start_date: "2011-10-04" + start_date: "2008-01-01" - platform_id: "am2" start_date: "2012-07-02"