Commit c5b4f5a7 authored by Johan Richard's avatar Johan Richard
Browse files

Corrected WCS limits when reading datacube

parent 0655e790
......@@ -177,7 +177,7 @@ double ***readcube(struct g_cube *P)
else if (P->format == 3)
{
zf= (double ***)rdf_cube_fits(P->pixfile, &nx, &ny, &nz, &header, &lmin, &lmax);
P->wcsinfo = wcsinit(header);
if (P->wcsinfo != NULL && M.iref != 0)
......@@ -209,7 +209,7 @@ double ***readcube(struct g_cube *P)
P->lmax = lmax;
if (P->pixelx == 0. && P->pixely == 0. && M.iref != 0)
{
{
/*Convert to relative position in arcsec*/
P->xmin = xmin - M.ref_ra;
P->xmin *= -3600. * cos(M.ref_dec * DTR);
......@@ -224,7 +224,11 @@ double ***readcube(struct g_cube *P)
P->pixely = (P->ymax - P->ymin) / ((double)(P->ny - 1));
}
else
{
{
P->xmin = xmin - M.ref_ra;
P->xmin *= -3600. * cos(M.ref_dec * DTR);
P->ymin = ymin - M.ref_dec;
P->ymin *= 3600.;
P->xmax = P->xmin + P->pixelx * (double)(P->nx - 1);
P->ymax = P->ymin + P->pixely * (double)(P->ny - 1);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment