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

V inner formal integral #2800

Merged
merged 73 commits into from
Jan 14, 2025
Merged

Conversation

Rodot-
Copy link
Contributor

@Rodot- Rodot- commented Aug 15, 2024

📝

Fixes the formal integral to handle changes in geometry

Type: 🪲 bugfix

When the formal integral is run with the v_inner solver, if the final active geometry state is different than that of the initial geometry mismatches in plasma and opacity quantities occur. This PR rectifies this by slicing these arrays to the correct size

Depends on PR #2797

🚦 Testing

How did you test these changes?

  • Testing pipeline
  • Other method (describe)
  • My changes can't be tested (explain why)

CUDA version of the formal integral was tested locally

☑️ Checklist

  • I requested two reviewers for this pull request
  • I updated the documentation according to my changes
  • I built the documentation by applying the build_docs label

Note: If you are not allowed to perform any of these actions, ping (@) a contributor.

andrewfullard and others added 30 commits July 23, 2024 10:44
Solvers pass info to each other
Simplified some parts
Also adds docstrings to methods. Updates some methods to use new functionality of the plasma. Adds requirements for the convergence plots (still broken)
c = const.c.cgs.value
kb = const.k_B.cgs.value

def B(nu, T):
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably we can import the blackbody function from somewhere else in tardis.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with the comments on this function, but it is something that is out of scope of this PR to improve

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, but can we at least name it blackbody or something something that is more pep8 compliant than just a single capitalized letter? (Along with U below)

tardis/workflows/util.py Outdated Show resolved Hide resolved

return estimates

def reproject(self, a1, m1, a2, m2):
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if this is would be used elsewhere, but it seems like quite a generic function to live in this class. Maybe this should live in util.py?

Also, a1, m1, a2, and m2 could be a little more explicit. Just named "array1" and "mask1".

tardis/workflows/util.py Outdated Show resolved Hide resolved
Co-authored-by: Jing Lu <48139543+DeerWhale@users.noreply.github.com>
DeerWhale
DeerWhale previously approved these changes Jan 14, 2025
)[self.mean_optical_depth]
)

interpolator = interp1d(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think scipy's interp1d is deprecated. If we're just doing 1d interpolation, we could use numpy's np.interp instead.

@andrewfullard andrewfullard merged commit 5e2d0bb into tardis-sn:master Jan 14, 2025
12 of 15 checks passed
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.

6 participants