Re: No valid Fits header
Posted by
karenacollins on
Nov 04, 2019; 10:41am
URL: http://astroimagej.170.s1.nabble.com/No-valid-Fits-header-tp177p1245.html
Hi Torsten,
You are correct. I only fixed the code to handle images up to 99,999 x 99,999 using very simplistic straight line code. I had very little time to do corner case testing of all possible combinations of a more elegant solution. The fits writer code will eventually
be replaced with non-custom code soon, so I don't plan to spend any more time on the custom version right now to handle hypothetical cases.
Karen
On 11/4/2019 5:20 AM, Torsten Roehl [via AstroImageJ] wrote:
Hi, Karen.
I'm not sure if the problem really solved or only shifted to images < 100000 in size.
For example: the file 1000000x1.fits with is easily produced in aij produced the fixed error (NASA VERIFIER) again.
*** Error: NAXIS1 mandatory keyword is not in integer fixed format:
My posted solution used only a third of your code and solves this problem generally:
private String naxis(int value) {
int length = 20 - String.valueOf(value).length();
String spaces = String.format("%" + length + "s", "");
return spaces + value;
}
The question is how long can NAXIS1 or NAXIS2 be?
I have searched the fits-specification-documents, but interestingly i could not find anything about the maximal allowed length of NAXIS1/NAXIS2.
So if you say images can not be so big - then the naxis1/naxis2 header problem is (hopefully) solved.
Torsten