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

Return full ensemble prediction data, in addition to mean #292

Open
bnubald opened this issue Aug 8, 2024 · 0 comments
Open

Return full ensemble prediction data, in addition to mean #292

bnubald opened this issue Aug 8, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@bnubald
Copy link
Collaborator

bnubald commented Aug 8, 2024

  • IceNet version: v0.2.8/v0.2.9_dev

Description

Would be nice to be able to optionally get the raw ensemble prediction data as a return to this function.

def get_prediction_data(root: object, name: object, date: object) -> tuple:
"""
:param root:
:param name:
:param date:
:return:
"""
logging.info("Post-processing {}".format(date))
glob_str = os.path.join(root, "results", "predict", name, "*",
date.strftime("%Y_%m_%d.npy"))
np_files = glob.glob(glob_str)
if not len(np_files):
logging.warning("No files found")
return None
data = [np.load(f) for f in np_files]
data = np.array(data)
ens_members = data.shape[0]
logging.debug("Data read from disk: {} from: {}".format(
data.shape, np_files))
return np.stack([data.mean(axis=0), data.std(axis=0)],
axis=-1).squeeze(), ens_members

This function reads the prediction result of different ensembles from individual numpy files and returns: (mean sea ice concentration, number of ensemble members)

Would like to update to (mean sea ice concentration, full ensemble sea ice concentration, number of ensemble members). Although, latter variable is somewhat redundant, if full ensemble data is returned.

Useful if wanting to process individual ensemble results rather than just the mean.

@bnubald bnubald added the enhancement New feature or request label Aug 8, 2024
@bnubald bnubald added this to the v0.2.9 milestone Aug 8, 2024
@bnubald bnubald self-assigned this Aug 8, 2024
bnubald added a commit to bnubald/icenet that referenced this issue Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant