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 have a fits file with periodic BCs which shows projected density of a simulation snapshot. When I compute dendrogram, for structures that straddle the boundaries, the statistics seems to be wrong. please see the example.
importnumpyasnpimportmatplotlib.pyplotaspltfrommatplotlib.colorsimportLogNormfrommatplotlib.tickerimportLogLocatorfromastrodendroimportDendrogramfromastrodendroimportperiodic_neighboursfromastrodendro.analysisimportPPStatisticfromastrodendroimportpp_catalogfromastropy.ioimportfitsfromastropy.tableimportTablefromastropyimportunitsasu############fig1=plt.figure(figsize=(12, 12))
periodic_axis= [0, 1] # data wraps along the y and x axesax=plt.subplot(1, 1, 1)
image=fits.getdata('my_fits.fits')
d=Dendrogram.compute(image, min_value=0.05, min_delta=0.01, min_npix=1,
neighbours=periodic_neighbours(periodic_axis))
p=d.plotter()
im=ax.imshow(image, origin='lower', interpolation='nearest',
cmap='Blues', norm=LogNorm(vmin=0.007, vmax=1.1))
fig1.colorbar(im)
forleafind.leaves:
p.plot_contour(ax, structure=leaf, linewidths=0.3, colors='blue')
p.plot_contour(ax, structure=560, linewidths=0.6, colors='red') ## this is one of straddling structuress=PPStatistic(leaf)
ellipse=s.to_mpl_ellipse(edgecolor='green', linewidth=1, facecolor='none')
ax.add_patch(ellipse)
metadata= {}
metadata['data_unit'] =u.Jycat=pp_catalog(d.leaves, metadata, verbose=False)
cat.write('test_catalog_periodic.txt', format='ascii', overwrite=True)
## load data from catalog iid, area, mass, x, y=np.loadtxt('test_catalog_periodic.txt',
skiprows=1, usecols=(0,2,3,8,9), unpack=True)
for_inrange(0, iid.size):
ifiid[_] ==560:
ax.scatter(x[_], y[_], s=10, color='k')
ax.annotate(iid[_], (x[_], y[_]))
plt.show()
I have a fits file with periodic BCs which shows projected density of a simulation snapshot. When I compute dendrogram, for structures that straddle the boundaries, the statistics seems to be wrong. please see the example.
This is the result.
The text was updated successfully, but these errors were encountered: