-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DM-13624 Create HiPS survey loading framework #558
Conversation
} | ||
|
||
|
||
// this is temporary solution for getting HiPS from IRSA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just wonder why is this temporary? Is there a plan for something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If IRSA were to deploy some sort of hipslist service then that would be the final solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there some way to get HiPS from IRSA? For this release to make HiPS source framework to aggregate HiPS from various sources, a hard code csv file is created and meant to contain the info of HiPS from IRSA.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, IRSA doesn't have a registry service where you can get the list and i don't think is there any plan to do that in the (near) future so the solution you implemented is probably more definitive than temporary ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made many comments. At least a few of those should be changed before merging.
Also:
From the UI testing, I think you should enable filtering on default for non-popular HiPS. There's enough rows where filtering can be helpful.
public String doCommand(SrvParam sp) throws Exception { | ||
TableServerRequest tsr = sp.getTableServerRequest(); | ||
DataGroupPart dgp = new SearchManager().getDataGroup(tsr); | ||
JSONObject json = JsonTableUtil.toJsonTableModel(dgp, tsr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the exact same as a edu.caltech.ipac.firefly.server.query.SearchServerCommands.TableSearch.
When getting a TableModel from a SearchProcessor, you should use one of the fetch
functions from TablesCntlr.js. No need to add a new command for every new SearchProcessor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I will remove it. This was for some request created earlier. Now actually 'TableSearch' is used for HiPS search.
{@ParamDoc(name = ServerParams.DATA_TYPE, desc = "types of HiPS data to search"), | ||
@ParamDoc(name = "hipsSource", desc = "HiPS sources"), | ||
@ParamDoc(name = "sortOrder", desc = "HiPS order, source based"), | ||
@ParamDoc(name = "tblId", desc = "table Id") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorting and tblId is an existing concept of SearchProcessor. Is this different from that? Is it needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sortOrder has its meaning for this processor.
@@ -0,0 +1,139 @@ | |||
package edu.caltech.ipac.firefly.server.visualize.hipslists; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a big deal, but this package named hipslist. Is there a plan to have other hips related code immediately under visualize
? If not, shouldn't it just be hips?
Also, naming it hips
will allow for other hips related code to be in this package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, change it to be 'hips'
import edu.caltech.ipac.firefly.server.visualize.hipslists.HiPSMasterListEntry.PARAMS; | ||
|
||
import org.json.simple.JSONArray; | ||
import org.json.simple.JSONObject; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please clean up imports. The reference to JSON caught my eyes, but there are a couple more above that's less obvious.
if (!cmeta.containsKey(key)) { | ||
dg.addAttribute(key, meta.getAttribute(key)); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed. prepareTableMeta
is called within the framework. Individual processor should override prepareTableMeta
when needed. You may have this confused because I gave you the wrapper
code which is a piece of code used to bridge the old
ipac table based to the new
db based logic.
return file; | ||
} | ||
|
||
private static Object strToObject(String s, Class c) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you can use DataType#convertStringToData instead?
Object val = keyVal == null ? null : strToObject(keyVal, cols.get(i).getDataType()); | ||
|
||
row.setDataElement(cols.get(i), val); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use convertStringToData
like this?
for (DataType col : cols) {
String val = mapInfo.get(col.getKeyName());
row.setDataElement(col, col.convertStringToData(val));
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great, thanks.
/** | ||
* Created by cwang on 2/27/18. | ||
*/ | ||
public class LsstHiPSListSource implements HiPSMasterListSourceType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@robyww Just throwing out the idea. Does not have to be done now.
This is the 2nd ListSourceType
interface we have now. The 1st is ImageMasterDataSourceType
.
If we plan to grow this interface, we should refactor it. There's a lot of duplicates between the 2.
@@ -287,30 +264,52 @@ function fieldReducer(hipsUrl) { | |||
tooltip: 'display popular HiPS' | |||
}}; | |||
} | |||
return inFields; | |||
return Object.assign({}, inFields); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are returning a new Object all the time. Wouldn't that cause the FieldGroupCntlr to update it state?
I am not sure, but if that's the case, then you should only return a new object when you actually modify it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. It is leftover from some code change. fixed.
import {flux} from '../Firefly.js'; | ||
import {get, isArray, isEmpty, set} from 'lodash'; | ||
import {fetchUrl, parseUrl} from '../util/WebUtil.js'; | ||
import {get, isArray, cloneDeep, set, isFunction, isUndefined, omit} from 'lodash'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still a Controller
after all of the modifications? If the answer is no
, then let's not name it Cntlr
. Controller
has a defined behavior for us.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I thought the file name should be changed. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes. Good to go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
- I listed several small java issues.
UI:
- the full hips list table should have the filters input turned on by default. I think this is very important since it is such a long table.
- I don't think you need to show the source column since that is not really part of the data.
} | ||
|
||
|
||
// this is temporary solution for getting HiPS from IRSA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If IRSA were to deploy some sort of hipslist service then that would be the final solution.
private static final String HiPSCDSURL = AppProperties.getProperty("HiPS.cds.hostname", | ||
"http://alasky.unistra.fr/MocServer/query?hips_service_url=*&get=record"); | ||
//set default timeout to 30seconds | ||
int timeout = new Integer( AppProperties.getProperty("HiPS.cds.timeoutLimit" , "30")).intValue(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be:
private static final int TIMEOUT
return createHiPSList(dataTypes, source); | ||
} catch (FailedRequestException | IOException | DataAccessException e) { | ||
_log.info("get CDS HiPS failed"); | ||
e.printStackTrace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we us Logger all logging so you should not use printStackTrace
so use this:
_log.warn(e,"get CDS HiPS failed");
if You think it needs to be info then call the log method directly to log an info with an exception.
|
||
for (int i = 0; i < HiPSMasterList.HiPSDataType.length; i++) { | ||
if (Arrays.asList(dataTypes).contains(HiPSMasterList.HiPSDataType[i])) { | ||
dp = dp + "&dataproduct_type=" + HiPSMasterList.HiPSDataType[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can do this:
dp+= "&dataproduct_type=" + HiPSMasterList.HiPSDataType[i];
} | ||
catch (FailedRequestException | IOException e) { | ||
_log.info("get Irsa HiPS failed"); | ||
e.printStackTrace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logging: same as above
e.printStackTrace(); | ||
return null; | ||
} catch (Exception e) { | ||
e.printStackTrace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logging: same as above
oneList.set(PARAMS.SOURCE.getKey(), source); | ||
for (int i = 0; i < dataCols.length; i++) { | ||
Object obj = row.getDataElement(dataCols[i].getKeyName()); | ||
String val = obj != null ? String.valueOf(obj) : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be obj.toString()
Is it only me or don't you feel that the checkbox 'popular hips maps' should be replace by the opposite and unchecked. What i mean, it would be more 'natural' to have the default popular list and a checkbox that enable an advanced and more complete list... just a comment about UX. |
If the checkbox is titled with the word like 'popular HiPS', that will give the user the hint that there is a selection for popular list. Anyhow, there is plan (soon) to make 'popular HiPS' option configurable by the app, and the default setting will be determined by the configuration. |
… table containing available HiPS from various sources and add method to form table containing popular HiPS. create new file containing irsa hips info, irsa-hips-master-table.csv DM-13771 fix titles on 'choose image type' section, default unit for HiPS fov and units for distance tool, fix hips and footprint/marker issues related to hips rendering on some target like arp-220, footprint/marker rendering while the background image is scrolled or zoomed and footprint/marker rotate, move, and resize while hips fov is changed. fix function call for drawing circle. re-create footprint elements when the plot zoom factor is changed.
41d0fe7
to
d039353
Compare
Add more fixing per lssues listed in DM-13771
|
You still need to enable the filters on the all HiPS (non-popular) table. |
The development includes,
test: