-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
because things retrieving the IFT version number didn't work
- Loading branch information
1 parent
0634a98
commit b843f4e
Showing
3 changed files
with
30 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,28 @@ | ||
function getiftversion() | ||
deps = Pkg.dependencies() | ||
iftversion = [] | ||
for (_, dep) in deps | ||
dep.is_direct_dep || continue | ||
dep.version === nothing && continue | ||
dep.name != "IceFloeTracker" && continue | ||
push!(iftversion, dep.version) | ||
break | ||
end | ||
|
||
# For CI tests where IceFloeTracker is not a dependency | ||
try | ||
ift = iftversion[1] | ||
catch | ||
return "unknown" | ||
end | ||
|
||
ift = iftversion[1] | ||
maj = Int(ift.major) | ||
min = Int(ift.minor) | ||
patch = Int(ift.patch) | ||
return "v$maj.$min.$patch" | ||
end | ||
|
||
""" | ||
makeh5filename(imgfname, ts) | ||
|
@@ -100,7 +125,7 @@ The `index` group contains the spatial coordinates in the source image coordinat | |
function makeh5files(; pathtosampleimg::String, resdir::String) | ||
latlondata = getlatlon(pathtosampleimg) | ||
|
||
iftver = iftversion[] | ||
iftversion = getiftversion() | ||
|
||
ptpath = joinpath(resdir, "passtimes.jls") | ||
passtimes = deserialize(ptpath) | ||
|
@@ -128,7 +153,7 @@ function makeh5files(; pathtosampleimg::String, resdir::String) | |
# Add top-level attributes | ||
attrs(file)["fname_reflectance"] = reflectance_refs[i] | ||
attrs(file)["fname_truecolor"] = truecolor_refs[i] | ||
attrs(file)["iftversion"] = iftver | ||
attrs(file)["iftversion"] = iftversion | ||
attrs(file)["crs"] = latlondata["crs"] | ||
attrs(file)["reference"] = "https://doi.org/10.1016/j.rse.2019.111406" | ||
attrs(file)["contact"] = "[email protected]" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters