Skip to content
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-12268 Fix fits image rendering problem since latest FITS library update #500

Merged
merged 2 commits into from Nov 15, 2017

Conversation

cwang2016
Copy link
Contributor

The development fixes the image rendering by changing the way to clone the fits header.

test:
go to localhost:8080/firefly
do image search on m31, WISE image, '4 band level1' and band 2.
or
do upload, image search on the following sample,

  • firefly_test_data/FileUpload-samples/fits/imagetable/hpacs1342250905_00hps3d_00.fits, extension 1.

issue:
there is some issue regarding how nom.tam.fits library parses the fits header when the keyword value ending in '&' and immediately followed by 'CONTINUE' line. The string after the CONTINUE keyword is ignored if keyword 'LONGSTRN' is defined after the keyword with long string values per the parsing method of current nom.tam.fits library used, therefore the keyword value of long string case may be displayed inaccurately. (i.e. it ends with '&' and without containing the string after CONTINUE keyword).

@cwang2016 cwang2016 self-assigned this Nov 14, 2017
Copy link
Contributor

@robyww robyww left a comment

Choose a reason for hiding this comment

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

All looks good except for my one comment. We need to copy the card. After that change it is good to merge.

while (iter.hasNext()) {
HeaderCard card = (HeaderCard) iter.next();
cards[i] = card.toString();
i++;
clonedHeader.addLine(card);
Copy link
Contributor

@robyww robyww Nov 15, 2017

Choose a reason for hiding this comment

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

I think we should make a copy.

clonedHeader.addLine(card.copy());

or

clonedHeader.addLine(new HeaderCard(card.getKey(), card.getValue(), card.getComment()));

Copy link
Contributor

@ejoliet ejoliet left a comment

Choose a reason for hiding this comment

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

I've tested in Lightcurve tool also and wise images are ok now. Seems to be fixed. I won't comment on the code. Probably Trey is best to do that.

@cwang2016 cwang2016 merged commit ccc6a36 into dev Nov 15, 2017
@robyww robyww deleted the DM-12268-ImageRequestFix branch November 21, 2017 21:28
@robyww robyww restored the DM-12268-ImageRequestFix branch November 21, 2017 21:29
@robyww robyww deleted the DM-12268-ImageRequestFix branch November 21, 2017 21:29
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.

None yet

3 participants