{"id":18620509,"url":"https://github.com/simonsobs/soopersims","last_synced_at":"2026-01-03T03:03:22.152Z","repository":{"id":234512969,"uuid":"789050093","full_name":"simonsobs/SOOPERSIMS","owner":"simonsobs","description":"Simulations for the SOOPERCOOL pipeline","archived":false,"fork":false,"pushed_at":"2025-06-03T09:46:39.000Z","size":193,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-30T03:38:38.088Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonsobs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-04-19T15:57:43.000Z","updated_at":"2025-06-03T09:46:40.000Z","dependencies_parsed_at":"2025-08-30T03:32:06.894Z","dependency_job_id":"b9bef13d-f27a-4e6d-80e2-0b2e72a67f88","html_url":"https://github.com/simonsobs/SOOPERSIMS","commit_stats":{"total_commits":26,"total_committers":3,"mean_commits":8.666666666666666,"dds":"0.23076923076923073","last_synced_commit":"5c93ae4cfc2fed9cde6521677795fac226e78a4f"},"previous_names":["simonsobs/soopersims"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/simonsobs/SOOPERSIMS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsobs%2FSOOPERSIMS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsobs%2FSOOPERSIMS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsobs%2FSOOPERSIMS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsobs%2FSOOPERSIMS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonsobs","download_url":"https://codeload.github.com/simonsobs/SOOPERSIMS/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsobs%2FSOOPERSIMS/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28183010,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2026-01-03T02:00:06.471Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T04:06:37.780Z","updated_at":"2026-01-03T03:03:22.133Z","avatar_url":"https://github.com/simonsobs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SOOPERSIMS\nLibrary to generate simulations for the `SOOPERCOOL` pipeline (https://github.com/simonsobs/SOOPERCOOL), for transfer function estimation or covariance matrix calculation.\n\n---\n\n## Codes description\nThe scripts generate two type of simulations:\n- simulations for transfer function estimation\n- simulations for covariance matrix calculation\n\n### Transfer function type\nThe transfer function can be estimated by computing the power spectra of simulated maps before filtering and comparing them with the spectra of the same maps after filtering. \u003cbr /\u003e\nThe `tf_sims.py` script produces the spherical harmonics coefficients ($a_{\\ell m}$) of these maps, up to $\\ell_{max}=3*nside-1$, where `nside` can be configured.\nThe code generates the $a_{\\ell m}$ by drawing Gaussian random numbers from a simple input power spectrum, of the form $$C_\\ell = A \\left(\\frac{\\ell}{\\ell_0}\\right)^\\alpha.$$\nAmplitude ($A$) and slope ($\\alpha$) can be configured; values of $\\alpha \\in [-3,0]$ cover the typical steepness of Gaussian and CMB-like spectra. \u003cbr /\u003e\nSpherical harmonics coefficients are saved to disk in $\\mu K_{CMB}$ units as three separated files, in `.fits.gz` format:\n\n- T-only ($a^T_{\\ell m}$, $\\quad$ 0, $\\quad$ 0) `alm_tf_pureT_lmax{lmax}_{seed}.fits.gz`\n- E-only (0, $\\quad$ $a^E_{\\ell m}$, $\\quad$ 0) `alm_tf_pureE_...`\n- B-only (0, $\\quad$ 0, $\\quad$ $a^B_{\\ell m}$) `alm_tf_pureB_...` \u003cbr /\u003e\n\n### Covariance type\nGeneration of simulations for covariance estimation is separated in two scripts:\n\n- `templates_fit.py` first reads the PySM `d9s4` foregrounds templates for synchrotron ($\\nu_0=23$ GHz) and thermal dust ($\\nu_0=353$ GHz) stored at NERSC. IQU maps are converted from Rayleigh-Jeans ($\\mu K_{RJ}$) to thermodynamic (CMB, $\\mu K_{CMB}$) units and processed into a SAT-like configuration, meaning that they are rotated from galactic to equatorial coordinates and downgraded to the desired `nside` (both operations are carried out in harmonic space). Then, for each template, the script computes angular power spectra with `NaMaster` on the SAT MSS2 apodized mask and extracts power laws amplitudes and slopes by fitting the spectra with: $$C^{XX}_\\ell = A^{XX}_c \\left(\\frac{\\ell}{\\ell_0}\\right)^{\\alpha^{XX}_c}$$ where $c=s, d$ stands for synchrotron or dust, and $X=T,E,B$. Finally, it updates the `paramfile_cov.yaml` file with the fitted parameters for it to be read by the simulation script.\n\n- `cov_sims.py` generates Gaussian $a_{\\ell m}$ realizations from the power spectra of each component (CMB, synchrotron and dust), up to $\\ell_{max}=3*nside-1$. The code loads CMB spectra from the `data` directory (default is *Planck* 2018), while foregrounds spectra are computed as power laws $C_\\ell = A_c \\left(\\ell/\\ell_0\\right)^{\\alpha_c}$ with spectral parameters fitted in the previous stage. In order to generate multi-frequency realizations, each $a_{\\ell m}$ is frequency-scaled with the corresponding spectral energy distribution (SED, $S^\\nu_c$). Synchrotron radiation is rescaled with a power law ($\\beta_s = -3$); thermal dust is rescaled with a modified blackbody ($\\beta_d=1.59$, $T_d = 19.6 K$): $$a^\\nu_{\\ell m} = \\sum_c a^c_{\\ell m} S^\\nu_c.$$ Bandpass integration is *not* included: frequency bandpasses are assumed as delta-like centered at the nominal frequencies. Outputs spherical harmonics coefficients are saved to disk in $\\mu K_{CMB}$ units, the filename being `alm_{freq}GHz_lmax{lmax}_{seed}.fits`.\n\n---\n\n## Requirements\n- `numpy`\n- `scipy`\n- `healpy` (https://healpy.readthedocs.io/en/latest/)\n- `pymaster` (https://namaster.readthedocs.io/en/latest/)\n\n## Installation\nJust clone or download the repository, for example with:\n`git clone https://github.com/simonsobs/SOOPERSIMS.git`\n\n## Run\nScripts need a `.yaml` configuration file with instructions and parameters. Create a `.yaml` file in the `paramfiles` directory (or just adapt one of the sample files there to your needs). \u003cbr /\u003e\nTo run, go to the `scripts` directory (`cd scripts`) and run the bash scripts:\n- `bash run_tf_sims.sh` to generate transfer function simulations\n- `bash run_cov_sims.sh` to generate covariance simulations\n\n---\n\n## Contacts\nGet in touch with Claudio Ranucci (@cranucci) if you have questions or feedbacks about the codes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonsobs%2Fsoopersims","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonsobs%2Fsoopersims","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonsobs%2Fsoopersims/lists"}