Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# slacs_mass = '{0:e}'.format(10**11.73)
# slacs_radius = 6.53
# pipeline_folder = 'Pipeline_Total'
# phase_folder = 'PL_Phase_8'
pipeline_folder = 'Pipeline_Total'
phase_folder = 'PL_Phase_8'
image_dir = image_dir + image_name + '/' + pipeline_folder + '/' + phase_folder + '/'
model_folder = getModelFolders(image_dir)
pdf_file = image_dir + model_folder[0] + '/' + image_name + '.txt'
pdf = getdist.mcsamples.loadMCSamples(pdf_file)
values = pdf.getMeans()
params = pdf.getParams()
upper_conf = []
lower_conf = []
for i in range(len(values)):
upper_conf.append(pdf.confidence(paramVec=i, limfrac=0.999, upper=True))
lower_conf.append(pdf.confidence(paramVec=i, limfrac=0.999, upper=False))
if image_name == 'SLACSJ1250+0523' or image_name == 'SLACSJ1430+4105':
center_skip = 2
sersic_bulge = light_profiles.SersicLightProfile(centre=(values[0], values[1]), axis_ratio=values[5], phi=values[6], intensity=values[2], effective_radius=values[3],
sersic_index=values[4])
def pdf(self):
return getdist.mcsamples.loadMCSamples(self.file_weighted_samples)
def pdf(self):
import getdist
return getdist.mcsamples.loadMCSamples(self.opt_path + '/multinest')
# pipeline_folder = 'Pipeline_Total'
# phase_folder = 'PL_Phase_8'
# pipeline_folder = 'Pipeline_LMDM'
# phase_folder = 'PL_Phase_7'
pipeline_folder = 'Pipeline_LTM2'
phase_folder = 'PL_Phase_7'
image_dir = image_dir + image_name + '/' + pipeline_folder + '/' + phase_folder + '/'
model_folder = getModelFolders(image_dir)
pdf_file = image_dir + model_folder[0] + '/' + image_name + '.txt'
pdf = getdist.mcsamples.loadMCSamples(pdf_file)
values = pdf.getMeans()
params = pdf.getParams()
upper_conf = []
lower_conf = []
for i in range(len(values)):
upper_conf.append(pdf.confidence(paramVec=i, limfrac=0.95, upper=True))
lower_conf.append(pdf.confidence(paramVec=i, limfrac=0.95, upper=False))
if image_name == 'SLACSJ1250+0523' or image_name == 'SLACSJ1430+4105':
center_skip = 2
if pipeline_folder == 'Pipeline_LTM2':
ltm_skip = 1
chab_stellar_frac = 0.33
chab_stellar_frac_error = 0.09
sal_stellar_frac = 0.59
sal_stellar_frac_error = 0.16
pipeline_folder = 'Pipeline_LMDM'
phase_folder = 'PL_Phase_6'
image_dir = image_dir + image_name + '/' + pipeline_folder + '/' + phase_folder + '/'
model_folder = 'SersicEll[XY_New][Rot_New]+NFWSph[XY_Fg][Rot_Off]+LTM[XY_Fg][Rot_Fg]+Shear+Sub_Ext_1'
pdf_file = image_dir + model_folder + '/' + image_name + '.txt'
pdf = getdist.mcsamples.loadMCSamples(pdf_file)
params = pdf.paramNames
sample_weights = []
total_mass_all = []
stellar_mass_all = []
for i in range(len(pdf.samples)):
if pdf.weights[i] > 1e-6:
values = pdf.samples[i]
values = pdf.getMeans()
sersic_bulge = mass_profiles.SersicMassProfile(centre=(values[0], values[1]), axis_ratio=values[5], phi=values[6], intensity=values[2], effective_radius=values[3],
chab_stellar_frac = 0.33
chab_stellar_frac_error = 0.09
sal_stellar_frac = 0.59
sal_stellar_frac_error = 0.16
pipeline_folder = 'Pipeline_LMDM'
phase_folder = 'PL_Phase_6'
image_dir = image_dir + image_name + '/' + pipeline_folder + '/' + phase_folder + '/'
model_folder = 'SersicEll[XY_New][Rot_New]+ExpEll[XY_Prev][Rot_Prev]+NFWSph[XY_Fg][Rot_Off]+LTM[XY_Fg][Rot_Fg]+Shear'
pdf_file = image_dir + model_folder + '/' + image_name + '.txt'
pdf = getdist.mcsamples.loadMCSamples(pdf_file)
params = pdf.paramNames
sample_weights = []
total_mass_all = []
stellar_mass_all = []
for i in range(len(pdf.samples)):
if pdf.weights[i] > 1e-6:
values = pdf.samples[i]
# values = pdf.getMeans()
sersic_bulge = mass_profiles.SersicMassProfile(centre=(values[0], values[1]), axis_ratio=values[5], phi=values[6], intensity=values[2], effective_radius=values[3],