Region Spectral Profiles
REGION_SPECTRAL_PROFILE_RECTANGLE
See the source code.
This test verifies that spectral profiles are computed correctly for rectangle regions, comparing results across CASA IMAGE and HDF5 formats.
For each file format (M17_SWex.image and M17_SWex.hdf5):
Frontend sends: CLOSE_FILE (
CloseFile) and OPEN_FILE (OpenFile)directory = "set_QA" file = "M17_SWex.image" / "M17_SWex.hdf5" hdu = "" file_id = 0 render_mode = RASTER
Backend returns: OPEN_FILE_ACK (
OpenFileAck) and REGION_HISTOGRAM_DATA
Check 1: the OPEN_FILE_ACK should satisfy:
OPEN_FILE_ACK.success = True
Frontend sends: ADD_REQUIRED_TILES and SET_CURSOR
file_id = 0 tiles = [0] point = {x: 1.0, y: 1.0}
Frontend sends: SET_REGION (
SetRegion) for 4 rectangle regionsCase 1 (no rotation):
file_id = 0 region_id = -1 region_type = RECTANGLE control_points = [{x: 83, y: 489}, {x: 4, y: 6}] rotation = 0.0
Case 2 (rotated 50 degrees):
file_id = 0 region_id = -1 region_type = RECTANGLE control_points = [{x: 92, y: 522}, {x: 4, y: 6}] rotation = 50.0
Case 3 (sub-pixel size):
file_id = 0 region_id = -1 region_type = RECTANGLE control_points = [{x: 360, y: 490}, {x: 0.5, y: 0.5}] rotation = 0.0
Case 4 (out-of-bounds, rotated):
file_id = 0 region_id = -1 region_type = RECTANGLE control_points = [{x: 0, y: 522}, {x: 4, y: 6}] rotation = 50.0
Backend returns: SET_REGION_ACK (
SetRegionAck) for each region
Check 2: the SET_REGION_ACK should satisfy:
All SET_REGION_ACK.success = True
region_id = 1, 2, 3, 4 respectively
Frontend sends: SET_SPECTRAL_REQUIREMENTS (
SetSpectralRequirements) for each regionfile_id = 0 region_id = <1-4> spectral_profiles = [{ coordinate: "z", stats_types: [NumPixels, Sum, FluxDensity, Mean, RMS, Sigma, SumSq, Min, Max, Extrema] }]
Backend returns: SPECTRAL_PROFILE_DATA (
SpectralProfileData) for each region
Check 3: the SPECTRAL_PROFILE_DATA should satisfy:
Should arrive within 5000 ms
Cases 1-3: progress = 1, with valid rawValuesFp64 values at indices [0, 50, 100, 150, 199] matching expected byte arrays for each stats type
Case 3 (sub-pixel region): profile length = 25, Sigma values = [0, 0, 0, 0, 0] (single pixel)
Case 4 (out-of-bounds): all stats return NaN values
Results should be consistent between CASA IMAGE and HDF5 formats (minor differences allowed for RMS and SumSq)
REGION_SPECTRAL_PROFILE_ELLIPSE
See the source code.
This test verifies that spectral profiles are computed correctly for ellipse regions, comparing results across CASA IMAGE and HDF5 formats.
For each file format (M17_SWex.image and M17_SWex.hdf5):
Frontend sends: CLOSE_FILE (
CloseFile) and OPEN_FILE (OpenFile)directory = "set_QA" file = "M17_SWex.image" / "M17_SWex.hdf5" hdu = "" file_id = 0 render_mode = RASTER
Backend returns: OPEN_FILE_ACK (
OpenFileAck) and REGION_HISTOGRAM_DATA
Check 1: the OPEN_FILE_ACK should satisfy:
OPEN_FILE_ACK.success = True
Frontend sends: ADD_REQUIRED_TILES and SET_CURSOR
file_id = 0 tiles = [0] point = {x: 1.0, y: 1.0}
Frontend sends: SET_REGION (
SetRegion) for 2 ellipse regionsCase 1 (valid region, rotated 30 degrees):
file_id = 0 region_id = -1 region_type = ELLIPSE control_points = [{x: 89, y: 516}, {x: 5, y: 3}] rotation = 30.0
Case 2 (out-of-bounds, rotated 30 degrees):
file_id = 0 region_id = -1 region_type = ELLIPSE control_points = [{x: 0, y: 516}, {x: 5, y: 3}] rotation = 30.0
Backend returns: SET_REGION_ACK (
SetRegionAck) for each region
Check 2: the SET_REGION_ACK should satisfy:
All SET_REGION_ACK.success = True
region_id = 1, 2 respectively
Frontend sends: SET_SPECTRAL_REQUIREMENTS (
SetSpectralRequirements) for each regionfile_id = 0 region_id = <1-2> spectral_profiles = [{ coordinate: "z", stats_types: [NumPixels, Sum, FluxDensity, Mean, RMS, Sigma, SumSq, Min, Max, Extrema] }]
Backend returns: SPECTRAL_PROFILE_DATA (
SpectralProfileData) for each region
Check 3: the SPECTRAL_PROFILE_DATA should satisfy:
Should arrive within 5000 ms
Case 1: progress = 1, profile length = 25, with valid rawValuesFp64 values at indices [0, 50, 100, 150, 199] matching expected byte arrays for each stats type
Case 2 (out-of-bounds): all stats return NaN values
Results should be consistent between CASA IMAGE and HDF5 formats (minor differences allowed for RMS and SumSq)
REGION_SPECTRAL_PROFILE_POLYGON
See the source code.
This test verifies that spectral profiles are computed correctly for polygon regions, comparing results across CASA IMAGE and HDF5 formats.
For each file format (M17_SWex.image and M17_SWex.hdf5):
Frontend sends: CLOSE_FILE (
CloseFile) and OPEN_FILE (OpenFile)directory = "set_QA" file = "M17_SWex.image" / "M17_SWex.hdf5" hdu = "" file_id = 0 render_mode = RASTER
Backend returns: OPEN_FILE_ACK (
OpenFileAck) and REGION_HISTOGRAM_DATA
Check 1: the OPEN_FILE_ACK should satisfy:
OPEN_FILE_ACK.success = True
Frontend sends: ADD_REQUIRED_TILES and SET_CURSOR
file_id = 0 tiles = [0] point = {x: 1.0, y: 1.0}
Frontend sends: SET_REGION (
SetRegion) for 2 polygon regionsCase 1 (valid region):
file_id = 0 region_id = -1 region_type = POLYGON control_points = [{x: 547, y: 284}, {x: 543, y: 279}, {x: 551, y: 275}] rotation = 0.0
Case 2 (out-of-bounds region):
file_id = 0 region_id = -1 region_type = POLYGON control_points = [{x: 647, y: 272}, {x: 630, y: 262}, {x: 648, y: 253}] rotation = 0.0
Backend returns: SET_REGION_ACK (
SetRegionAck) for each region
Check 2: the SET_REGION_ACK should satisfy:
All SET_REGION_ACK.success = True
region_id = 1, 2 respectively
Frontend sends: SET_SPECTRAL_REQUIREMENTS (
SetSpectralRequirements) for each regionfile_id = 0 region_id = <1-2> spectral_profiles = [{ coordinate: "z", stats_types: [NumPixels, Sum, FluxDensity, Mean, RMS, Sigma, SumSq, Min, Max, Extrema] }]
Backend returns: SPECTRAL_PROFILE_DATA (
SpectralProfileData) for each region
Check 3: the SPECTRAL_PROFILE_DATA should satisfy:
Should arrive within 5000 ms
Case 1: progress = 1, profile length = 25, with valid rawValuesFp64 values at indices [0, 50, 100, 150, 199] matching expected byte arrays for each stats type
Case 2 (out-of-bounds): all stats return NaN values
Results should be consistent between CASA IMAGE and HDF5 formats (minor differences allowed for RMS and SumSq)
REGION_SPECTRAL_PROFILE_STOKES
See the source code.
This test verifies that spectral profiles are computed correctly for regions across different Stokes parameters, comparing results across FITS and HDF5 formats.
For each file format (HH211_IQU.fits and HH211_IQU.hdf5):
Frontend sends: CLOSE_FILE (
CloseFile) and OPEN_FILE (OpenFile)directory = "set_QA" file = "HH211_IQU.fits" / "HH211_IQU.hdf5" hdu = "" file_id = 0 render_mode = RASTER
Backend returns: OPEN_FILE_ACK (
OpenFileAck) and REGION_HISTOGRAM_DATA
Check 1: the OPEN_FILE_ACK should satisfy:
OPEN_FILE_ACK.success = True
Frontend sends: ADD_REQUIRED_TILES and SET_CURSOR
file_id = 0 tiles = [0] point = {x: 1.0, y: 1.0}
Frontend sends: SET_REGION (
SetRegion)file_id = 0 region_id = -1 region_type = RECTANGLE control_points = [{x: 522, y: 522}, {x: 10, y: 10}] rotation = 0.0
Backend returns: SET_REGION_ACK (
SetRegionAck)
Check 2: the SET_REGION_ACK should satisfy:
SET_REGION_ACK.success = True
region_id = 1
Case 1: Stokes I spectral profile (coordinate “z”)
Frontend sends: SET_SPECTRAL_REQUIREMENTS (
SetSpectralRequirements)file_id = 0 region_id = 1 spectral_profiles = [{coordinate: "z", stats_types: [Mean]}]
Backend returns: SPECTRAL_PROFILE_DATA (
SpectralProfileData)
Check 3: the SPECTRAL_PROFILE_DATA should satisfy:
region_id = 1, progress = 1, profile length = 5
rawValuesFp64 values at indices [0, 10, 20, 30, 39] should match expected byte arrays
Case 2: Change to Stokes Q (stokes = 1)
Frontend sends: SET_IMAGE_CHANNELS (
SetImageChannels)file_id = 0 channel = 0 stokes = 1 required_tiles = {file_id: 0, tiles: [0], compression_type: ZFP, compression_quality: 11}
Backend returns: SPECTRAL_PROFILE_DATA (auto-updated)
Check 4: the SPECTRAL_PROFILE_DATA should satisfy:
region_id = 1, progress = 1, profile length = 5
rawValuesFp64 values at indices [0, 10, 20, 30, 39] should match expected byte arrays (different from Stokes I)
Case 3: Stokes U spectral profile (coordinate “Uz”)
Frontend sends: SET_SPECTRAL_REQUIREMENTS (
SetSpectralRequirements)file_id = 0 region_id = 1 spectral_profiles = [{coordinate: "Uz", stats_types: [Mean]}]
Backend returns: SPECTRAL_PROFILE_DATA (
SpectralProfileData)
Check 5: the SPECTRAL_PROFILE_DATA should satisfy:
region_id = 1, progress = 1, profile length = 5
rawValuesFp64 values at indices [0, 10, 20, 30, 39] should match expected byte arrays
Case 4: Invalid Stokes V spectral profile (coordinate “Vz”)
Frontend sends: SET_SPECTRAL_REQUIREMENTS (
SetSpectralRequirements)file_id = 0 region_id = 1 spectral_profiles = [{coordinate: "Vz", stats_types: [Mean]}]
Backend returns: ERROR_DATA (
ErrorData)
Check 6: the ERROR_DATA should satisfy:
message = "Spectral requirements not valid for region id 1" severity = 3 tags = ["spectral"]