Skip to content

IRSA-629 and IRSA-630: add generic way to get downloader in time series tool #421

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

Merged
merged 6 commits into from
Jul 26, 2017

Conversation

ejoliet
Copy link
Contributor

@ejoliet ejoliet commented Jul 24, 2017

This pull request combined 2 tickets IRSA-629 and 630.

One (IRSA-629) causes other one (IRSA-630): in order to get a different download processor (other than the current fixed one for WISE), i have introduced a function to deal with it in the UI form the converter factory.
Then i have added a specific server-side processor to package the files to be downloaded with the help of Wei's ticket (IRSA-514). Firefly has IBE for PTF included now.

There is a current issue with the background monitor (@Loi will fix it soon), once is fixed, the test should be going to the Timeseries tool and upload a LC for PTF, then select any row of the table and download the file(s) to test.

@ejoliet ejoliet requested review from wmiipac and loitly July 24, 2017 22:01
*/


@SearchProcessorImpl(id = "PtfProcimsFileRetrieve")
Copy link
Contributor

Choose a reason for hiding this comment

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

+@SearchProcessorImpl(id = "PtfProcimsFileRetrieve")
this processor id is the same with the one in ife but the getBaseURL parameter is different, in ife(gwt) the host, schemaGroup, schema and table are read in from the xml configuration. In firefly the params are set in the PTFPlotRequests and ptfDownloadOptPanel, "mission" is equivalent to schemaGroup. would it be confusion, when we build TST under irsaviewer? the two processor (one in firefly, the other in ife) with the same processor id. I would suggest using PtfTSProcimsFileRetrieve

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, none of those processor are used. IBE generic code in Firefly make use of edu.caltech.ipac.astro.ibe.datasource.PtfIbeDataSource#makeDataParam to determine the URL to download the file by single processor : IBE file retrieve processor.

I will actually remove them because there are useless. Thanks for catching that!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've actually kept them because they are identical to the ife ones and i think they can be useful in the future. I just changed the id name to avoid confusion, but these classes are not for LC per se, they are for getting IBE PTF specifically.

@ejoliet
Copy link
Contributor Author

ejoliet commented Jul 25, 2017

BTW, if you want to run the newly test added to this branch, you will need to checkout IRSA-629-add-ptf-images branch under firefly_test_data repos.

Copy link
Contributor

@wmiipac wmiipac left a comment

Choose a reason for hiding this comment

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

Looks good, test runs well too. It is nice that the download processor can be called for specific mission now. Noted that the file download has pending issue with the background monitor, but not to be solved in this PR.
PR approved

Copy link
Contributor

@loitly loitly left a comment

Choose a reason for hiding this comment

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

Code looks fine and it works well.
I have a couple of comments, but they are not a big deal.
However, I've just push a commit that fixed the packaging regression bug. Please review and merge when ready.

@@ -49,7 +52,7 @@
public String getTable() { return table;}
}

public PtfIbeDataSource() {}
public PtfIbeDataSource() { ptfResolver = new PtfIbeResolver();}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this assignment should be in initialize(). It awkward to see assignment in one constructor, but not in the others. After looking at it, the empty constructor and initialize() should be combined as a static creator. But, maybe next time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is only one constructor. is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. I will add it to setupDs() which is called by initialize anyway.

// extName = null;
// }

fi = new FileInfo(url, extName, 100000);
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume 100000 is an arbitrary number. I think if you don't know what the size of the file should be, just put 0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should be '0' actually but it works seamlessly i think. Will change it.


private static String getBaseURL(ServerRequest sr) throws MalformedURLException {
// build service
return new PtfFileRetrieve().getBaseURL(sr);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is PtfFileRetrieve().getBaseURL(sr) not a static method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

left from previous code introduced in different access, can be static now. Will change.

}


DataGroup dataObjects = DataGroupReader.readAnyFormat(tempFile);
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we know it's an ipac table, no need to call this method and waste the overhead.
DataGroupReader.read(tempFile)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point!


if(!convertData.downloadOptions){
downloaderOptPanel = defaultOptPanel;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This plus the assignment at top is a bit of a mind-twister.. Don't you mean this?
const downloaderOptPanel = convertData.downloadOptions || defaultOptPanel

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, will clean it up as i have to clean up other things too.

@loitly
Copy link
Contributor

loitly commented Jul 25, 2017

@ejoliet , FYI: I've just pushed another commit to fix 'Get Download Script' regression bug.

@ejoliet
Copy link
Contributor Author

ejoliet commented Jul 25, 2017 via email

@ejoliet ejoliet merged commit f979199 into dev Jul 26, 2017
@ejoliet ejoliet deleted the IRSA-629-add-ptf-image-downloader branch July 26, 2017 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants