<jupyter_start><jupyter_text>Investigation of SDSS image of NGC 450In this notebook I will import the SDSS image of NGC 450 in the g band and investigate some properties of the object.TODO:3D visualisation of flux counts. Compare to Gaussian and Sersic profiles for Galfit value of n. Visualise Galfit fits for one vs two Sersic profiles.<jupyter_code>from regphot import git_version
print("This notebook was run with regphot version: \n{}".format(git_version()))
#Import relevant modules
import matplotlib.pyplot as plt
%matplotlib inline
from astropy.io import fits
from astropy.wcs import WCS
from astropy.nddata import Cutout2D
import numpy as np
import aplpy
from regphot import galfit<jupyter_output><empty_output><jupyter_text>Import the whole SDSS frame<jupyter_code>full = fits.open('frame-g-004858-1-0480.fits')
wcs = WCS('frame-g-004858-1-0480.fits')
apfig = aplpy.FITSFigure(full)
apfig.show_grayscale()
apfig.add_scalebar(0.05, "0.05 degrees", color='white', corner='top right')
apfig.set_theme('publication')
apfig.tick_labels.set_xformat('hh:mm:ss.ssss') #ddd.dddddd')
apfig.tick_labels.set_yformat('dd:mm:ss.ss') #ddd.dddddd')
apfig.ticks.show()
#apfig.ticks.set_xspacing(0.05)
apfig.tick_labels.show()
#apfig.add_grid()<jupyter_output>WARNING: FITSFixedWarning: RADECSYS= 'ICRS ' / International Celestial Ref. System 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: Cannot determine equinox. Assuming J2000. [aplpy.wcs_util]
WARNING: Cannot determine equinox. Assuming J2000. [aplpy.wcs_util]<jupyter_text>Plot 1D profile across centre of main galaxy<jupyter_code>print(len(full[0].data))
y=full[0].data[1210]
x=np.arange(0,len(y),1)
plt.plot(x, y)
plt.xlim([1500,len(y)])
plt.savefig('1dsimple.pdf')


full[0].header<jupyter_output><empty_output><jupyter_text>Extract 1D profile across both galaxies<jupyter_code># from http://stackoverflow.com/questions/7878398/how-to-extract-an-arbitrary-line-of-values-from-a-numpy-array
#-- Extract the line...
# Make a line with "num" points...
x0, y0 = 1650, 1000  # These are in _pixel_ coordinates!!
x1, y1 = 1940, 1440 
length = int(np.hypot(x1-x0, y1-y0))
x, y = np.linspace(x0, x1, length), np.linspace(y0, y1, length)

# Extract the values along the line (why seemingly wrong way round?)
zi = full[0].data[y.astype(np.int), x.astype(np.int)]

#-- Plot...
fig = plt.plot(zi)

#plt.show()
plt.savefig('1dblended.pdf')<jupyter_output><empty_output><jupyter_text>Show line used to generate 1D flux graph<jupyter_code>apfig = aplpy.FITSFigure(full)
apfig.show_grayscale()
apfig.add_scalebar(0.05, "0.05 degrees", color='white', corner='top right')
apfig.set_theme('publication')
apfig.tick_labels.set_xformat('hh:mm:ss.ssss') #ddd.dddddd')
apfig.tick_labels.set_yformat('dd:mm:ss.ss') #ddd.dddddd')
apfig.ticks.show()
#apfig.ticks.set_xspacing(0.05)
apfig.tick_labels.show()
#apfig.add_grid()
ra0, dec0 = wcs.all_pix2world(x0, y0, 0) #, 1500 # These are in _pixel_ coordinates!!
ra1, dec1 = wcs.all_pix2world(x1,y1, 0 )#, 2045
iline = np.array([[ra0, ra1],[dec0,dec1]])
apfig.show_lines([iline], color = 'r')
apfig.savefig('lineonmap.pdf')<jupyter_output>WARNING: FITSFixedWarning: RADECSYS= 'ICRS ' / International Celestial Ref. System 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: Cannot determine equinox. Assuming J2000. [aplpy.wcs_util]
WARNING: Cannot determine equinox. Assuming J2000. [aplpy.wcs_util]
{'fraction_non_alphanumeric': 0.13669484115418246, 'fraction_numerical': 0.041387350626639466, 'mean_word_length': 6.179916317991632, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '347595', 'license': 'MIT', 'n_tokens_mistral': 1439, 'n_tokens_neox': 1319, 'n_words': 302, 'path': 'examples/NGC450.ipynb', 'repo_name': 'raphaelshirley/regphot', 'size': '3431'}