Per-Cube Histogram
PER_CUBE_HISTOGRAM
See the source code.
This test verifies per-cube histogram calculation on a 3D FITS image cube.
Frontend sends: OPEN_FILE (
OpenFile)directory = "set_QA" file = "supermosaic.10.fits" hdu = "0" file_id = 0 render_mode = RASTER
Backend returns: OPEN_FILE_ACK (
OpenFileAck) and REGION_HISTOGRAM_DATAFrontend sends: ADD_REQUIRED_TILES and SET_CURSOR at (1, 1)
Frontend sends: SET_HISTOGRAM_REQUIREMENTS (
SetHistogramRequirements)file_id = 0 region_id = -2 histograms = [{channel: -2, num_bins: -1}]
Backend streams: REGION_HISTOGRAM_DATA with progress updates
Check 1: at progress > 0.5, the REGION_HISTOGRAM_DATA should satisfy:
binWidth = 0.7235205769538879 (4 decimal precision)
bins.length = 2775
firstBinCenter = -1773.2998046875
channel = -2, regionId = -2
Check 2: at progress = 1.0 (complete), the REGION_HISTOGRAM_DATA should satisfy:
bins[2500] = 9359604
mean = 18.742310255027036
stdDev = 22.534721826342878
numBins = 2775
PER_CUBE_HISTOGRAM_HDF5
See the source code.
This test verifies per-cube histogram calculation on an HDF5 image cube with the same data as the FITS test.
Frontend sends: OPEN_FILE (
OpenFile)directory = "set_QA" file = "supermosaic.10.hdf5" hdu = "0" file_id = 0 render_mode = RASTER
2-4. Same cursor, tiles, and histogram requirements as PER_CUBE_HISTOGRAM
Check 1: at progress = 1.0 (complete), the REGION_HISTOGRAM_DATA should satisfy:
binWidth = 0.7235205573004645 (4 decimal precision)
bins.length = 2775
bins[2500] = 9359604
firstBinCenter = -1773.2998608150997
numBins = 2775
mean = 18.742310241547514 (4 decimal precision)
stdDev = 22.534722680160574 (4 decimal precision)
regionId = -2, channel = -2
PER_CUBE_HISTOGRAM_CANCELLATION
See the source code.
This test verifies histogram computation cancellation and resumption behavior.
Frontend sends: OPEN_FILE (
OpenFile)directory = "set_QA" file = "SDC335.579-0.292.spw0-channel-cutted.line.fits" hdu = "0" file_id = 0 render_mode = RASTER
Frontend sends: SET_HISTOGRAM_REQUIREMENTS (
SetHistogramRequirements)file_id = 0 region_id = -2 histograms = [{channel: -2, num_bins: -1}]
Backend streams: REGION_HISTOGRAM_DATA with progress > 0
After 5 seconds, Frontend cancels by sending: SET_HISTOGRAM_REQUIREMENTS with empty histograms
file_id = 0 region_id = -2 histograms = []
Backend returns: ERROR_DATA (2 error messages)
Check 1: the cancellation should satisfy:
Initial progress > 0 (computation started)
ERROR_DATA received after cancellation
After 2-second wait, Frontend retries: SET_HISTOGRAM_REQUIREMENTS with original parameters
Check 2: the resumed computation should satisfy:
Final progress = 1.0
binWidth = 0.0007966686389409006
bins.length = 342
bins[170] = 10548
firstBinCenter = -0.09137402474880219
numBins = 342
mean = 0.00005560920907762894
stdDev = 0.012523454128847715