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
Hello,
I have the following problem: I determine the center of a structure, let's say structure A, using the "x_cen" and "y_cen" routine from PPStatistic. If I take the values stored in the outcome (after rounding to integers) and plug this into the routine "structure_at" e.g. like "structure_at(round(x_cen),round(y_cen))", it does not give me back structure A. Rather I have to use "structure_at(round(y_cen),round(x_cen))", so using the coordinates in a switched manner. I have also a minimal example describing this if needed. I am wondering if I am doing something wrong here or misinterpreting the outcome of the routines. Thanks.
The text was updated successfully, but these errors were encountered:
It would be helpful to provide that minimal example. But I think this is the expected, if only poorly documented, result: structure_at uses numpy indexing.
Hi,
most probable you are right.
Attached you find the minimum example using a 3x3 image with one structure. Please apologize the naming "test-program.txt", GitHub didn't allow me to upload a file ending with ".py" 3x3.txt test-program.txt
importnumpyasnpfromastrodendroimportDendrogramfromastrodendro.analysisimportPPStatisticdata=np.array([[0,1,0], [0,0,0], [0,0,0]])
print(data)
d=Dendrogram.compute(data, min_value=0.5, min_delta=0., min_npix=1)
# there is only one structure in totalprint(d.trunk[0])
print(d.trunk[0].indices())
stat=PPStatistic(d.trunk[0])
xcen=stat.x_cen.valueycen=stat.y_cen.valueprint(xcen,ycen)
# Gives "None"print(d.structure_at((round(xcen),round(ycen))))
#Gives the right result, but x- and y-coordinate are switchedprint(d.structure_at((round(ycen),round(xcen))))
Hello,
I have the following problem: I determine the center of a structure, let's say structure A, using the "x_cen" and "y_cen" routine from PPStatistic. If I take the values stored in the outcome (after rounding to integers) and plug this into the routine "structure_at" e.g. like "structure_at(round(x_cen),round(y_cen))", it does not give me back structure A. Rather I have to use "structure_at(round(y_cen),round(x_cen))", so using the coordinates in a switched manner. I have also a minimal example describing this if needed. I am wondering if I am doing something wrong here or misinterpreting the outcome of the routines. Thanks.
The text was updated successfully, but these errors were encountered: