import numpy as np
import matplotlib.pyplot as plt
from astropy.io import fits
from astropy import wcs
from astropy.wcs import WCS
from astropy.io import ascii
import astropy.coordinates as coord
import astropy.units as u
import healpy as hp
from healpy.newvisufunc import projview, newprojplot
from matplotlib.colors import LogNorm
fn = '/home/justin/DRAGONS/DRAGONS_healpix_frequency_cubes/dragons_freqK_gal_conv_i.hpx.fits'
freqKdat = fits.getdata(fn)
freqKhdr = fits.getheader(fn)
freqKhdr
SIMPLE = T / conforms to FITS standard
BITPIX = -64 / array data type
NAXIS = 2 / number of array dimensions
NAXIS1 = 196608
NAXIS2 = 680
DATE = '2025-11-18'
INSTRUME= 'DRAO-15 '
EPOCH = '2000 '
CDELT2 = 1.0
CRPIX2 = 1
CRVAL2 = 350.520833
CTYPE2 = 'FREQ '
BUNIT = 'K '
CUNIT2 = 'MHz '
COMMENT Convolved to 3.6 degree beam (resolution at 350 MHz)
hp.mollview(freqKdat[261],
title = r'Stokes $I$ at 610.52 MHz',
cmap = 'cubehelix',
min = 0,
max = 40)
hp.graticule()
