You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did the observations in galactic co-ordinates, but would like to generate the cubes in equatorial coordinates. Is there a way to specify the desired coordinates while running the gbtgridder?
I tried to use the --clonecube option with a sample cube with header in RA-Dec, but the output is still given in galactic coordinates.
The text was updated successfully, but these errors were encountered:
Dear Spandan,
Sorry for the late reply.
The gbtgridder does not handle coordinate transformations. dysh will provide the functionality to change between coordinate systems.
To change the coordinates of your data you can use the following as a guide (be warned, that this example will overwrite the data since it uses flush):
fromastropy.ioimportfitsfromastropyimportunitsasufromastropy.coordinatesimportSkyCoorddefeq2gal(table):
""" Transform the coordinates in `table` from Equatorial to Galactic. Parameters ---------- table : `~astropy.FITS_rec` SDFITS table with the data and coordinates. Returns ------- table : `~astropy.FITS_rec` SDFITS table with all Equatorial coordinates changed to Galactic. """mask= (table["CTYPE2"] =="RA ") & (table["CTYPE3"] =="DEC ")
coo=SkyCoord(table["CRVAL2"][mask]*u.deg, table["CRVAL3"][mask]*u.deg, frame="fk5")
glon=coo.galactic.l.degglat=coo.galactic.b.degtable["CTYPE2"][mask] ="GLON"table["CRVAL2"][mask] =glontable["CTYPE3"][mask] ="GLAT"table["CRVAL3"][mask] =glatreturntablemyfile="/home/scratch/psalas/file.fits"hdu=fits.open(myfile, mode="update")
table=hdu[1].datatable=eq2gal(table)
hdu[1].data=tablehdu.flush()
Hi,
I did the observations in galactic co-ordinates, but would like to generate the cubes in equatorial coordinates. Is there a way to specify the desired coordinates while running the gbtgridder?
I tried to use the
--clonecube
option with a sample cube with header in RA-Dec, but the output is still given in galactic coordinates.The text was updated successfully, but these errors were encountered: