# Recue Interpolated data from old JLD2

**URL:** <https://discourse.julialang.org/t/recue-interpolated-data-from-old-jld2/99181>\
**Category:** General Usage\
**Created:** [May 21, 2023, 9:41am UTC](https://discourse.julialang.org/t/recue-interpolated-data-from-old-jld2/99181 "2023-05-21T09:41:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![marianoarnaiz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marianoarnaiz/32/19377_2.png) [@marianoarnaiz](https://discourse.julialang.org/u/marianoarnaiz)\
**Post date:** [May 21, 2023, 9:41am UTC](https://discourse.julialang.org/t/recue-interpolated-data-from-old-jld2/99181/1 "2023-05-21T09:41:49Z")

</div>

Hi everyone, a couple of years ago a created some interpolated functions with Interpolations.jl and saved then to files in JLD2. I used them a lot back in the day, but trying to load them now (new computer, new OS, new Julia and new packages versions) proves impossible.

I can do

`@load "Mantle_Vp.jld"`

and get:

```julia

┌ Warning: saved type Interpolations.GriddedInterpolation{Float64, 4, Float64, Gridded{Linear}, NTuple{4, Vector{Int64}}} is missing field it in workspace type; reconstructing
└ @ JLD2 ~/.julia/packages/JLD2/ryhNR/src/data/reconstructing_datatypes.jl:164
1-element Vector{Symbol}:
 :Mantle_Vp

```

If I type the name of the variable Mantle\_Vp I can see all the interpolated data is there, but it is not callable.

```julia
julia> Mantle_Vp(100,20000,3.6,8.0)
ERROR: MethodError: objects of type JLD2.ReconstructedTypes.var"##Interpolations.GriddedInterpolation{Float64, 4, Float64, Gridded{Linear}, NTuple{4, Vector{Int64}}}#296" are not callable
Stacktrace:
 [1] top-level scope
   @ REPL[24]:1

```

Can I output this to a variable to reinterpolate and resave so I can have access to my data again?

---

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [May 21, 2023, 10:17am UTC](https://discourse.julialang.org/t/recue-interpolated-data-from-old-jld2/99181/2 "2023-05-21T10:17:16Z")

</div>

You need to:

1. Re-create the environment setup you used to create JLD2 file (if you have Project.toml and Manifest.toml files this should be doable relatively easily)
2. Read the data into Julia in this environment.
3. Save it in some format that is package-version independent.
4. Load it back in your current environment setup.

---

<div class="post-metadata">

**Author:** ![marianoarnaiz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marianoarnaiz/32/19377_2.png) [@marianoarnaiz](https://discourse.julialang.org/u/marianoarnaiz)\
**Post date:** [May 21, 2023, 10:32am UTC](https://discourse.julialang.org/t/recue-interpolated-data-from-old-jld2/99181/3 "2023-05-21T10:32:42Z")

</div>

Hi, thanks for the help, but I do not have any of the environment information. It was all in my old laptop and it is now formatted.

Any other idea?

If there is a way to evaluate the ReconstructedType it might work, but I cannot find the way.

---

<div class="post-metadata">

**Author:** ![ederag](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ederag/32/4106_2.png) [@ederag](https://discourse.julialang.org/u/ederag)\
**Post date:** [May 21, 2023, 12:07pm UTC](https://discourse.julialang.org/t/recue-interpolated-data-from-old-jld2/99181/4 "2023-05-21T12:07:34Z")

</div>

[JLD2](https://github.com/JuliaIO/JLD2.jl) is a subset of hdf5,  
so you might be able to inspect the file and load the data (with [HDF5](https://github.com/JuliaIO/HDF5.jl)),  
and from this data instantiate an `Interpolations.GriddedInterpolation`  
or the equivalent in your version of `Interpolations.jl` ?

---

<div class="post-metadata">

**Author:** ![marianoarnaiz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marianoarnaiz/32/19377_2.png) [@marianoarnaiz](https://discourse.julialang.org/u/marianoarnaiz)\
**Post date:** [May 21, 2023, 1:19pm UTC](https://discourse.julialang.org/t/recue-interpolated-data-from-old-jld2/99181/5 "2023-05-21T13:19:22Z")

</div>

Hi!  
Ok this took me somewhere but I am am not well versed in HDF5.

I read the file and I can see the internal structure:

 ![Screenshot 2023-05-21 at 3.16.53 PM](https://global.discourse-cdn.com/julialang/original/3X/f/3/f3747b77dc62113e269b56dc0341656a0d6105a3.png)

And then I can call the Dataset…

`file["Mantle_Vp"]`

And get:

 ![Screenshot 2023-05-21 at 3.17.00 PM](https://global.discourse-cdn.com/julialang/original/3X/f/f/fff8abea4b5709d576a10d8916c34450ea8c6db2.png)

Then I think read can get the data

> A = file[“Mantle\_Vp”]  
> B=read(A)  
> (knots = (var"1" = HDF5.Reference(HDF5.API.hobj\_ref\_t(0x000000000000149a)), var"2" = HDF5.Reference(HDF5.API.hobj\_ref\_t(0x000000000000163c)), var"3" = HDF5.Reference(HDF5.API.hobj\_ref\_t(0x0000000000001b26)), var"4" = HDF5.Reference(HDF5.API.hobj\_ref\_t(0x0000000000001bb7))), coefs = HDF5.Reference(HDF5.API.hobj\_ref\_t(0x0000000000001c90)))

From here onwards… I do not know where to go. The knots set of variables are some numbers of my original data, but if i call them I get:

> B.knots.var"1"  
> HDF5.Reference(HDF5.API.hobj\_ref\_t(0x000000000000149a))

Where can I go from here? 🙂

---

<div class="post-metadata">

**Author:** ![yha](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yha/32/3502_2.png) [@yha](https://discourse.julialang.org/u/yha)\
**Post date:** [May 21, 2023, 2:02pm UTC](https://discourse.julialang.org/t/recue-interpolated-data-from-old-jld2/99181/6 "2023-05-21T14:02:42Z")

</div>

> [@marianoarnaiz](#):
>
> ```julia
> ┌ Warning: saved type Interpolations.GriddedInterpolation{Float64, 4, Float64, Gridded{Linear}, NTuple{4, Vector{Int64}}} is missing field it in workspace type; reconstructing
> └ @ JLD2 ~/.julia/packages/JLD2/ryhNR/src/data/reconstructing_datatypes.jl:164
> 
> ```

The warning refers to a specific field `GriddedInterpolation.it`. Instead of reconstructing from HDF5 data, you might try finding out the last version of `Interpolation` before the `it` field was added (e.g. using “blame” on github) and loading the JLD file with that version.

---

<div class="post-metadata">

**Author:** ![marianoarnaiz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marianoarnaiz/32/19377_2.png) [@marianoarnaiz](https://discourse.julialang.org/u/marianoarnaiz)\
**Post date:** [May 21, 2023, 3:50pm UTC](https://discourse.julialang.org/t/recue-interpolated-data-from-old-jld2/99181/7 "2023-05-21T15:50:01Z")

</div>

> [@yha](#):
>
> GriddedInterpolation.it

Yes! That Worked! Thanks a lot!
