DiadFit 0.0.68__tar.gz → 0.0.69__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {DiadFit-0.0.68 → DiadFit-0.0.69}/PKG-INFO +1 -1
- {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/_version.py +1 -1
- {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/densimeters.py +22 -70
- {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/importing_data_files.py +57 -0
- {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/ne_lines.py +1 -1
- {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit.egg-info/PKG-INFO +1 -1
- {DiadFit-0.0.68 → DiadFit-0.0.69}/README.md +0 -0
- {DiadFit-0.0.68 → DiadFit-0.0.69}/setup.cfg +0 -0
- {DiadFit-0.0.68 → DiadFit-0.0.69}/setup.py +0 -0
- {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/CO2_EOS.py +0 -0
- {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/CO2_in_bubble_error.py +0 -0
- {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/H2O_fitting.py +0 -0
- {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/Highrho_polyfit_data.pkl +0 -0
- {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/Lowrho_polyfit_data.pkl +0 -0
- {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/Mediumrho_polyfit_data.pkl +0 -0
- {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/Psensor.py +0 -0
- {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/__init__.py +0 -0
- {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/argon_lines.py +0 -0
- {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/cosmicray_filter.py +0 -0
- {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/densimeter_fitting.py +0 -0
- {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/density_depth_crustal_profiles.py +0 -0
- {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/diads.py +0 -0
- {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit/error_propagation.py +0 -0
- {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit.egg-info/SOURCES.txt +0 -0
- {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit.egg-info/dependency_links.txt +0 -0
- {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit.egg-info/requires.txt +0 -0
- {DiadFit-0.0.68 → DiadFit-0.0.69}/src/DiadFit.egg-info/top_level.txt +0 -0
@@ -585,30 +585,36 @@ def merge_in_carb_SO2(df_combo, file1_name='Carb_Peak_fits.xlsx', file2_name='SO
|
|
585
585
|
return df_combo_sec_phase
|
586
586
|
|
587
587
|
## Merge peak fits together
|
588
|
-
def merge_fit_files():
|
588
|
+
def merge_fit_files(path):
|
589
589
|
"""
|
590
590
|
This function merges the files Discarded_df.xlsx, Weak_Diads.xlsx, Medium_Diads.xlsx, Strong_Diads.xlsx
|
591
591
|
if they exist into one combined dataframe
|
592
592
|
"""
|
593
|
-
import os
|
594
|
-
|
595
|
-
|
596
|
-
|
593
|
+
import os
|
594
|
+
import pandas as pd
|
595
|
+
|
596
|
+
if os.path.exists(os.path.join(path, 'Discarded_df.xlsx')):
|
597
|
+
discard = pd.read_excel(os.path.join(path, 'Discarded_df.xlsx'))
|
597
598
|
else:
|
598
|
-
discard=None
|
599
|
-
|
600
|
-
|
599
|
+
discard = None
|
600
|
+
|
601
|
+
if os.path.exists(os.path.join(path, 'Weak_Diads.xlsx')):
|
602
|
+
grp1 = pd.read_excel(os.path.join(path, 'Weak_Diads.xlsx'))
|
601
603
|
else:
|
602
|
-
grp1=None
|
603
|
-
|
604
|
-
|
604
|
+
grp1 = None
|
605
|
+
|
606
|
+
if os.path.exists(os.path.join(path, 'Medium_Diads.xlsx')):
|
607
|
+
grp2 = pd.read_excel(os.path.join(path, 'Medium_Diads.xlsx'))
|
605
608
|
else:
|
606
|
-
grp2=None
|
607
|
-
|
608
|
-
|
609
|
+
grp2 = None
|
610
|
+
|
611
|
+
if os.path.exists(os.path.join(path, 'Strong_Diads.xlsx')):
|
612
|
+
grp3 = pd.read_excel(os.path.join(path, 'Strong_Diads.xlsx'))
|
609
613
|
else:
|
610
|
-
grp3=None
|
611
|
-
|
614
|
+
grp3 = None
|
615
|
+
|
616
|
+
df2 = pd.concat([grp1, grp2, grp3], axis=0).reset_index(drop=True)
|
617
|
+
|
612
618
|
if discard is not None:
|
613
619
|
discard_cols=discard[discard.columns.intersection(df2.columns)]
|
614
620
|
df2=pd.concat([df2, discard_cols]).reset_index(drop=True)
|
@@ -616,57 +622,3 @@ def merge_fit_files():
|
|
616
622
|
|
617
623
|
|
618
624
|
|
619
|
-
## Save settings files
|
620
|
-
def save_settings(meta_path, spectra_path, filetype, prefix, prefix_str, file_ext, TruPower):
|
621
|
-
# Get the current folder
|
622
|
-
folder = os.getcwd()
|
623
|
-
|
624
|
-
# Create the settings dictionary
|
625
|
-
settings = {
|
626
|
-
'meta_path': meta_path,
|
627
|
-
'spectra_path': spectra_path,
|
628
|
-
'filetype': filetype,
|
629
|
-
'prefix': prefix,
|
630
|
-
'prefix_str': repr(prefix_str),
|
631
|
-
'file_ext': file_ext,
|
632
|
-
'TruPower': TruPower,
|
633
|
-
}
|
634
|
-
|
635
|
-
# Construct the settings file path
|
636
|
-
settings_file_path = os.path.join(folder, 'settings.txt')
|
637
|
-
|
638
|
-
# Write the settings to the file
|
639
|
-
with open(settings_file_path, 'w') as file:
|
640
|
-
for key, value in settings.items():
|
641
|
-
file.write(f"{key}={value}\n")
|
642
|
-
|
643
|
-
def get_settings():
|
644
|
-
# Get the current folder
|
645
|
-
folder = os.getcwd()
|
646
|
-
|
647
|
-
# Construct the settings file path
|
648
|
-
settings_file_path = os.path.join(folder, 'settings.txt')
|
649
|
-
|
650
|
-
# Read the settings from the file
|
651
|
-
settings = {}
|
652
|
-
with open(settings_file_path, 'r') as file:
|
653
|
-
for line in file:
|
654
|
-
line = line.strip()
|
655
|
-
if line:
|
656
|
-
key, value = line.split('=')
|
657
|
-
settings[key] = value
|
658
|
-
if key == 'prefix_str':
|
659
|
-
value = eval(value) # Evaluate the string to retrieve the original value
|
660
|
-
settings[key] = value
|
661
|
-
|
662
|
-
if 'prefix' in settings:
|
663
|
-
settings['prefix'] = settings['prefix'].lower() == 'true'
|
664
|
-
|
665
|
-
if 'TruPower' in settings:
|
666
|
-
settings['TruPower'] = settings['TruPower'].lower() == 'true'
|
667
|
-
|
668
|
-
# Return the settings
|
669
|
-
return settings.get('meta_path'), settings.get('spectra_path'), settings.get('filetype'), \
|
670
|
-
settings.get('prefix'), settings.get('prefix_str'), settings.get('file_ext'), settings.get('TruPower')
|
671
|
-
|
672
|
-
|
@@ -1175,3 +1175,60 @@ def stitch_loop_individual_fits(*, fit_individually=True,
|
|
1175
1175
|
df_Dense_Combo=df_Dense
|
1176
1176
|
|
1177
1177
|
return df_Dense_Combo
|
1178
|
+
|
1179
|
+
|
1180
|
+
## Save settings files
|
1181
|
+
def save_settings(meta_path, spectra_path, filetype, prefix, prefix_str, file_ext, TruPower):
|
1182
|
+
# Get the current folder
|
1183
|
+
folder = os.getcwd()
|
1184
|
+
|
1185
|
+
# Create the settings dictionary
|
1186
|
+
settings = {
|
1187
|
+
'meta_path': meta_path,
|
1188
|
+
'spectra_path': spectra_path,
|
1189
|
+
'filetype': filetype,
|
1190
|
+
'prefix': prefix,
|
1191
|
+
'prefix_str': repr(prefix_str),
|
1192
|
+
'file_ext': file_ext,
|
1193
|
+
'TruPower': TruPower,
|
1194
|
+
}
|
1195
|
+
|
1196
|
+
# Construct the settings file path
|
1197
|
+
settings_file_path = os.path.join(folder, 'settings.txt')
|
1198
|
+
|
1199
|
+
# Write the settings to the file
|
1200
|
+
with open(settings_file_path, 'w') as file:
|
1201
|
+
for key, value in settings.items():
|
1202
|
+
file.write(f"{key}={value}\n")
|
1203
|
+
|
1204
|
+
def get_settings():
|
1205
|
+
# Get the current folder
|
1206
|
+
folder = os.getcwd()
|
1207
|
+
|
1208
|
+
# Construct the settings file path
|
1209
|
+
settings_file_path = os.path.join(folder, 'settings.txt')
|
1210
|
+
|
1211
|
+
# Read the settings from the file
|
1212
|
+
settings = {}
|
1213
|
+
with open(settings_file_path, 'r') as file:
|
1214
|
+
for line in file:
|
1215
|
+
line = line.strip()
|
1216
|
+
if line:
|
1217
|
+
key, value = line.split('=')
|
1218
|
+
settings[key] = value
|
1219
|
+
if key == 'prefix_str':
|
1220
|
+
value = eval(value) # Evaluate the string to retrieve the original value
|
1221
|
+
settings[key] = value
|
1222
|
+
|
1223
|
+
if 'prefix' in settings:
|
1224
|
+
settings['prefix'] = settings['prefix'].lower() == 'true'
|
1225
|
+
|
1226
|
+
if 'TruPower' in settings:
|
1227
|
+
settings['TruPower'] = settings['TruPower'].lower() == 'true'
|
1228
|
+
|
1229
|
+
# Return the settings
|
1230
|
+
return settings.get('meta_path'), settings.get('spectra_path'), settings.get('filetype'), \
|
1231
|
+
settings.get('prefix'), settings.get('prefix_str'), settings.get('file_ext'), settings.get('TruPower')
|
1232
|
+
|
1233
|
+
|
1234
|
+
|
@@ -670,7 +670,7 @@ const_params=True, spec_res=0.4) :
|
|
670
670
|
|
671
671
|
df=pd.DataFrame(data={'Xdata': xdat,
|
672
672
|
'Ydata': ydat})
|
673
|
-
df.to_clipboard(excel=True)
|
673
|
+
#df.to_clipboard(excel=True)
|
674
674
|
|
675
675
|
# This defines the range you want to fit (e.g. how big the tails are)
|
676
676
|
lower_pk1=Ne_center+x_span[0]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|