diff --git a/applications/smurf/libsmf/smf_jsatile.c b/applications/smurf/libsmf/smf_jsatile.c index 4a5900b1d12..9fc00555b38 100644 --- a/applications/smurf/libsmf/smf_jsatile.c +++ b/applications/smurf/libsmf/smf_jsatile.c @@ -89,6 +89,9 @@ * right of the all sky pixel grid. * 12-JUN-2014 (DSB): * Added argument "usexph". +* 30-SEP-2014 (DSB): +* Set up correct properties for the JSA_PIXEL Frame, returned within +* the all-sky WCS. * {enter_further_changes_here} * Copyright: @@ -146,6 +149,7 @@ void smf_jsatile( int itile, smfJSATiling *skytiling, int local_origin, int usex int icrpix1; int icrpix2; int icur; + int isky; int move; int offset; @@ -211,6 +215,21 @@ void smf_jsatile( int itile, smfJSATiling *skytiling, int local_origin, int usex astSetD( lfs, "SkyRef(1)", point2[ 0 ] ); astSetD( lfs, "SkyRef(2)", point2[ 1 ] ); +/* If an allsky grid was created above, it may contain a Frame + representing the all-sky JSA HPX pixel grid. This Frame will have + Domain "XJSA-YJSA". Change its Frame attributes to more useful values. */ + if( itile == -1 && !usexph ) { + isky = astGetI( lfs, "Current" ); + astSetC( lfs, "Current", "XJSA-YJSA" ); + astSetC( lfs, "Domain", "JSA_PIXEL" ); + astSetC( lfs, "Label(1)", "JSA pixel coordinate 1" ); + astSetC( lfs, "Label(2)", "JSA pixel coordinate 2" ); + astSetC( lfs, "Unit(1)", "pixel" ); + astSetC( lfs, "Unit(2)", "pixel" ); + astSetC( lfs, "Title", "JSA all-sky pixel coordinates" ); + astSetI( lfs, "Current", isky ); + } + /* If required, create a Region (a Box) describing the tile in GRID coords. GRID coords are described by the base Frame in the FrameSet. Reduce the size of the box slightly to avoid bad sky values at the edges of diff --git a/applications/smurf/libsmf/smf_jsatileheader.c b/applications/smurf/libsmf/smf_jsatileheader.c index fabf44c15a8..3ac5cf34e7c 100644 --- a/applications/smurf/libsmf/smf_jsatileheader.c +++ b/applications/smurf/libsmf/smf_jsatileheader.c @@ -106,6 +106,9 @@ * - Added argument "move". * 12-JUN-2014 (DSB): * Added argument "usexph". +* 30-SEP-2014 (DSB): +* Include a Frame representing JSA all-sky HPX pixel coordinates +* within the all-sky WCS. * {enter_further_changes_here} * Copyright: @@ -199,6 +202,23 @@ AstFitsChan *smf_jsatileheader( int itile, smfJSATiling *skytiling, fc = smfMakeFC( ng, ng, skytiling->ntpf, 1, gx_ref, gy_ref, ra_ref, dec_ref, usexph, status ); +/* For HPX, add in an alternate axis descriptions describing the JSA pixel (x,y) + coordinate grid. */ + if( ! usexph ) { + astPutFits( fc, "CTYPE1A = 'XJSA'", 1 ); + astPutFits( fc, "CTYPE2A = 'YJSA'", 1 ); + astPutFits( fc, "CRVAL1A = -1.0", 1 ); + astPutFits( fc, "CRVAL2A = -1.0", 1 ); + sprintf( card, "CRPIX1A = %.15g", gx_ref ); + astPutFits( fc, card, 1 ); + sprintf( card, "CRPIX2A = %.15g", gy_ref ); + astPutFits( fc, card, 1 ); + sprintf( card, "CDELT1A = %d",skytiling->ppt ); + astPutFits( fc, card, 1 ); + sprintf( card, "CDELT2A = %d",skytiling->ppt ); + astPutFits( fc, card, 1 ); + } + /* Otherwise, get the number of pixels along one edge of a facet. */ } else { m = skytiling->ntpf*skytiling->ppt;