From 2f887282ea20cf2ad9c42604e2197d69ab011d19 Mon Sep 17 00:00:00 2001 From: Kartik Neralwar <87446855+Kartik-Neralwar@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:24:34 +0200 Subject: [PATCH 1/2] Added a function to get J plot and RJ plot J_class() gives the j plot classification based on j1 and j2 get_class_j_rj() calls functions to give the classes based on j plot and rj plots --- RJplots.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/RJplots.py b/RJplots.py index 0c0e270..ad5cf2c 100644 --- a/RJplots.py +++ b/RJplots.py @@ -5,6 +5,10 @@ ### The following are outward facing functions which may be called ### The main function of the package, returns the RJ-values of a 2D image (2d-array) as well as the classification of the structure. + + + + def get_rj(image): J1,J2,com,theta = moments(image) @@ -17,6 +21,37 @@ def get_rj(image): return RJ1,RJ2,cla + +### get_class_j_rj and J_class functions are added by Kartik Neralwar. These give the j plot class and the rj plot class for a structure +def get_class_j_rj(image): + + J1,J2,com,theta = moments(image) + + RJ1 = (J1 - J2)/np.sqrt(2) + RJ2 = (J1 + J2)/np.sqrt(2) + RJ2 = RJ2/(-RJ1 + np.sqrt(2)) + + cla = classification(RJ1,RJ2) + J_cla = J_class(J1, J2) + return J_cla, cla + +### J plot class as defined in Neralwar + 2022 +### 0 - Bubble +### 1 - Filament +### 2 - Core +def J_class(J1, J2): + if(J1<0 and J2<0): + struc_1 = 0 + if(J1>0 and J2<0): + struc_1 = 1 + if(J1>0 and J2>0): + struc_1 = 2 + else: + struc_1 = 3 + return struc_1 + + + ### Uses the classification scheme described in the accompanying paper. ### 1 - Quasi-circular, centrally over-dense ### 2 - Quasi-circular, centrally under-dense From ae1012f388098317c1cbd4994006d7364eb38cf1 Mon Sep 17 00:00:00 2001 From: Kartik Neralwar <87446855+Kartik-Neralwar@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:27:05 +0200 Subject: [PATCH 2/2] Added J plot class description --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a160c9d..f683b40 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,13 @@ An example script is provided which shows how to use the package. It calculates * 3 - Elongated, centrally over-dense, * 4 - Elongated, centrally under-dense. +The J plot classification referes to the following shapes: +* 0 - Bubbles +* 1 - Filaments +* 2 - Cores + ## Acknowledgements This code was produced with the support of the Ministry of Science and Technology (MoST) in Taiwan through grant MoST 108-2112-M-001-004-MY2 ## Contact -For up-to-date contact information see my [website](https://seamusclarke.github.io/#five) \ No newline at end of file +For up-to-date contact information see my [website](https://seamusclarke.github.io/#five)