Skip to content

Commit 18f8fa0

Browse files
committed
DM-7784-7963
* LC image retireve use url instead of ibe for general purpose LCViewer * Add user input image cutout size in Phase Fold Panel.
1 parent 7adee44 commit 18f8fa0

File tree

2 files changed

+62
-15
lines changed

2 files changed

+62
-15
lines changed

src/firefly/js/templates/lightcurve/LcManager.js

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ import {dispatchPlotImage, visRoot, dispatchDeletePlotView,
1313
dispatchChangeActivePlotView} from '../../visualize/ImagePlotCntlr.js';
1414
import {getPlotViewById} from '../../visualize/PlotViewUtil.js';
1515
import {getMultiViewRoot, dispatchReplaceViewerItems, getViewer} from '../../visualize/MultiViewCntlr.js';
16-
import {WebPlotRequest} from '../../visualize/WebPlotRequest.js';
16+
import {WebPlotRequest,TitleOptions} from '../../visualize/WebPlotRequest.js';
1717
import {dispatchTableToIgnore} from '../../visualize/DrawLayerCntlr.js';
1818
import Catlog from '../../drawingLayers/Catalog.js';
1919
import {ServerRequest} from '../../data/ServerRequest.js';
2020
import {CHANGE_VIEWER_LAYOUT} from '../../visualize/MultiViewCntlr.js';
21+
import LcPFOptionsPanel, {getCutoutValue} from './LcPhaseFoldingPanel.jsx';
22+
import FieldGroupUtils, {revalidateFields} from '../../fieldGroup/FieldGroupUtils';
2123

2224
export const RAW_TABLE = 'raw_table';
2325
export const PHASE_FOLDED = 'phase_folded';
@@ -155,6 +157,38 @@ function getWebPlotRequest(tableModel, hlrow) {
155157

156158
}
157159

160+
function getWebPlotRequestViaUrl(tableModel, hlrow) {
161+
const ra = getCellValue(tableModel, hlrow, 'ra');
162+
const dec = getCellValue(tableModel, hlrow, 'dec');
163+
const frameId = getCellValue(tableModel, hlrow, 'frame_id');
164+
var wise_sexp_ibe = /(\d+)([0-9][a-z])(\w+)/g;
165+
var res = wise_sexp_ibe.exec(frameId);
166+
const scan_id = res[1] + res[2];
167+
const scangrp = res[2];
168+
const frame_num = res[3];
169+
const cutoutsize = tableModel.request.cutout_size || 0.3;
170+
171+
/*the following should be from reading in the url column returned from LC search
172+
we are constructing the url for wise as the LC table does
173+
not have the url colume yet
174+
It is only for WISE, using default cutout size 0.3 deg
175+
const url = `http://irsa.ipac.caltech.edu/ibe/data/wise/merge/merge_p1bm_frm/${scangrp}/${scan_id}/${frame_num}/${scan_id}${frame_num}-w1-int-1b.fits`;
176+
*/
177+
const serverinfo = 'http://irsa.ipac.caltech.edu/ibe/data/wise/merge/merge_p1bm_frm/';
178+
const centerandsize = `?center=${ra},${dec}&size=${cutoutsize}&gzip=false`;
179+
const url = `${serverinfo}${scangrp}/${scan_id}/${frame_num}/${scan_id}${frame_num}-w1-int-1b.fits${centerandsize}`;
180+
const plot_desc = `WISE-${frameId}`;
181+
const reqParams = WebPlotRequest.makeURLPlotRequest(url, plot_desc);
182+
reqParams.setTitle('WISE-'+ frameId + ' size: '+ cutoutsize +'(deg)');
183+
reqParams.setTitleOptions(TitleOptions.NONE);
184+
reqParams.setGroupLocked(true);
185+
reqParams.setPlotGroupId('LightCurveGroup');
186+
reqParams.setPreferenceColorKey('light-curve-color-pref');
187+
return reqParams;
188+
189+
190+
191+
}
158192

159193
function setupImages(tbl_id) {
160194
const viewer= getViewer(getMultiViewRoot(),IMG_VIEWER_ID);
@@ -169,7 +203,7 @@ function setupImages(tbl_id) {
169203
newPlotIdAry.forEach( (plotId) => {
170204
if (!getPlotViewById(vr,plotId)) {
171205
const rowNum= Number(plotId.substring(plotIdRoot.length));
172-
const webPlotReq = getWebPlotRequest(tableModel,rowNum );
206+
const webPlotReq = getWebPlotRequestViaUrl(tableModel,rowNum);
173207
dispatchPlotImage({plotId, wpRequest:webPlotReq,
174208
setNewPlotAsActive:false,
175209
holdWcsMatch:true,

src/firefly/js/templates/lightcurve/LcPhaseFoldingPanel.jsx

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -228,36 +228,47 @@ export function LcPFOptionsPanel ({fields}) {
228228
<br/>
229229
<ValidationField fieldKey='flux'
230230
initialState= {{
231-
fieldKey: 'flux',
232-
value: '2.0',
233-
validator: Validate.floatRange.bind(null, 2.0, 5.5, 3,'Flux Column'),
234-
tooltip: 'Flux Column, value between 2.0 to 5.5',
235-
label : 'Flux Column:',
236-
labelWidth : 100
231+
fieldKey: 'flux',
232+
value: '2.0',
233+
validator: Validate.floatRange.bind(null, 2.0, 5.5, 3,'Flux Column'),
234+
tooltip: 'Flux Column, value between 2.0 to 5.5',
235+
label : 'Flux Column:',
236+
labelWidth : 100
237237
}} />
238238

239239
<br/>
240240

241241
<ValidationField fieldKey='fluxerror'
242242
initialState= {{
243-
fieldKey: 'fluxerror',
244-
value: '0.02',
245-
validator: Validate.floatRange.bind(null, 0.01, 0.5, 3,'Flux Error'),
246-
tooltip: 'Flux Error, value is between 0.01 to 0.5',
247-
label : 'Flux Error:',
248-
labelWidth : 100
243+
fieldKey: 'fluxerror',
244+
value: '0.02',
245+
validator: Validate.floatRange.bind(null, 0.01, 0.5, 3,'Flux Error'),
246+
tooltip: 'Flux Error, value is between 0.01 to 0.5',
247+
label : 'Flux Error:',
248+
labelWidth : 100
249249
}} />
250250
<br/>
251251

252252
<ValidationField fieldKey='period'
253-
initialState= {{
253+
initialState= {{
254254
fieldKey: 'period',
255255
value: '1.0',
256256
//validator: Validate.floatRange.bind(null, 0.5, 1.5, 3,'period'),
257257
tooltip: 'Period',
258258
label : 'Period:',
259259
labelWidth : 100
260260
}} />
261+
<br/>
262+
263+
<ValidationField fieldKey='cutoutSize'
264+
initialState= {{
265+
fieldKey: 'cutoutSize',
266+
value: '0.3',
267+
//validator: Validate.floatRange.bind(null, 0.1, 1, 3,'cutoutsize'),
268+
tooltip: 'Cutout Size',
269+
label : 'Cutout Size:',
270+
labelWidth : 100
271+
}} />
261272

262273

263274
<br/> <br/>
@@ -388,6 +399,8 @@ function doPhaseFolding(fields) {
388399

389400
var tReq = makeTblRequest('PhaseFoldedProcessor', PHASE_FOLDED, {
390401
'period_days': fields.period.value,
402+
'cutout_size': fields.cutoutSize.value,
403+
'flux': fields.flux.value,
391404
'table_name': 'folded_table',
392405
'time_col_name':fields.timeCol.value,
393406
'original_table': tbl.tableMeta.tblFilePath

0 commit comments

Comments
 (0)