|
2 | 2 | * License information at https://github.com/Caltech-IPAC/firefly/blob/master/License.txt
|
3 | 3 | */
|
4 | 4 |
|
| 5 | +import {isUndefined, get} from 'lodash'; |
5 | 6 | import {take} from 'redux-saga/effects';
|
6 |
| -import {get} from 'lodash'; |
7 | 7 |
|
8 | 8 | import {LO_VIEW, LO_MODE, SHOW_DROPDOWN, SET_LAYOUT_MODE, getLayouInfo, dispatchUpdateLayoutInfo, dropDownHandler} from '../../core/LayoutCntlr.js';
|
9 | 9 | import {TBL_RESULTS_ADDED, TABLE_LOADED, TBL_RESULTS_ACTIVE, TABLE_HIGHLIGHT} from '../../tables/TablesCntlr.js';
|
10 | 10 | import {getCellValue, getTblById, makeTblRequest} from '../../tables/TableUtil.js';
|
11 | 11 | import {updateSet} from '../../util/WebUtil.js';
|
12 | 12 | import {dispatchPlotImage} from '../../visualize/ImagePlotCntlr.js';
|
13 |
| -import WebPlotRequest from '../../visualize/WebPlotRequest.js'; |
| 13 | +import {WebPlotRequest,TitleOptions} from '../../visualize/WebPlotRequest.js'; |
| 14 | +import {converters, converterFactory} from '../../metaConvert/ConverterFactory.js'; |
| 15 | +import {ServerRequest} from '../../data/ServerRequest.js'; |
| 16 | +import {dispatchLoadPlotData} from '../../charts/XYPlotCntlr.js'; |
14 | 17 |
|
15 | 18 | export const RAW_TABLE = 'raw_table';
|
16 | 19 | export const PHASE_FOLDED = 'phase_folded';
|
17 | 20 | export const PERIODOGRAM = 'periodogram';
|
18 | 21 | export const PEAK_TABLE = 'peak_table';
|
19 |
| - |
20 | 22 | export const IMG_VIEWER_ID = 'lc_image_viewer';
|
21 | 23 |
|
22 | 24 | /**
|
@@ -56,6 +58,7 @@ export function* lcManager() {
|
56 | 58 |
|
57 | 59 | if (newLayoutInfo !== layoutInfo) {
|
58 | 60 | dispatchUpdateLayoutInfo(newLayoutInfo);
|
| 61 | + |
59 | 62 | }
|
60 | 63 | }
|
61 | 64 | }
|
@@ -94,55 +97,43 @@ function handleTableHighlight(layoutInfo, action) {
|
94 | 97 |
|
95 | 98 | function getWebPlotRequest(tbl_id) {
|
96 | 99 | const tableModel = getTblById(tbl_id);
|
97 |
| - const ra = getCellValue(tableModel, tableModel.highlightedRow, 'ra'); |
98 |
| - const dec = getCellValue(tableModel, tableModel.highlightedRow, 'dec'); |
99 |
| - |
100 |
| - console.log(`${ra} , ${dec}`); |
101 |
| - //Example: frame-id = "02328b152-w1", |
102 |
| - // see meaning: http://wise2.ipac.caltech.edu/docs/release/allwise/expsup/sec3_1a.html#frame_id |
103 |
| - |
104 |
| - const frame_id = getCellValue(tableModel, tableModel.highlightedRow, 'frame_id'); |
105 |
| - |
106 |
| - var wise_sexp_ibe = /(\d+)([0-9][a-z])(\w+)/g; |
| 100 | + const hlrow = tableModel.highlightedRow || 0; |
| 101 | + const ra = getCellValue(tableModel, hlrow, 'ra'); |
| 102 | + const dec = getCellValue(tableModel, hlrow, 'dec'); |
| 103 | + const frameId = getCellValue(tableModel, hlrow, 'frame_id'); |
| 104 | + var wise_sexp_ibe = /(\d+)([0-9][a-z])(\w+)/g; |
| 105 | + var res = wise_sexp_ibe.exec(frameId); |
| 106 | + const scan_id = res[1] + res[2]; |
| 107 | + const scangrp = res[2]; |
| 108 | + const frame_num = res[3]; |
107 | 109 |
|
108 |
| - var res = wise_sexp_ibe.exec(frame_id); |
109 |
| - /* |
110 |
| - will split 'frame_id' into 5 elements array |
111 |
| - 02328b152 - full frame-id |
112 |
| - 0232 - pre-scanid, (+ scangroup = scan_id) |
113 |
| - 8d - scangrp , |
114 |
| - 152 - frame_num |
| 110 | + const sr= new ServerRequest('ibe_file_retrieve'); |
| 111 | + sr.setParam('mission', 'wise'); |
| 112 | + sr.setParam('plotId', 'lc_images'); |
| 113 | + sr.setParam('PROC_ID', 'ibe_file_retrieve'); |
| 114 | + sr.setParam('ProductLevel', '1b'); |
| 115 | + sr.setParam('ImageSet', 'allsky-4band'); |
| 116 | + sr.setParam('band', 2); |
| 117 | + sr.setParam('scangrp', `${scangrp}`); |
| 118 | + sr.setParam('scan_id', `${scan_id}`); |
| 119 | + sr.setParam('frame_num', `${frame_num}`); |
| 120 | + sr.setParam('center', `${ra},${dec}`); |
| 121 | + sr.setParam('size', '0.3'); |
| 122 | + sr.setParam('subsize', '0.3'); |
| 123 | + sr.setParam('in_ra',`${ra}`); |
| 124 | + sr.setParam('in_dec',`${dec}`); |
| 125 | + |
| 126 | + const reqParams = WebPlotRequest.makeProcessorRequest(sr, 'wise'); |
| 127 | + reqParams.setTitle('WISE-'+ frameId); |
| 128 | +// reqParams.setInitialZoomLevel(0.5); |
| 129 | + return reqParams; |
115 | 130 |
|
116 |
| - see http://irsa.ipac.caltech.edu/ibe/docs/wise/merge/merge_p1bm_frm/#int |
117 | 131 |
|
118 |
| - IBE url: |
119 |
| - http://irsa.ipac.caltech.edu/ibe/data/wise/merge/merge_p1bm_frm/{scangrp:s}/{scan_id:s}/{frame_num:03d}/{scan_id:s}{frame_num:03d}-w{band:1d}-int-1b.fits |
120 |
| - */ |
121 | 132 |
|
122 |
| - const scan_id = res[1]+res[2]; |
123 |
| - const scangrp = res[2]; |
124 |
| - const frame_num = res[3]; |
125 |
| - console.log(`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`); |
126 |
| - // return makeWebPlotRequest(tbl_id); should use the commented code below to retrieve wise images. |
127 |
| - // this is just a placeholder. |
128 |
| - //return { |
129 |
| - // plotId: 'lc_images', |
130 |
| - // Type : 'SERVICE', |
131 |
| - // Service : 'WISE', |
132 |
| - // Title : 'Wise', |
133 |
| - // SurveyKey : 'Atlas', |
134 |
| - // SurveyKeyBand : '2', |
135 |
| - // WorldPt : `${ra};${dec};EQ_J2000`, |
136 |
| - // SizeInDeg : '.3', |
137 |
| - // AllowImageSelection : true |
138 |
| - //}; |
139 |
| - |
140 |
| - 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`; |
141 |
| - var wpr = WebPlotRequest.makeURLPlotRequest(url); |
142 |
| - return wpr; |
143 | 133 | }
|
144 | 134 |
|
145 | 135 |
|
146 |
| -function makeWebPlotRequest() { |
| 136 | +function makeWebPlotRequest(tbl_id) { |
| 137 | +//todo make grid plotting with hlrow+1, hlrow, hlrow-1 |
147 | 138 | // for WISE, should convert gwt code from here: edu.caltech.ipac.hydra.server.query.WiseGrid.makeRequest;
|
148 | 139 | }
|
0 commit comments