Skip to content

Commit

Permalink
smurf: Add JSA pixel coord Frame to all-sky JSA map made by jsatileinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
David Berry committed Sep 30, 2014
1 parent e70ec0e commit 26b29d3
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
19 changes: 19 additions & 0 deletions applications/smurf/libsmf/smf_jsatile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand Down
20 changes: 20 additions & 0 deletions applications/smurf/libsmf/smf_jsatileheader.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 26b29d3

Please sign in to comment.