Details
-
Type:
Story
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: SUIT
-
Labels:None
-
Story Points:1
-
Sprint:SUIT Sprint 2016-8
-
Team:Science User Interface
Description
There are several region issues I have found when comparing old and new API:
(1, 2, 3, 7, 8 are implemented in DM-7147, 4, 5, 6 are implemented in DM-7190)
1. The default coordinate system when "pure numbers" are used should be pixel positions on the original image.
The [spec](http://ds9.si.edu/doc/ref/region.html) says the following:
"...the default system is implicitly assumed to be PHYSICAL. In practice this means that for IMAGE and PHYSICAL systems, pure numbers are pixels."
'If no coordinate system is specified, PHYSICAL is assumed.'
More explanation can be found [here](http://hea-www.harvard.edu/RD/funtools/regcoords.html)
2. PHYSICAL coordinate system does not mean screen pixels. The question is whether we can always use image pixels.
If wcs is "physical", WCS is the pixel coordinate system of the original image, which may be different from the pixel coordinate system of the current image, if the current image is the result of an imcopy or other geometric transformation operation. In the "physical" coordinate system the ltv, ltm and the axis attribute parameters wtype, axtype, units, label, and format may be edited, but the FITS parameters crval, crpix, and cd cannot. [reference](http://stsdas.stsci.edu/cgi-bin/gethelp.cgi?wcsedit)
3. When used in API, the actions are dispatched one after another. For example, dispatchCreateRegionLayer might be issued before image plot has finished loading. Can we make regionCreateLayerActionCreator wait for image with plotId to finish loading?
More details: If I create a region layer with a few regions in image coordinates right after firefly.showImage, two errors are loaded to console:
doOnAppReady: uncaught TypeError: Cannot read property 'getImageCoords' of null(…),
RegionFactory:602: Uncaught (in promise) TypeError: Cannot read property 'getImageCoords' of null(…)
4. When a region is selected, yellow dashed line appears around it. On zoom the line does not change color.
5. Can not add empty region. Line 124 of the test script.
6. Can not add or delete regions after the first one. (Load test script, click Show Regions, then Add Region, line 121 of the test script) When there is one region in the layer and you are adding another region with a different position but everything else the same, the added region is perceived to be the same.
7. It's possible to select regions only in in the first region layer added. In the other layer, you can sometimes see the selection blinking, but it does not stay.
8. If region format is wrong, for example
'image; box 40 400 72 72 # color=blue' instead of
'image; box 40 400 72 72 0 # color=blue',
the region is silently ignored, no warning or error is logged to console.
9. We need region selection action to support callbacks on region selection. (Currently the selected region is "calculated internally based on the distance between the region and mouse readout.)
Hi Tatiana,
Thank you for raising the issues.
Currently, the JavaScript versions set the default as J2000, it is no problem to change the default coordinate system to be ‘PHYSICAL' as defined.
Yes, so far I couldn’t find the document which gives very clear definition about “PHYSICAL”. As I run several cases in ‘SAOImage ds9’, both PHYSICAL and IMAGE are treated the same.
DS9 document says, ‘PHYSICAL’ is ‘pixel coords of original file’ and ‘IMAGE’ is ‘pixel coords of current file’.
My question is
Please let me know any of your thoughts.
The similar situations may also happen to other dispatching functions. Should dispatch functions handle this problem or should the application handle the calling sequence (workflow) problem?
I need your thoughts for this issue, too.
Thanks,
Cindy