Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
460f86c
Some more optimisation in covariance constructor, more flexible file …
andrejdvornik Nov 18, 2025
98ac0f9
Include last element
andrejdvornik Nov 18, 2025
5943034
More changes to covariance constructor
andrejdvornik Nov 18, 2025
12e34cc
Some fixes
andrejdvornik Nov 19, 2025
60b9d07
Create separate make_cosmosis_nz for 3x2pt
andrejdvornik Nov 20, 2025
3125ef2
Merge remote-tracking branch 'upstream/master' into 3x2pt
andrejdvornik Nov 20, 2025
4da0590
Fixed capitalisation
andrejdvornik Nov 20, 2025
7539da0
Revert comment
andrejdvornik Nov 20, 2025
f368c83
Revert comment
andrejdvornik Nov 20, 2025
9771b88
Revert changes
andrejdvornik Nov 20, 2025
afdabe8
More fixes to covariance constructor
andrejdvornik Nov 20, 2025
1b9d5d3
Temp fix to psi_stats
andrejdvornik Nov 20, 2025
5891829
Fix blocklist
andrejdvornik Nov 21, 2025
477d2fa
Flexible stats selection given MODES
andrejdvornik Nov 21, 2025
4a9bb4e
Clearer error message
andrejdvornik Nov 21, 2025
00c695b
Better handling of nzs in make_cosmosis_nz_3x2pt
andrejdvornik Nov 21, 2025
c8d3724
Better logic in make_cosmosis_nz
andrejdvornik Nov 21, 2025
556090b
More fixes
andrejdvornik Nov 21, 2025
302c626
Remove message
andrejdvornik Nov 21, 2025
b7c232a
Fix patch message
andrejdvornik Nov 21, 2025
b7ccf10
Fix names of lens and obs nzs
andrejdvornik Nov 24, 2025
ced8fb2
More optimisation of prepare_cosmosis.sh
andrejdvornik Nov 24, 2025
866b72b
Implemented bin averaging for 1 point statistics
andrejdvornik Nov 27, 2025
02548be
Moved normalisation to sacc creation instead of likelihood code
andrejdvornik Dec 3, 2025
b024918
Fix covariance constructor
andrejdvornik Dec 5, 2025
fdfd749
Optimisation of cov filters handling
andrejdvornik Dec 9, 2025
5db397a
Update to onepower settings
andrejdvornik Jan 16, 2026
31e70ca
Rename variables
andrejdvornik Jan 16, 2026
d19abf0
Added check for zmin/zmax limits in calc_smf.py
andrejdvornik Jan 16, 2026
1d8dd80
Added working environment without conflicts that supports OnePower an…
andrejdvornik Feb 13, 2026
05caed4
Added an option to specify limits by hand
andrejdvornik Feb 23, 2026
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
409 changes: 409 additions & 0 deletions environment_3x2pt.yml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion man/add_datavector.man.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,11 @@ function _outputs {
then
output="obs_vec"
else
_message "BV:DATAVEC_TYPE is not set to a known value: ${DATAVEC_TYPE^^} is not one of {COSEBIS,PSI_STATS_GM,PSI_STATS_GG,BANDPOWERS_EE,BANDPOWERS_NE,BANDPOWERS_NN,XIPM,GT,WT}"
_message "BV:DATAVEC_TYPE is not set to a known value: ${DATAVEC_TYPE^^} is not one of {COSEBIS,PSI_STATS_GM,PSI_STATS_GG,BANDPOWERS_EE,BANDPOWERS_NE,BANDPOWERS_NN,XIPM,GT,WT,OBS}"
exit 1
fi
#}}}
_message "$output"
echo ${output}
}
#}}}
Expand Down
7 changes: 5 additions & 2 deletions man/calculate_psistats.man.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@ function _inp_data {
# Output data {{{
function _outputs {
#Data outputs (leave blank if none)
output=`_parse_blockvars psi_stats_@BV:MODES@`
echo $output
# Need to fix this to output gg and gm instad of nn and ne
echo psi_stats_gm psi_stats_gg
#output=`_parse_blockvars psi_stats_@BV:MODES@`
#output=${output,,}
#echo $output
}
#}}}

Expand Down
144 changes: 144 additions & 0 deletions man/make_cosmosis_nz_3x2pt.man.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
#
# make_cosmosis_nz.sh Documentation & Housekeeping functions
#

#Starting Prompt {{{
function _prompt {
#Check if we do want verbose output
if [ "$1" != "0" ]
then
_message "@BLU@========================================@DEF@\n"
_message "@BLU@== @RED@ Running make_cosmosis_nz_3x2pt.sh Mode @BLU@ ==@DEF@\n"
_message "@BLU@========================================@DEF@\n"
fi
}
#}}}

#Mode description {{{
function _description {
echo "#"
echo '# Construct an Nz file in the format expected by '
echo '# cosmosis'
echo "#"
echo "# Function takes input data:"
echo "# `_inp_data`"
echo "#"
}
#}}}

# Abort Message {{{
_abort()
{
#Message to print when script aborts
#$0 is the script that was running when this error occurred
_message "@BLU@ An error occured while running:\n@DEF@$0.\n" >&2
_message "@BLU@ Check the logging file for this step in:\n" >&2
_message "@DEF@@RUNROOT@/@LOGPATH@/\n" >&2
exit 1
}
trap '_abort' 0
set -e
#}}}

# Input variables {{{
function _inp_var {
#Variable inputs (leave blank if none)
echo ALLPATCH BLU BV:MODES BV:NLENSBINS BV:NSMFLENSBINS BV:PATCHLIST BV:TOMOLIMS DATABLOCK DEF PYTHON3BIN RED RUNROOT SCRIPTPATH STORAGEPATH
}
#}}}

# Input data {{{
function _inp_data {
#Data inputs (leave blank if none)
outlist=''
#input is dynamic, depending on the value of BV:COSMOSIS_PATCHLIST
patchvar="@BV:COSMOSIS_PATCHLIST@"
patchvar=`_parse_blockvars ${patchvar}`
MODES_IN=`_parse_blockvars @BV:MODES@`
modes=''
if [[ .*\ $MODES_IN\ .* =~ " EE " ]] || [[ .*\ $MODES_IN\ .* =~ " NE " ]]
then
modes="${modes} source"
fi
if [[ .*\ $MODES_IN\ .* =~ " NE " ]] || [[ .*\ $MODES_IN\ .* =~ " NN " ]]
then
modes="${modes} lens"
fi
if [[ .*\ $MODES_IN\ .* =~ " OBS " ]]
then
modes="${modes} obs"
fi
#Define the patches to loop over {{{
if [ "${patchvar}" == "ALL" ] || [ "${patchvar}" == "@BV:COSMOSIS_PATCHLIST@" ]
then
patchlist=`echo @BV:PATCHLIST@ @ALLPATCH@ @ALLPATCH@comb`
else
patchlist="${patchvar}"
fi
#}}}
for mode in ${modes}
do
for patch in ${patchlist}
do
#>&2 echo ${patch}
outlist="${outlist} cosmosis_neff_${mode} nz_${mode}_${patch}"
done
done
echo ${outlist}
}
#}}}

# Output data {{{
function _outputs {
#Data outputs (leave blank if none)
outlist=''
patchvar="@BV:COSMOSIS_PATCHLIST@"
patchvar=`_parse_blockvars ${patchvar}`
MODES_IN=`_parse_blockvars @BV:MODES@`
modes=''
if [[ .*\ $MODES_IN\ .* =~ " EE " ]] || [[ .*\ $MODES_IN\ .* =~ " NE " ]]
then
modes="${modes} source"
fi
if [[ .*\ $MODES_IN\ .* =~ " NE " ]] || [[ .*\ $MODES_IN\ .* =~ " NN " ]]
then
modes="${modes} lens"
fi
if [[ .*\ $MODES_IN\ .* =~ " OBS " ]]
then
modes="${modes} obs"
fi
#Define the patches to loop over {{{
if [ "${patchvar}" == "ALL" ] || [ "${patchvar}" == "@BV:COSMOSIS_PATCHLIST@" ]
then
patchlist=`echo @BV:PATCHLIST@ @ALLPATCH@ @ALLPATCH@comb`
else
patchlist="${patchvar}"
fi
for mode in ${modes}
do
for patch in ${patchlist}
do
outlist="${outlist} cosmosis_nz_${mode}_${patch}"
done
done
echo ${outlist}
}
#}}}

# Execution command {{{
function _runcommand {
#Command for running the script
echo bash @RUNROOT@/@SCRIPTPATH@/make_cosmosis_nz_3x2pt.sh
}
#}}}

# Unset Function command {{{
function _unset_functions {
#Remove these functions from the environment
unset -f _prompt _description _inp_data _inp_var _abort _outputs _runcommand _unset_functions
}
#}}}

#Additional Functions

2 changes: 1 addition & 1 deletion scripts/add_gt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ then
outlist=${file}
elif [ -d @BV:TREECORRGT@ ]
then
filelist=`ls @BV:TREECORRGT@/*.asc*`
filelist=`ls @BV:TREECORRGT@/*.txt*`
for file in ${filelist}
do
cp ${file} @RUNROOT@/@STORAGEPATH@/@DATABLOCK@/gt/${file##*/}
Expand Down
2 changes: 1 addition & 1 deletion scripts/add_wt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ then
outlist=${file}
elif [ -d @BV:TREECORRWT@ ]
then
filelist=`ls @BV:TREECORRWT@/*.asc*`
filelist=`ls @BV:TREECORRWT@/*.txt*`
for file in ${filelist}
do
cp ${file} @RUNROOT@/@STORAGEPATH@/@DATABLOCK@/wt/${file##*/}
Expand Down
2 changes: 1 addition & 1 deletion scripts/add_xipm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ then
outlist=${file}
elif [ -d @BV:TREECORRXIPM@ ]
then
filelist=`ls @BV:TREECORRXIPM@/*.asc*`
filelist=`ls @BV:TREECORRXIPM@/*.txt*`
for file in ${filelist}
do
cp ${file} @RUNROOT@/@STORAGEPATH@/@DATABLOCK@/xipm/${file##*/}
Expand Down
5 changes: 4 additions & 1 deletion scripts/calc_smf.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@
stellar_mass_in = data[stellar_mass_column]
z_in = data[z_column]

# Check that data covers min_z, max_z
if not np.any((z_in >= min_z) & (z_in <= max_z)):
raise ValueError(f"No data in redshift range {min_z} < z < {max_z}")

# We set the possible minimum z to 0.001
z_min = np.maximum(0.001, min_z)
# max_z is given as an input, this is the maximum redshift in the stellar mass-redshift bin.
Expand All @@ -151,7 +155,6 @@
# or maximum redshift of the stellar mass-redshift bin
z_max_i = np.minimum(z_max_bin, z_max)


if estimator == 'simple':
# Comoving distance at z_min and z_max_i in units of Mpc h
# z_max_i is the maximum redshift at which galaxy i is visible in the sample
Expand Down
Loading