Skip to content

Commit

Permalink
Merge branch 'main' of github.com:PennyWieser/Thermobar
Browse files Browse the repository at this point in the history
  • Loading branch information
PennyWieser committed Feb 1, 2024
2 parents afec0fd + 1c780f5 commit 92d189b
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions src/Thermobar/noise_averaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,22 +314,10 @@ def add_noise_sample_1phase(phase_comp, phase_err=None,
'specified a percent noise. Select only 1 of these options')

# This works out what phase you have entered data for
if any(Sample_c.columns.str.contains("_Cpx")):
elx = 'Cpx'
if any(Sample_c.columns.str.contains("_Plag")):
elx = 'Plag'
if any(Sample_c.columns.str.contains("_Opx")):
elx = 'Opx'
if any(Sample_c.columns.str.contains("_Sp")):
elx = 'Sp'
if any(Sample_c.columns.str.contains("_Kspar")):
elx = 'Kspar'
if any(Sample_c.columns.str.contains("_Amp")):
elx = 'Amp'
if any(Sample_c.columns.str.contains("_Liq")):
elx = 'Liq'
if any(Sample_c.columns.str.contains("_Ol")):
elx = 'Ol'
Phase_Options = ["Cpx", "Plag", "Opx", "Sp", "Kspar", "Amp", "Liq", "Ol"]
for Option in Phase_Options:
if any(Sample_c.columns.str.contains(f"_{Option}")):
elx = Option

if any(Sample_c.columns.str.contains('Sample_ID_{}'.format(elx))):
name=True
Expand All @@ -340,7 +328,7 @@ def add_noise_sample_1phase(phase_comp, phase_err=None,
w.warn('Non unique sample names. We have appended the index onto all sample names to save issues with averaging later')
TEST=Sample_c.index.values
for i in range(0, len(Sample_c)):
Sample_c.loc[i, 'Sample_ID_Liq']=Sample_c['Sample_ID_Liq'].iloc[i]+'_'+str(TEST[i])
Sample_c.loc[i, 'Sample_ID_{}'.format(elx)]=Sample_c['Sample_ID_{}'.format(elx)].iloc[i] + '_'+str(TEST[i])


if phase_err is None or (phase_err is not None and err_dist == "uniform"):
Expand Down

0 comments on commit 92d189b

Please sign in to comment.