Skip to content

Commit

Permalink
adding more frequency flexibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Arianna Renzini committed Mar 4, 2024
1 parent 02ae45d commit a60509d
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions population_O3.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@
parser.add_argument('-wf', '--waveform_approximant',help="Wavefrom approximant. Default is IMRPhenomD.",action="store", type=str, default='IMRPhenomD')
parser.add_argument('-rd', '--run_directory',help="Run directory.",action="store", type=str, default='./')
parser.add_argument('-sm', '--samples',help="Samples to use.",action="store", type=str, default=None)
parser.add_argument('-fr', '--frequencies',help="txt file with frequencies to use for the spectrum calculation.",action="store", type=str, default=None)
args = parser.parse_args()

N_proposal_samples=args.number_samples
N_trials=args.number_trials
wave_approx=args.waveform_approximant
tag=f'{wave_approx}_{N_proposal_samples}_samples_{N_trials}_trials_thetajnfix'
tag=f'{wave_approx}_{N_proposal_samples}_samples_{N_trials}_trials'
rundir=Path(args.run_directory)

"""
Expand All @@ -66,7 +67,13 @@
'mass_model' : mass_obj,
'redshift_model' : redshift_obj,
}
freqs = np.arange(10, 2000, 5)
if args.frequencies is None:
freqs = np.arange(10, 2000, 2.5)
else:
try:
freqs = np.loadtxt(args.frequencies)
except ValueError:
raise ValueError(f"{args.frequencies} is not a txt file.")

newpop = PopulationOmegaGW(models=models, frequency_array=freqs)

Expand Down Expand Up @@ -118,9 +125,9 @@
'mpp': lambda_samples['mpp'][idx],
'sigpp': lambda_samples['sigpp'][idx],
'rate': lambda_samples['rate'][idx],
'gamma': 3.61, # lambda_samples['lamb'][idx],
'kappa': 3.83,
'z_peak': 1.04, #2.0, #0.3*(0.5-np.random.rand())+1.9,
'gamma': 2.7, # lambda_samples['lamb'][idx],
'kappa': 5.6, #3.83,
'z_peak': 1.9, #0.3*(0.5-np.random.rand())+1.9,
}
new_omegas['Lambdas'].append(Lambda_new)

Expand Down

0 comments on commit a60509d

Please sign in to comment.