Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match CDRv4 at 25km #141

Merged
merged 6 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions seaice_ecdr/initial_daily_ecdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,12 @@ def get_flagmask(
return flagmask


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


def compute_initial_daily_ecdr_dataset(
*,
date: dt.date,
Expand Down Expand Up @@ -815,12 +821,12 @@ def compute_initial_daily_ecdr_dataset(
line_37v37h=bt_coefs["vh37_iceline"],
)

# TODO: note that we are using bt_<vars> not <_day_si> vars...
# NOTE: note that we are using bt_<vars> 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 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, :, :],
Expand All @@ -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"],
Expand Down
8 changes: 5 additions & 3 deletions seaice_ecdr/platforms/default_platform_start_dates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
22 changes: 16 additions & 6 deletions seaice_ecdr/temporal_composite_daily.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -525,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"
trey-stafford marked this conversation as resolved.
Show resolved Hide resolved
# )

# 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:
Expand Down