Interactive Viewer Testing for the optical extentions

added by Martin K├╝mmel, Harald Kuntschner and Mark Westmoquette (ESO)

revised by Sandra Castro and Ralf Palsa.

Test scenarios

The below details a number of interactive test sequences with standard outcomes in order to test the functionality of the optical extensions added to the viewer.

The test images in these sequences can be retrieve from the NRAO repository with the command:

svn co https://svn.cv.nrao.edu/svn/casa-data/trunk/regression/viewertest
Scenario A (load and display spectrum + errors):
  1. Load the FITS cube "small_meas3D.fits" as a raster image (click expand arrow and load the Quality extension (labelled [SCIENCE,ERROR]).
  2. Open "Data Display Options" (spanner icon). Under the "axis label properties" sub-panel change "spectral unit" to "Wavelength [Angstrom]", "[mm]", "frequency [GHz]", "MHz", etc. Verify changes of the unit displayed in the main viewer panel.
  3. In the "Data Display Options", verify the presence of the "hidden axes" drop-down tab (only present when an error extension is loaded) and switch the quality slider to "1", which means it switches the display from data to error. Adjust the "Data Range" values to [0,0.3] in the "basic settings" tab to view the error values. Switch the hidden axes back to "0" (i.e. data).
  4. Open the "spectral viewer" window (Tools -> Spectral Profile) and define a region on the image (using any tool).
  5. Inspect the 'mean', 'median' and 'sum' spectrum in the spectral profile window. For 'mean' and 'sum' options, 'propagated' errors can be displayed. For 'mean' and 'median' options, 'rmse' errors should be available. Select 'mean' with 'rmse' errors, then switch straight to 'sum' spectrum and check that the errors switch to 'propagated'.
  6. Use the "single point selection" tool in the main Viewer Window to select the spaxel at 10,10 (use the 'tracking data' information in the box at the bottom of the window). 'Propagated' errors are available for 'mean' and 'sum' options.
  7. Change the unit in the profiler to "wavelength [Angstrom]", "[um]", "[mm]", "frequency [GHz]" etc. Verify the changes in the x-axis units.
  8. Save the displayed spectrum (in nm units) as an ascii plot file using the "export profile to file" button (disk icon) in the spectral profile window and selecting txt (not FITS) format. Open in a text editor and check that the spectrum has been saved correctly with all 3 columns. Verify that the correct x-axis unit is in the header of the plot file (nm)
  9. Change units of the spectrum to "frequency [GHz]", then save to an ascii plot file; verify that the units are changed and correct in the header of the ascii file.
  10. Save the spectrum (in nm units) as a FITS file using the "export profile to file" button (disk icon) and selecting FITS format. Load exported spectra in external viewer and verify that the exported spectra are OK.
  11. Change the x-axis units in the profiler (to e.g. mm). Export the spectrum in FITS format again and confirm that the FITS spectrum is still in its 'native' units (and NOT the ones it was changed to in the profiler).

Scenario B (display two spectra from two spatially overlapping cubes, export to ascii)
  1. Load "small_meas3Dsci.fits" test cube as a raster image
  2. Load "small_meas3Derr.fits" test cube as a raster image
  3. Open the "Spectral Profile" window (Tools -> Spectral Profile) and define a region on the image (using any tool). The spectrum of the 1st loaded cube (small_mean3Dsci) should be shown in blue, and the 2nd (small_mean3Derr) in red.
  4. Open the spectral profiler window preferences (black cog icon) and de-select the "Overlay" option. Verify that only the red spectrum remains and the blue spectrum disappears.
  5. Select to display 'rmse' errors. Error bars should appear on the red (primary) spectrum only.
  6. Open the "Image Manager" window (Data -> Manage Images) and re-order the images by draging the "image boxes" keeping then left mouse button pressed. Moving the "small_mean3Dsci.fits" box to the bottom of the stack should bring this cube to the top in the viewer window, and swap around the blue and red spectra in the spectral profile window. Displaying 'rmse' errors should now add error bars to the small_mean3Dsci spectrum.
  7. Save the displayed spectra as an 'ascii plot file' using the button in the spectral profile window. Open in a text editor and check that both spectra have been saved, one after the other in the text file with errors for the first and none for the second.

Scenario C (spectral fitting)
  1. Load "egred.fits" cube as a raster image (click expand arrow and load the Quality extension (labelled [SCIENCE,ERROR]). Open the "Spectral Profile" tool and use the rectangle select tool to select a region in the image from 2,2 to 5,5. Make sure the combine type is set to "Mean".
  2. Zoom into the central region of the spectrum with the brightest emission line. Select this brightest line including some continuum either side with the shift key (e.g. 656-658nm). Fit a Gauss+poly1 line. Verify that the results are printed in the status bar of the viewer and on the logger or terminal output, and that they match. The results should be Gauss amplitude = 0.202572 k, centre = 656.851 nm, FWHM = 0.291573 nm, area = 0.0628722
  3. Change error type from "no error" to "propagated". Re-fit the line and verify that the fit is correct (the values and errors of the fit results MUST change - if only very slightly)
  4. Modify the fit type and re-fit (Gauss+poly 1, Gauss+poly 0, Gauss+no poly, no Gauss+poly 1, no Gauss+poly 0, no Gauss+no poly) For the last combination verify that the warning "There is nothing to fit!" is printed in the status bar and on the logger or terminal output.
  5. Verify that pressing "clean" removes the fits from the plot
  6. Change the units to GHz. Re-zoom in on the brightest line and repeat the Gauss+poly 1 fit in the modified units. The results should be Gauss amplitude = 0.201912 k, centre = 456409 GHz, FWHM = 200.962 GHz, area = 43.1926.
  7. Open the "Image manager" window (Data -> Manage images) and press the button "Options". In the dialog enter a rest wavelength of 660nm. Open "data display options" window and under the "axis label properties" sub-panel and change the spectral unit to "optical velocity [km/s]". The frame/channel value (axis unit) displayed in upper-right [default] of the image in the main viewer window should change to km/s values relative to zero at 660 nm. The x-axis units of the spectrum should also change accordingly.
  8. Re-zoom in on the brightest line and refit it with a Gauss+poly 1 model. Verify that the fit was successful in -ve velocity units (the centre should be -1430.188 km/s).
  9. Close the "egred.fits" buffer and open "eg1316.fits". Make sure the same rectangular region is selected and change the spectral viewer units back to nm.
  10. Select (using the shift key or by entering the values) the region 480-500nm. Fit a Gauss+poly 1 model. Verify that the absorption line was fit ok. The results should be amplitude = -1.69576 k, centre = 489.302 nm, FWHM = 2.88865 nm, area = -5.21423. Switch to "rmse" errors and re-fit. The results should be similar.

Scenario D (image collapse and export)
  1. Load the FITS cube "3DVisTestIDL.fits" as a raster image (click expand arrow and load the Quality extension (labelled [SCIENCE,ERROR]). This image contains masked values (NaNs in spaxel [13,13] between wavelengths of 5000-5050 and 5600-5605 A); confirm that the masking has properly been taken into account by, e.g. looking at slice 440 in the "Channels" panel.
  2. Open the "Collapse/Moments" spectral viewer window (button with arrows facing inward). Use an area select tool (e.g. rectangle) to select a region of the image that includes part of the masked out spaxels. This should be displayed in the spectral viewer.
  3. Select a spectral channel (slice) using Ctrl+<Right Mouse> at the desired location in the spectral viewer window. This should display a vertical marker at the selected spectral location. Verify that the corresponding channel [slice] is now shown in the main window as an image.
  4. In the "Collapse/Moments" spectral viewer window, mark a spectral range (shift key) and collapse the image with the various combine methods.
  5. Confirm that the resulting output image lands in the main viewer window and that the output image has an error if appropriate: if loaded with errors, combine methods "mean" and "sum" should offer propagated errors; the combine methods "mean" and "median" should offer "rmse" as error.
  6. Save the image+error from the main viewer window using the "save as" (disk icon) button. Confirm that the "browse" functionality works.
  7. Close the collapsed image buffer and load the image back in (click expand arrow and load the Quality extension [SCIENCE,ERROR] as a raster image).
  8. In the animator tool box, activate the "images" section (tickbox) and press the play or step forward/back buttons. Verify that the viewer blinks between the collapsed cube and the original image.
  9. Confirm that the error extension, if existing, was exported and imported properly. To do this, unregister the original cube (to bring the newly loaded collapsed image to the foreground), and step through the two 'channels' of the collapsed image using the "channel animator" (play or step forward/back buttons) to view the data and error extensions.
Scenario E (2D Gaussian fitting)
  1. Load the image "centGaussTest.fits" into the viewer.
  2. Use the rectangle area tool to create a region. Make the region large enough to cover one of the objects in the image.
  3. Drag the region over one of the objects.
  4. In the region panel, press on the tab named "fit".
  5. Press onto the button "gaussfit"
  6. Confirm that under 'reasonable' circumstances (sufficient size and positioning of the region on the object) the Gaussian fit is successful.
  7. Confirm that the fitted Gaussian parameters agree with the inputs used for generating this image. These inputs are stored in the keywords HISTORY of that image.
  8. Confirm that the object center and the direction of the major axis are marked in green.
  9. Position the region again over an object. In the region panel, un-select "mark center". Repeat the "gaussfit". Confirm that the object center and orientation are NOT marked.
  10. In the region panel, select "mark center" and in the selector on the right choose a color, e.g. yellow. Repeat the "gaussfit". Confirm that the center marking is done in the chosen color.
  11. Repeat 2.-9. with the region shapes ellipse and polygon.
-- MarkWestmoquette - 2012-04-24
Topic revision: r13 - 2014-02-17, SandraCastro
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding NRAO Public Wiki? Send feedback