Skip to content

Firefly-2138: microscope 'at row' searches use the cutout center - #2073

Open
aventura121 wants to merge 2 commits into
devfrom
FIREFLY-2138-wise-search
Open

aventura121 wants to merge 2 commits into
devfrom
FIREFLY-2138-wise-search

Conversation

@aventura121

@aventura121 aventura121 commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

FIREFLY-2138 "WISE: use microscope: search at row uses field center"

Description:

The microscope menu's "at row" searches aren't starting from the search position for the cutouts. They start from the center of the full image the cutout was taken from.

Fix:

"At row" searches start from the search position when the table shows cutouts.

Builds:

irsa-ife: https://firefly-2138-wise-search.irsakubedev.ipac.caltech.edu/applications/wise
firefly: https://firefly-2138-wise-search.irsakubedev.ipac.caltech.edu/firefly

Validation:

  1. Using the irsa-ife build link, input a target, e.g. 183.8 -16.4, then click search.
  2. Select the microscope icon and check the readout for "Cone and Point Actions based on center," we should see the same searched-for coordinates (183.8 -16.4).
Microscope readout microscope-menu-readout
  1. Similarly, if you select Search at TAP row, we'll see the same coordinates in the TAP menu.
TAP menu readout tap-readout

By comparison, on the deployed WISE app, we can see the wrong values are shown (e.g. 183.93094, -16.65889).

@aventura121 aventura121 added this to the 2027.1 milestone Dec 1, 2026
@aventura121 aventura121 self-assigned this Dec 1, 2026
@aventura121 aventura121 added the bug label Dec 1, 2026
@aventura121 aventura121 changed the title FIREFLY-2138: microscope 'at row' searches use the cutout center Firefly-2138: microscope 'at row' searches use the cutout center Dec 1, 2026
@aventura121
aventura121 marked this pull request as ready for review December 1, 2026 19:50
Comment on lines +493 to +499
const {subsize, scanId, coaddId, refSourceId} = table?.request ?? {};
// use the frame center (the row's position) if there's no cutout (subsize) or an ID is set (WiseRequestList.js:79)
if (!(Number(subsize) > 0) || scanId || coaddId || refSourceId) return rowWp;
const ra = getCellValue(table, table.highlightedRow, 'in_ra');
const dec = getCellValue(table, table.highlightedRow, 'in_dec');
if (!isNumeric(ra) || !isNumeric(dec)) return rowWp;
return makeWorldPt(Number(ra), Number(dec), CoordinateSys.EQ_J2000);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to rethink this. This is wise specific code and not general. The function name looks general but is looks at wise search parameters and table columns.

We need to avoid having mission specific code in the general functions. I will think about what is the best way to proceed.

@robyww robyww left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After doing some research it appears that wise is using in_ra and in_dec to make cutouts.

for example

wp = makeWorldPt(ra_in, dec_in, CoordinateSys.EQ_J2000);
req.setParam('center', `${ra_in},${dec_in}`);
req.setParam('in_ra', `${ra_in}`);
req.setParam('in_dec', `${dec_in}`);

However the real problem it the table metadata is set wrong (at least in the wise case) by the IBE search processor.

public String getCenterCols() {
return "crval1;crval2;EQ_J2000";
}

That is where the real problem is and needs to be fixed. You should look at the other missions in metaConvert/missions and see it that applies to them as well. so I don't think we need the getCutoutAwareWorldPtFromTableRow function the code should keep using getWorldPtFromTableRow. It should work if the the meta data is set correctly.

/**
* Meta entry that defines how to compute the center position of table row
* 3 entries separated by ; the first two are column names
* Form: lonCol;latCol;CoordinateSys.toString(),
* eg if table has a ra column and a dec columns then: 'ra;dec;J2000'
* @see CoordSys.js
*/
CENTER_COLUMN : 'CENTER_COLUMN',

crval1 and crval2 are related to pixels that are the projection base for the original FITS file. They come from the FITS header. For cutouts they could be off the image.

@aventura121

Copy link
Copy Markdown
Contributor Author

After doing some research it appears that wise is using in_ra and in_dec to make cutouts.

for example

wp = makeWorldPt(ra_in, dec_in, CoordinateSys.EQ_J2000);
req.setParam('center', `${ra_in},${dec_in}`);
req.setParam('in_ra', `${ra_in}`);
req.setParam('in_dec', `${dec_in}`);

However the real problem it the table metadata is set wrong (at least in the wise case) by the IBE search processor.

public String getCenterCols() {
return "crval1;crval2;EQ_J2000";
}

That is where the real problem is and needs to be fixed. You should look at the other missions in metaConvert/missions and see it that applies to them as well. so I don't think we need the getCutoutAwareWorldPtFromTableRow function the code should keep using getWorldPtFromTableRow. It should work if the the meta data is set correctly.

/**
* Meta entry that defines how to compute the center position of table row
* 3 entries separated by ; the first two are column names
* Form: lonCol;latCol;CoordinateSys.toString(),
* eg if table has a ra column and a dec columns then: 'ra;dec;J2000'
* @see CoordSys.js
*/
CENTER_COLUMN : 'CENTER_COLUMN',

crval1 and crval2 are related to pixels that are the projection base for the original FITS file. They come from the FITS header. For cutouts they could be off the image.

Thanks, @robyww. I see what you mean about the mission specific code. I tried changing CENTER_COLUMN but it breaks its other readers like the chart and seems to cause other issues. It looks like we don't need to make a change to the server though because the converters you're pointing to already work out the position for us. We can have them report that position and then have the microscope ask its table's converter. That keeps it agnostic. Does that sound good?

@robyww

robyww commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

I think CENTER_COLUMN is the way to go. That is really how it is designed to work. I would like to understand what is breaking.

Your right, we could also do something like

    makeDataProductsConverter(table).getImageCenterColumns()

Why don't you take another look at CENTER_COLUMN before we extent DataProductsFactory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants