Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 35 additions & 10 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,43 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: mamba-org/setup-micromamba@v1
- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache
df -h
shell: bash -el {0}
- name: Prepare large temp dir
run: |
if [ -d /mnt ]; then
sudo mkdir -p /mnt/runner-temp
sudo chown "$USER":"$USER" /mnt/runner-temp
echo "PYSM_TEMP_ROOT=/mnt/runner-temp" >> "$GITHUB_ENV"
else
echo "PYSM_TEMP_ROOT=$RUNNER_TEMP" >> "$GITHUB_ENV"
fi
shell: bash -el {0}
- name: Set temp locations
run: |
echo "ASTROPY_CACHE_DIR=$PYSM_TEMP_ROOT/astropy-cache" >> "$GITHUB_ENV"
echo "ASTROPY_CONFIG_DIR=$PYSM_TEMP_ROOT/astropy-config" >> "$GITHUB_ENV"
echo "XDG_CACHE_HOME=$PYSM_TEMP_ROOT/xdg-cache" >> "$GITHUB_ENV"
echo "XDG_CONFIG_HOME=$PYSM_TEMP_ROOT/xdg-config" >> "$GITHUB_ENV"
echo "TMPDIR=$PYSM_TEMP_ROOT/astropy-tmp" >> "$GITHUB_ENV"
echo "HOME=$PYSM_TEMP_ROOT/home" >> "$GITHUB_ENV"
shell: bash -el {0}
- name: Prepare cache directories
run: |
mkdir -p "$HOME" "$ASTROPY_CACHE_DIR" "$ASTROPY_CONFIG_DIR" \
"$XDG_CACHE_HOME" "$XDG_CONFIG_HOME" "$TMPDIR"
shell: bash -el {0}
- name: Set up Python
uses: actions/setup-python@v5
with:
environment-name: test-env
create-args: >-
python=${{ matrix.python }}
netcdf4
init-shell: >-
bash
cache-environment: true
post-cleanup: 'all'
python-version: ${{ matrix.python }}
- name: Install package
run: pip install .[test]
run: |
python -m pip install --upgrade pip
python -m pip install --no-cache-dir .[test]
shell: bash -el {0}
- name: Run Pytest
run: |
Expand Down
42 changes: 31 additions & 11 deletions .github/workflows/import_base_requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,40 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: mamba-org/setup-micromamba@v1
- name: Prepare large temp dir
run: |
if [ -d /mnt ]; then
sudo mkdir -p /mnt/runner-temp
sudo chown "$USER":"$USER" /mnt/runner-temp
echo "PYSM_TEMP_ROOT=/mnt/runner-temp" >> "$GITHUB_ENV"
else
echo "PYSM_TEMP_ROOT=$RUNNER_TEMP" >> "$GITHUB_ENV"
fi
shell: bash -el {0}
- name: Set temp locations
run: |
echo "ASTROPY_CACHE_DIR=$PYSM_TEMP_ROOT/astropy-cache" >> "$GITHUB_ENV"
echo "ASTROPY_CONFIG_DIR=$PYSM_TEMP_ROOT/astropy-config" >> "$GITHUB_ENV"
echo "XDG_CACHE_HOME=$PYSM_TEMP_ROOT/xdg-cache" >> "$GITHUB_ENV"
echo "XDG_CONFIG_HOME=$PYSM_TEMP_ROOT/xdg-config" >> "$GITHUB_ENV"
echo "TMPDIR=$PYSM_TEMP_ROOT/astropy-tmp" >> "$GITHUB_ENV"
echo "HOME=$PYSM_TEMP_ROOT/home" >> "$GITHUB_ENV"
shell: bash -el {0}
- name: Prepare cache directories
run: |
mkdir -p "$HOME" "$ASTROPY_CACHE_DIR" "$ASTROPY_CONFIG_DIR" \
"$XDG_CACHE_HOME" "$XDG_CONFIG_HOME" "$TMPDIR"
shell: bash -el {0}
- name: Set up Python
uses: actions/setup-python@v5
with:
environment-name: test-env
create-args: >-
python=${{ matrix.python }}
netcdf4
init-shell: >-
bash
cache-environment: true
post-cleanup: 'all'
python-version: ${{ matrix.python }}
- name: Install base requirements
run: pip install .
run: |
python -m pip install --upgrade pip
python -m pip install --no-cache-dir .
shell: bash -el {0}
- name: Check import
run: |
python -c "import pysm3"
shell: bash -el {0}
shell: bash -el {0}
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Unreleased
==========
- Add NumPy 2 support by replacing deprecated `np.trapz` with `trapezoid` https://github.com/galsci/pysm/pull/232
- Add HalfDome TSZ maps (new 'tsz2' model) to pysm. Create new documentation and code following the same structural approach used for WebSky.

3.4.3 (2025-10-02)
==================
Expand Down
37 changes: 37 additions & 0 deletions docs/halfdome.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.. _halfdome:

HalfDome
******

HalfDome cosmological simulations are a set of simulations tailored for the joint analysis of Stage-IV surveys. For more information, see: [https://halfdomesims.github.io/] (https://halfdomesims.github.io/)

Cosmic Infrared Background
--------------------------

TODO

Radio Galaxies
--------------

TODO

Thermal SZ Effect
-----------------

Provided are eleven realizations of the Compton-y parameter. They were generated with xgpaint bataglia16 profiles at $N_{side}=8192$.

Kinetic SZ Effect
-----------------

TODO


Lensing Convergence
-------------------

TODO

Primary and lensed CMB
----------------------

TODO
3 changes: 3 additions & 0 deletions docs/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,11 @@ Sunyaev–Zeldovich emission

- **tsz1**: Thermal SZ emission from WebSky 0.4. Available at $N_{side}=8192$. For more details see :ref:`websky`.

- **tsz2**: Thermal SZ emission from HalfDome 0.1. Generated using xgpaint with Battaglia16 profiles. Eleven realizations available at $N_{side}=8192$. For more details see :ref:`halfdome`.

- **ksz1**: Kinetic SZ emission from WebSky 0.4. Available at $N_{side}=4096$. For more details see :ref:`websky`.


Radio galaxies
==============

Expand Down
7 changes: 7 additions & 0 deletions src/pysm3/data/presets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,13 @@ class = "WebSkySZ"
version = "0.4"
sz_type = "thermal"
max_nside = 4096
[tsz2]
class = "HalfDomeSZ"
version = "0.1"
sz_type = "thermal"
map_sz = "y_b16_halo_res1_s{seed}.fits"
seed = 0
max_nside = 8192
[dip1]
# From NPIPE https://doi.org/10.1051/0004-6361/202038073
#
Expand Down
8 changes: 8 additions & 0 deletions src/pysm3/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,13 @@
WebSkySZ,
WebSkyRadioGalaxies,
)
from .halfdome import (
HalfDomeSZ,
# SPT_CIB_map_scaling,
# HalfDomeCMB,
# HalfDomeCIB,
# HalfDomeSZ,
# HalfDomeRadioGalaxies,
)
from .catalog import PointSourceCatalog
from .dipole import CMBDipole
13 changes: 9 additions & 4 deletions src/pysm3/models/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,16 @@ def __init__(
else:
self.catalog_slice = catalog_slice

def _attr_to_str(value):
if isinstance(value, (bytes, np.bytes_)):
return value.decode("utf-8")
return str(value)

with h5py.File(self.catalog_filename) as f:
assert f["theta"].attrs["units"].decode("UTF-8") == "rad"
assert f["phi"].attrs["units"].decode("UTF-8") == "rad"
assert f["logpolycoefflux"].attrs["units"].decode("UTF-8") == "Jy"
assert f["logpolycoefpolflux"].attrs["units"].decode("UTF-8") == "Jy"
assert _attr_to_str(f["theta"].attrs["units"]) == "rad"
assert _attr_to_str(f["phi"].attrs["units"]) == "rad"
assert _attr_to_str(f["logpolycoefflux"].attrs["units"]) == "Jy"
assert _attr_to_str(f["logpolycoefpolflux"].attrs["units"]) == "Jy"

assert map_dist is None, "Distributed execution not supported"

Expand Down
Loading
Loading