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

set! for vertical profiles #542

Closed
ali-ramadhan opened this issue Nov 30, 2019 · 2 comments
Closed

set! for vertical profiles #542

ali-ramadhan opened this issue Nov 30, 2019 · 2 comments
Labels
feature 🌟 Something new and shiny

Comments

@ali-ramadhan
Copy link
Member

Might be nice to get set! to dispatch on 1D arrays and treat them as vertical profiles as it's pretty common to want to set a 3D field based on a vertical profile.

Will probably implement this as part of https://github.com/ali-ramadhan/antarctic-ice-shelf-meltwater-outflow

@ali-ramadhan ali-ramadhan added the feature 🌟 Something new and shiny label Nov 30, 2019
@glwagner
Copy link
Member

I feel we shouldn’t assume that “1D” means “1D along third dimension”. Perhaps some kind of broadcasting-like logic is better? Does the function syntax not apply in this scenario? A function may often be the best solution even with discrete data because you can use an interpolation object to write a script that is resolution-agnostic.

@ali-ramadhan
Copy link
Member Author

ali-ramadhan commented Dec 2, 2019

Hmmm, that is a good point about assuming 1D => vertical profile.

I think yeah the function syntax might be useful here although you'd have to do some nearest-neighbor interpolation on the vertical profile array to get a function like f(x, y, z) to work with set!.

But using Interpolations.jl I can generate an interpolated Ti(z) which I can pass to set! using T0(x, y, z) = Ti(z) so maybe this is the cleanest and best approach. It's also resolution-independent as well which is nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🌟 Something new and shiny
Projects
None yet
Development

No branches or pull requests

2 participants