Skip to content

New test problem LSS_SHR#392

Open
vivi235711 wants to merge 12 commits intogamer-project:mainfrom
vivi235711:psidm-shr
Open

New test problem LSS_SHR#392
vivi235711 wants to merge 12 commits intogamer-project:mainfrom
vivi235711:psidm-shr

Conversation

@vivi235711
Copy link
Copy Markdown
Contributor

This pull request adds a new test problem named LSS_SHR. It builds upon the existing LSS_Hybrid problem and provides Python scripts for analyzing the soliton-halo relationship.

  • Analysis Scripts: The included scripts reside in the plot_script subdirectory with README.md.
  • Paper Reproduction: The provided initial condition for LSS_SHR can reproduce the halo in this paper.
  • Scripts related to this paper's figures are located at plot_script/script_for_paper_fig.
  • SHR Prediction Tool Integration: LSS_SHR utilizes the shr prediction tool managed through Git modules.

@hyschive hyschive requested a review from koarakawaii January 2, 2025 02:26
@hyschive hyschive added test Test problems fdm Fuzzy dark matter enhancement labels Jan 2, 2025
@hyschive hyschive requested review from hyschive and removed request for koarakawaii February 10, 2026 03:07
@hyschive hyschive assigned hyschive and unassigned koarakawaii Feb 10, 2026
Copy link
Copy Markdown
Contributor

@hyschive hyschive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vivi235711 Thanks for the contribution! Please check my comment regarding a potential incompatibility issue with the latest SHR module.

ms_ws = df_vel['core_QP']/kpc2km*soliton_m_div_v
plt.plot(time_a, (core_mass/ms_ws),':', color = 'gray', label = 'fidelity')

plt.plot(time_a,(core_mass/shr_calculator.revised_theo_c_FDM_Ms(0,halo_mass,m22)),'-.', color = 'black', label = 'ms sim/theo')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Why is redshift fixed to 0?
  • This line seems incompatible with the latest SHR modul. Note that revised_theo_c_FDM_Ms returns 8 quantities (ms, rs, peak_dens, Rh, NFW_Rs, c_theo, c_CDM, beta), whereas here we only need the core mass.
    • I think this issue is caused by the fact that git submodule update --init points to the commit hash 57832b41de1f4c0284ca929b52ee1712d7af68f3 rather than the latest commit d6de09ca7ca2449c3614d135fb8adb96ec0bbb46. Please update this PR to use the latest commit.
    • If this is indeed an incompatibility issue, please update all scripts in script_for_paper_fig/ as well.

Note that the second point above leads to the following error:

Command-line arguments:
-------------------------------------------------------------------
plot__all.py -s 30 -e 37 -halo 1
-------------------------------------------------------------------
Traceback (most recent call last):
  File "/projectV/fish/gamer_test/t21-pr-lss-shr/gamer.new/bin/run/plot_script/plot__all.py", line 92, in <module>
    plt.plot(time_a,(core_mass/shr_calculator.revised_theo_c_FDM_Ms(0,halo_mass,m22)),'-.', color = 'black', label = 'ms sim/theo')
  File "/usr/local/lib/python3.10/dist-packages/pandas/core/ops/common.py", line 81, in new_method
    return method(self, other)
  File "/usr/local/lib/python3.10/dist-packages/pandas/core/arraylike.py", line 210, in __truediv__
    return self._arith_method(other, operator.truediv)
  File "/usr/local/lib/python3.10/dist-packages/pandas/core/series.py", line 6113, in _arith_method
    return base.IndexOpsMixin._arith_method(self, other, op)
  File "/usr/local/lib/python3.10/dist-packages/pandas/core/base.py", line 1350, in _arith_method
    return self._construct_result(result, name=res_name)
  File "/usr/local/lib/python3.10/dist-packages/pandas/core/series.py", line 3106, in _construct_result
    out = self._constructor(result, index=self.index, dtype=dtype)
  File "/usr/local/lib/python3.10/dist-packages/pandas/core/series.py", line 509, in __init__
    data = sanitize_array(data, index, dtype, copy)
  File "/usr/local/lib/python3.10/dist-packages/pandas/core/construction.py", line 607, in sanitize_array
    subarr = _sanitize_ndim(subarr, data, dtype, index, allow_2d=allow_2d)
  File "/usr/local/lib/python3.10/dist-packages/pandas/core/construction.py", line 666, in _sanitize_ndim
    raise ValueError(
ValueError: Data must be 1-dimensional, got ndarray of shape (8, 8) instead

Comment thread .gitmodules
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Add a note in README.md describing how to set-up the SHR module.
  • Also check my comment in plot__all.py about an incompatibility issue.

combined_df['ratio_revised'] = combined_df['core_mass']*0
combined_df['ratio_schive'] = combined_df['core_mass']*0
ratio_revised = []
ratio_shcive = []
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ratio_shcive = []
ratio_schive = []

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement fdm Fuzzy dark matter test Test problems

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants