Skip to content

Commit

Permalink
first attempt using merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Rogers committed Nov 29, 2024
1 parent 9d79b34 commit 4b570ae
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion deepsensor/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1085,11 +1085,42 @@ def stitch_clipped_predictions(

patches_clipped[var_name].append(patch_clip)

#combined = patches_clipped[0] # Start with the first patch
"""
combined = {}
for var_name, patches in patches_clipped.items():
combined[var_name] = patches[0] # Start with the first patch
for patch in patches[1:]:
combined[var_name] = xr.merge([combined[var_name], patch], compat='no_conflicts', combine_attrs="override")
"""
combined = {}
for var_name, patches in patches_clipped.items():
combined[var_name] = patches[0] # Start with the first patch
for patch in patches[1:]:
# Merge the current combined patch with the next one
combined[var_name] = xr.merge([combined[var_name], patch], compat="override", combine_attrs="override")

"""
combined = {}
for var_name, patches in patches_clipped.items():
combined[var_name] = patches[0] # Start with the first patch
for patch in patches[1:]:
combined[var_name] = combined[var_name].update(patch)
#print(patches_clipped)
#for patches in patches_clipped[1:]:
# print('patches')
combined = {
var_name: xr.merge([combined, patches], combine_attrs="override")
for var_name, patches in patches_clipped.items()
}
#combined = xr.merge([combined, patch], combine_attrs="override")
combined = {
var_name: xr.combine_by_coords(patches, compat="no_conflicts")
for var_name, patches in patches_clipped.items()
}

"""
return combined

# load patch_size and stride from task
Expand Down

0 comments on commit 4b570ae

Please sign in to comment.