In particular, the mJPEG utility.
I have three SDSS FITS, cutouts created by GALFIT, all the same size, all centered on the same object; mJPEG gets upset: "Red and green FITS images don't match." From the detailed dump, I see that the values for crval1, crval2, crpix1, crpix2, and crota2 are not the same, in the two FITS ('red' and 'green'; I expect the same mismatch for 'blue').
What are these parameters? Which ones need to be the same, for mJPEG to work? How to create a (set of) FITS with values that mJPEG will accept?
Of course, I can simply edit two FITS headers, copying the values of these five parameters from the third (and this will no doubt work, sorta), but I'd *much* prefer to know what I'm doing ...
Anyone familiar with Montage?
- Chris Peterson
- Abominable Snowman
- Posts: 18594
- Joined: Wed Jan 31, 2007 11:13 pm
- Location: Guffey, Colorado, USA
- Contact:
Re: Anyone familiar with Montage?
The mJPEG tool requires all the files to have the same WCS information. That means all of the CR... keys must have the same values, and possibly some of the other, non-WCS entries (EPOCH, LAT, LONG) that might be used by the WCS engine. You can see the FITS standard for a list of WCS keywords.JeanTate wrote:In particular, the mJPEG utility.
I have three SDSS FITS, cutouts created by GALFIT, all the same size, all centered on the same object; mJPEG gets upset: "Red and green FITS images don't match." From the detailed dump, I see that the values for crval1, crval2, crpix1, crpix2, and crota2 are not the same, in the two FITS ('red' and 'green'; I expect the same mismatch for 'blue').
What are these parameters? Which ones need to be the same, for mJPEG to work? How to create a (set of) FITS with values that mJPEG will accept?
Of course, I can simply edit two FITS headers, copying the values of these five parameters from the third (and this will no doubt work, sorta), but I'd *much* prefer to know what I'm doing ...
You can try forcing all the header values to match. The fact that they don't suggests there might be a fundamental alignment issue, so your results may be less than perfect. Have you tried a more simple approach, like just combining the layers in Photoshop?
Chris
*****************************************
Chris L Peterson
Cloudbait Observatory
https://www.cloudbait.com
*****************************************
Chris L Peterson
Cloudbait Observatory
https://www.cloudbait.com
Re: Anyone familiar with Montage?
Thank you Chris.
What's odd is that the FITS used by GALFIT were extracted from three SDSS FITS using Montage's mSubimage module, with identical input (RA, Dec, size) values!Chris Peterson wrote:The mJPEG tool requires all the files to have the same WCS information. That means all of the CR... keys must have the same values, and possibly some of the other, non-WCS entries (EPOCH, LAT, LONG) that might be used by the WCS engine. You can see the FITS standard for a list of WCS keywords.JeanTate wrote:In particular, the mJPEG utility.
I have three SDSS FITS, cutouts created by GALFIT, all the same size, all centered on the same object; mJPEG gets upset: "Red and green FITS images don't match." From the detailed dump, I see that the values for crval1, crval2, crpix1, crpix2, and crota2 are not the same, in the two FITS ('red' and 'green'; I expect the same mismatch for 'blue').
What are these parameters? Which ones need to be the same, for mJPEG to work? How to create a (set of) FITS with values that mJPEG will accept?
Of course, I can simply edit two FITS headers, copying the values of these five parameters from the third (and this will no doubt work, sorta), but I'd *much* prefer to know what I'm doing ...
Yes, that's easy enough to do ... but I'm really quite interested in why the values are different, and how I can force them to match in a way that ensures each of the RGB pixels will come from as close to the same points on the sky as possible.You can try forcing all the header values to match.
No. For starters, I do not have Photoshop (nor any desire to get it); more importantly, I'm more interested - for now - in learning why mJPEG is getting indigestion, and how I can make it happy, without doing silly things.The fact that they don't suggests there might be a fundamental alignment issue, so your results may be less than perfect. Have you tried a more simple approach, like just combining the layers in Photoshop?
- Chris Peterson
- Abominable Snowman
- Posts: 18594
- Joined: Wed Jan 31, 2007 11:13 pm
- Location: Guffey, Colorado, USA
- Contact:
Re: Anyone familiar with Montage?
Well, it's pretty unusual to have any two FITS images with matching WCS data. Even the most microscopic shift in position or rotation between the images will result in different WCS values. What I'd expect a layering/stacking tool to do is to utilize the WCS information in the header in order to manage the alignment. That's what all the software I use does.JeanTate wrote:Yes, that's easy enough to do ... but I'm really quite interested in why the values are different, and how I can force them to match in a way that ensures each of the RGB pixels will come from as close to the same points on the sky as possible.You can try forcing all the header values to match.
Chris
*****************************************
Chris L Peterson
Cloudbait Observatory
https://www.cloudbait.com
*****************************************
Chris L Peterson
Cloudbait Observatory
https://www.cloudbait.com
Re: Anyone familiar with Montage?
Thanks again Chris.
Reading the FITS standard (per the link you posted), together with the key words in the FITS header, I have most of what I need to make sense of all this.
In particular, CTYPE1 is 'RA---TAN'; CTYPE2 'DEC--TAN'; CUNIT1 (and 2) is 'deg'; CRVAL1 and 2 make sense as RA and DEC, expressed in degrees; and CDi_j as the elements of a 2 X 2 matrix, whose elements have the dimension degrees per pixel. Further, "The algorithm to be used to define the spherical projection must be encoded in the CTYPEi keyword as the three-letter algorithm code, the allowed values for which are specified in Table 23 and defined in references Calabretta & Greisen (2002) and Calabretta & Roukema (2007)." Table 23 tells me that the code "TAN" has properties detailed in section 5.1.3 of Calabretta & Greisen (2002), and is a "Gnomonic" projection. Which is all well and good ... except that there is no section 5.1.3 in Calabretta & Greisen (2002)! And that reference is skimpy indeed on projections in general.
What I am missing, therefore, is a definition of the particular gnomonic projection used, and thus the formula(e) to be used to do the final step (or the specific algorithm).
Any ideas?
Reading the FITS standard (per the link you posted), together with the key words in the FITS header, I have most of what I need to make sense of all this.
In particular, CTYPE1 is 'RA---TAN'; CTYPE2 'DEC--TAN'; CUNIT1 (and 2) is 'deg'; CRVAL1 and 2 make sense as RA and DEC, expressed in degrees; and CDi_j as the elements of a 2 X 2 matrix, whose elements have the dimension degrees per pixel. Further, "The algorithm to be used to define the spherical projection must be encoded in the CTYPEi keyword as the three-letter algorithm code, the allowed values for which are specified in Table 23 and defined in references Calabretta & Greisen (2002) and Calabretta & Roukema (2007)." Table 23 tells me that the code "TAN" has properties detailed in section 5.1.3 of Calabretta & Greisen (2002), and is a "Gnomonic" projection. Which is all well and good ... except that there is no section 5.1.3 in Calabretta & Greisen (2002)! And that reference is skimpy indeed on projections in general.
What I am missing, therefore, is a definition of the particular gnomonic projection used, and thus the formula(e) to be used to do the final step (or the specific algorithm).
Any ideas?
Re: Anyone familiar with Montage?
The reference in the FITS standard document is incorrect!
It is "Greisen, E.W. & Calabretta, M. R. 2002, A&A, 395, 1061", which is entitled "Representations of world coordinates in FITS"; the correct reference is "Greisen, E.W. & Calabretta, M. R. 2002, A&A, 395, 1077", which is entitled "Representations of celestial coordinates in FITS". Now all I need is how to transform between the particular gnomonic projection and spherical coordinates RA and Dec ...
It is "Greisen, E.W. & Calabretta, M. R. 2002, A&A, 395, 1061", which is entitled "Representations of world coordinates in FITS"; the correct reference is "Greisen, E.W. & Calabretta, M. R. 2002, A&A, 395, 1077", which is entitled "Representations of celestial coordinates in FITS". Now all I need is how to transform between the particular gnomonic projection and spherical coordinates RA and Dec ...