[daip] FITS header

Mark Calabretta mcalabre at atnf.CSIRO.AU
Wed Sep 29 20:42:34 EDT 2004


On Wed 2004/09/29 10:38:16 CST, Eric Greisen wrote
in a message to: Ian Pattison <ip at ast.leeds.ac.uk>
and copied to: daip at aoc.nrao.edu

>I have done a whole bunch of positions comparing ds9 with aips where I
>converted the axis increment to be square at the average.  The short
>answer is that ds9 and aips disagree usually by 0.1 arc sec or less
>although one point was 0.3 arc sec in Dec.  So I suspect that ds9 is
>using the full skew but that these averaged parameters are a rather
>good representation as well.

The best approximation would be to use the procedure described in
Paper II, averaging rho_a and rho_b and computing unequal CDELTi.

I've appended the test program I used for the computation, it should
be straightforward to compile if you have WCSLIB installed and you can
easily modify it to compute the coordinates for any desired pixel.

Cheers, Mark

>>>

#include <stdio.h>
#include <string.h>
#include <wcslib/wcs.h>

main()
{
  int err, stat[1];
  double phi[1], theta[1];
  double img[1][2], pix[1][2], world[1][2];
  struct wcsprm wcs;

  wcsini(1, 2, &wcs);

  wcs.crpix[0] = 3843.0;
  wcs.crpix[1] = 3027.0;

  wcs.cd[0] = -1.1311934e-06;
  wcs.cd[1] = -9.2409377e-05;
  wcs.cd[2] = -9.2393246e-05;
  wcs.cd[3] =  1.1725260e-06;
  wcs.altlin = 2;

  wcs.crval[0] = 23.262131;
  wcs.crval[1] = 30.625887;

  strcpy(wcs.ctype[0], "RA---TAN");
  strcpy(wcs.ctype[1], "DEC--TAN");

  pix[0][0] = 2975.0;
  pix[0][1] = 3274.0;

  err = wcsp2s(&wcs, 1, 2, pix[0], img[0], phi, theta, world[0], stat);
  printf("%d %d [%.9f, %.9f]\n", err, stat[0], world[0][0], world[0][1]);

  return 0;
}





More information about the Daip mailing list