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

Vlasiator-style sparsity handling and sparse blockwise output from re… #16

Open
wants to merge 5 commits into
base: vdf_replace
Choose a base branch
from

Conversation

alhom
Copy link
Contributor

@alhom alhom commented Aug 16, 2024

…construct_vdf

This also means that the sparsify function is now a no-op - we can handle that block-wise now. Maybe that should enforce non-negativity instead?

Modularized several functions for easier reuse.

Also has a dangling new DWT in compression methods - no wonder the old one crashes. Still need to wrap that up.

Here's a snippet to test the blockwise ouput.

import pytools as pt, vdf_replace as v, numpy as np
import tools

f = pt.vlsvfile.VlsvReader('/home/mjalho/Documents/ASTERIX/assets/restart.0000400.2024-08-08_15-03-48.vlsv')
sparsity = 1e-16
_, original_vdf,_ = v.vdf_extract.extract(f, 300,sparsity,False)

blocks, block_data, cm_ratio = v.reconstruct_vdf(f, 300, sparsity, v.cm.reconstruct_cid_zfp, sparsify=False)


vids,vvalues = v.blockdata_to_vdfmap(f, blocks, block_data)

reconstructed_vdf = v.vdf_extract.inflate(f, vids, vvalues)

print(reconstructed_vdf.shape)
print(original_vdf.shape)

tools.plot_vdfs(original_vdf, reconstructed_vdf, sparsity,True,"nosparsify")


blocks, block_data, cm_ratio = v.reconstruct_vdf(f, 300, sparsity, v.cm.reconstruct_cid_zfp, sparsify=True)


vids,vvalues = v.blockdata_to_vdfmap(f, blocks, block_data)

reconstructed_vdf = v.vdf_extract.inflate(f, vids, vvalues)

print(reconstructed_vdf.shape)
print(original_vdf.shape)

tools.plot_vdfs(original_vdf, reconstructed_vdf, sparsity,True,"sparsify")

@alhom
Copy link
Contributor Author

alhom commented Aug 16, 2024

Requires this
fmihpc/analysator#258

@kstppd
Copy link
Owner

kstppd commented Aug 16, 2024

Thanks a bunch Markku. Will test this shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants