File Browser
OPEN_SWAPPED_IMAGES
See the source code.
This test verifies that images with non-standard axis orderings can be opened and navigated correctly.
Case 1: RA-Freq-Dec-Stokes axis ordering
Frontend sends: OPEN_FILE (
OpenFile)directory = "set_QA" file = "HH211_IQU-swap-rfds.image" hdu = "" file_id = 0 render_mode = RASTER
Backend returns: OPEN_FILE_ACK (
OpenFileAck)
Check 1: the OPEN_FILE_ACK should satisfy:
success = True file_info.name = "HH211_IQU-swap-rfds.image" file_info_extended.dimensions = 4 file_info_extended.width = 1049 file_info_extended.height = 5 file_info_extended.depth = 1049 file_info_extended.stokes = 3 file_info_extended.axes_numbers = { spatial_x: 1, spatial_y: 3, spectral: 2, stokes: 4, depth: 3 }
Frontend sends: SET_IMAGE_CHANNELS to channel 500, then SET_CURSOR
channel = 500 point = {x: 510, y: 2}
Check 2: the SPATIAL_PROFILE_DATA should satisfy:
channel = 500 x = 510 y = 2 value = 0.0015299528604373336
Case 2: RA-Stokes-Dec-Freq axis ordering (two images)
Frontend opens two images:
file = "HH211_IQU-swap-rsdf.image" (file_id = 0) file = "HH211_IQU.fits" (file_id = 1)
Check 3: the OPEN_FILE_ACK for the swapped image should satisfy:
success = True file_info.name = "HH211_IQU-swap-rsdf.image" file_info_extended.dimensions = 4 file_info_extended.width = 1049 file_info_extended.height = 1049 file_info_extended.depth = 5 file_info_extended.stokes = 3 file_info_extended.axes_numbers = { spatial_x: 1, spatial_y: 3, spectral: 4, stokes: 2, depth: 4 }
Frontend sends: SET_CURSOR on both images at the same point
point = {x: 555, y: 586}
Check 4: the SPATIAL_PROFILE_DATA from both images should satisfy:
Both return the same pixel value at (555, 586):
value = 0.00048562639858573675
Case 3: Freq-Dec-Stokes-RA axis ordering
Frontend sends: OPEN_FILE (
OpenFile)file = "HH211_IQU-swap-fdsr.image" file_id = 0
Check 5: the OPEN_FILE_ACK should satisfy:
success = True file_info_extended.width = 5 file_info_extended.height = 1049 file_info_extended.depth = 1049 file_info_extended.stokes = 3 file_info_extended.axes_numbers = { spatial_x: 4, spatial_y: 2, spectral: 1, stokes: 3, depth: 4 }
Frontend sends: SET_IMAGE_CHANNELS to channel 522, then SET_CURSOR
channel = 522 point = {x: 4, y: 521}
Check 6: the SPATIAL_PROFILE_DATA should satisfy:
channel = 522 x = 4 y = 521 value = 0.03848038613796234
Case 4: Stokes-glon-vard-glat axis ordering
Frontend sends: OPEN_FILE (
OpenFile)file = "supermosaic.10-cutted-stokes-glon-vard-glat.image" file_id = 0
Check 7: the OPEN_FILE_ACK should satisfy:
success = True file_info_extended.width = 483 file_info_extended.height = 51 file_info_extended.depth = 403 file_info_extended.stokes = 1 file_info_extended.axes_numbers = { spatial_x: 2, spatial_y: 4, spectral: 3, stokes: 1, depth: 4 }
Frontend sends: SET_IMAGE_CHANNELS to channel 112, then SET_CURSOR
channel = 112 point = {x: 477, y: 12}
Check 8: the SPATIAL_PROFILE_DATA should satisfy:
channel = 112 x = 477 y = 12 value = 20.193593978881836