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

Add UKI to AIDA ice nucleation calibrations #460

Merged
merged 2 commits into from
Oct 18, 2024
Merged

Add UKI to AIDA ice nucleation calibrations #460

merged 2 commits into from
Oct 18, 2024

Conversation

amylu00
Copy link
Member

@amylu00 amylu00 commented Sep 19, 2024

Purpose

Add UKI calibration so we can compare to the EKI results and also have some error metrics.

To-do

  • what do we want to have in loss function? Freezing onset, gradient, or final ICNC?

Content

  • Calibrate J UKI function in calibration.jl
  • Update Calibrate J EKI function so that it works with newest version of EnsembleKalmanProcesses.jl

  • I have read and checked the items on the review checklist.

@amylu00 amylu00 self-assigned this Sep 19, 2024
Copy link

codecov bot commented Sep 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.98%. Comparing base (7667308) to head (aa1af87).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #460   +/-   ##
=======================================
  Coverage   96.98%   96.98%           
=======================================
  Files          41       41           
  Lines        1559     1559           
=======================================
  Hits         1512     1512           
  Misses         47       47           
Components Coverage Δ
src 98.76% <ø> (ø)
ext 69.79% <ø> (ø)

@amylu00
Copy link
Member Author

amylu00 commented Sep 27, 2024

When loss function is total evolution of ICNC, perfect model does well and passes unit tests. When loss function is catered to end of the simulation, the final ICNC matches better in AIDA calibrations, however, perfect model unit tests are prone to failing.

@@ -133,7 +133,7 @@ function perf_model_pseudo_data(FT, IN_mode, params, IC)
G_truth = run_model(params, coeff_true, IN_mode, FT, IC)
dim_output = length(G_truth)

Γ = 0.03 * LinearAlgebra.I * (maximum(G_truth) - minimum(G_truth))
Γ = 0.001 * LinearAlgebra.I * (maximum(G_truth) - minimum(G_truth))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we obtain this number?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to ask AIDA people what the noise in their data is. I am using an arbitrary number here for now

FT,
IN_mode,
params,
IC,
y_truth,
y_truth[end-25:end],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be good not to hard code 25 as the number but instead have some top level parameter that defines the window we average over at the end of the simulation. And then based on that compute the index value of the cutoff

@@ -100,7 +102,8 @@ function run_model(p, coefficients, IN_mode, FT, IC)

# solve ODE
local sol = run_parcel(IC, FT(0), t_max, params)
return sol[9, :] ./ (IC[7] + IC[8] + IC[9]) # frozen fraction
# return sol[9, end-25:end] ./ (IC[7] + IC[8] + IC[9]) # frozen fraction
return sol[9,end-25:end] ./ (IC[7] + IC[8] + IC[9])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be good not to hard code 25 as the number but instead have some top level parameter that defines the window we average over at the end of the simulation. And then based on that compute the index value of the cutoff

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will open as an issue if the other AIDA data are shorter than 100 timesteps long. Otherwise, I will have it as a variable called end_sim for now if that's fine

test/Project.toml Outdated Show resolved Hide resolved
@trontrytel
Copy link
Member

So the codecov error seems to be fixed 🎉

I'm fine with increasing the relative tolerance for the calibration test as needed. Especially since it seems that it just doesn't matted for the loss function. - The final number concentration is ok.

I would vote to

@amylu00
Copy link
Member Author

amylu00 commented Oct 14, 2024

I would vote to

Seems like EKP wasn't up-to-date only in test so I removed the dependency on version 1. Everything should be up-to-date with EKP and working fine now.

@amylu00 amylu00 merged commit f478a1f into main Oct 18, 2024
12 checks passed
@amylu00 amylu00 deleted the al/AIDA_HOM_UKI branch October 18, 2024 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants