Cannot Fetch AMR Arrays


I am trying to fetch data from an AMR dataset, but find that this process doesn’t include the point or cell arrays. When I check the data arrays I see that I only have one cell array for “vtkGhostType”.

I’ve gone through this process for Lagrangian data sets before without issue. Is there something special that has to be done for AMR datasets?

Note that I am using a custom AMR reader, in case that might somehow affect this process.

The code that I am using to check/test is below.


#! /usr/bin/env python
# -*- coding: utf-8 -*-

import os
import sys

import paraview.simple as pvs = pvs.servermanager

famr = '/path/to/some/amr_file.hdf'

if not os.path.exists(famr):
    sys.exit('File does not exist!\n')

ramr = pvs.VelodyneAMRReader(FileNames=[famr])

amr2mbds = pvs.ConvertAMRdatasettoMultiblock(Input=ramr)

amr_cd2pd = pvs.CellDatatoPointData(Input=amr2mbds)
amr_cd2pd.PassCellData = 1 

amr_merge = pvs.MergeBlocks(Input=amr_cd2pd)


#to_fetch = amr2mbds
to_fetch = amr_cd2pd
#to_fetch = amr_merge

amr_mbds =

if to_fetch == amr_cd2pd or to_fetch == amr2mbds:
    itero = amr_mbds.NewIterator()

    cdo = itero.GetCurrentDataObject()

    num_arrays_cell = cdo.GetCellData().GetNumberOfArrays()
    num_arrays_point = cdo.GetPointData().GetNumberOfArrays()

elif to_fetch == amr_merge:
    num_arrays_cell = amr_mbds.GetCellData().GetNumberOfArrays()
    num_arrays_point = amr_mbds.GetPointData().GetNumberOfArrays()

print('Number of cell arrays: ', num_arrays_cell)
print('Number of point arrays:', num_arrays_point)

I’ve found that if I add an arbitrary Threshold filter right after the reader in my pipeline then I can fetch data with the arrays included.

By arbitrary Threshold I mean I threshold on an array across its entire value range so that no data is actually lost.

Perhaps any other arbitrary filter would work but I haven’t tested.