# Efficiently access data that changes rarely

**URL:** <https://discourse.julialang.org/t/efficiently-access-data-that-changes-rarely/88564>\
**Category:** Modelling & Simulations\
**Created:** [October 11, 2022, 9:18am UTC](https://discourse.julialang.org/t/efficiently-access-data-that-changes-rarely/88564 "2022-10-11T09:18:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![braeburn](https://avatars.discourse-cdn.com/v4/letter/b/9de053/32.png) [@braeburn](https://discourse.julialang.org/u/braeburn)\
**Post date:** [October 11, 2022, 9:18am UTC](https://discourse.julialang.org/t/efficiently-access-data-that-changes-rarely/88564/1 "2022-10-11T09:18:37Z")

</div>

Hey. I want to run some simulations depending on weather forecasts. The data is used very often so access is performance critical. It also may change, even though this only happens whenever a new forecast is available. It is okay if the currently running simulation is finished before loading the new data. Finally, I want to access these forecasts in an interpolated fashion. I use [Interpolations.jl](https://juliamath.github.io/Interpolations.jl/stable/) to create interpolation objects.

My question is how I would go about making these interpolations accessible to the rest of my code. I am considering wrapping them in a struct

```julia
struct WeatherData{T}
    wind_speed_itp::T
    temperature_itp::T
    # around 10 more of these
end

```

and then passing them as an argument to my simulation. Is this reasonable or is there a more efficient way of doing this?

I would be grateful for any ideas and suggestions. 🙂

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [October 11, 2022, 10:27am UTC](https://discourse.julialang.org/t/efficiently-access-data-that-changes-rarely/88564/2 "2022-10-11T10:27:07Z")

</div>

Seems perfectly fine.
