Skip to content

Commit ccc6a36

Browse files
authored
Merge pull request #500 from Caltech-IPAC/DM-12268-ImageRequestFix
DM-12268 Fix fits image rendering problem since latest FITS library update
2 parents d1ca020 + b8cd6ca commit ccc6a36

File tree

7 files changed

+26
-598
lines changed

7 files changed

+26
-598
lines changed

src/firefly/java/edu/caltech/ipac/astro/FITSTableReader.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ public static List getStarTableList(String fits_filename) {
219219

220220
// disable long string for HeaderCard create while collecting tables from StarTableFactory to work around the exception error
221221
// sent from nom.tam.fits.
222+
223+
FitsFactory.useThreadLocalSettings(true);
222224
FitsFactory.setLongStringsEnabled(false);
223225

224226
try {

src/firefly/java/edu/caltech/ipac/firefly/server/visualize/ImagePlotCreator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import nom.tam.fits.FitsException;
2424
import nom.tam.fits.Header;
2525
import nom.tam.fits.HeaderCard;
26+
import nom.tam.fits.HeaderCardException;
2627

2728
import java.io.File;
2829
import java.io.IOException;
@@ -221,7 +222,7 @@ private static void initPlotTitle(PlotState state,
221222
ImagePlot plot,
222223
ActiveFitsReadGroup frGroup,
223224
String dataDesc,
224-
boolean isMultiImage) {
225+
boolean isMultiImage) throws HeaderCardException {
225226

226227
WebPlotRequest req= state.getWebPlotRequest();
227228
plot.setPlotDesc("");

src/firefly/java/edu/caltech/ipac/util/FitsHDUUtil.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import nom.tam.fits.HeaderCard;
1414
import nom.tam.fits.TableHDU;
1515
import nom.tam.util.Cursor;
16+
import nom.tam.fits.FitsFactory;
1617

1718
import java.io.File;
1819
import java.io.IOException;
@@ -120,6 +121,8 @@ public static DataGroup fitsHeaderToDataGroup(String fitsFile) {
120121
int index = 0;
121122
List<JSONObject> headerColumns = createHeaderTableColumns(true);
122123

124+
FitsFactory.useThreadLocalSettings(true);
125+
123126
while ((hdu = fits.readHDU()) != null) {
124127
JSONObject extensionInfo;
125128
List<List<String>> headerRows = new ArrayList<>();

0 commit comments

Comments
 (0)