Skip to content

Commit

Permalink
add sio_magic.py options -CR and -T:ANI to QuickMagIC
Browse files Browse the repository at this point in the history
add sio_magic.py options -CR  (cooling rate correction) and -T:ANI
(ATRM) to QuickMagIC dialog boxes.
  • Loading branch information
ronshaar committed Nov 10, 2015
1 parent aed5e27 commit 478bd23
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 15 deletions.
17 changes: 15 additions & 2 deletions pmag_basic_dialogs.py
Expand Up @@ -291,7 +291,8 @@ def InitUI(self):
dlg = wx.MessageDialog(None,caption="Message:", message=MSG ,style=wx.OK|wx.ICON_INFORMATION)
dlg.ShowModal()
dlg.Destroy()
self.Destroy()
# deleted by rshaar 10.11.2015
#self.Destroy()


#------------------
Expand Down Expand Up @@ -777,6 +778,10 @@ def InitUI(self):
#---sizer 10 ---
#self.bSizer10 = pw.synthetic(pnl)

#---sizer 10 ---
TEXT = "cooling rates [K/minutes] (seperated by comma) for cooling rate experiment:"
self.bSizer10 = pw.labeled_text_field(pnl, TEXT)

#---buttons ----
hboxok = pw.btn_panel(self, pnl)

Expand All @@ -788,6 +793,8 @@ def InitUI(self):
hbox1 =wx.BoxSizer(wx.HORIZONTAL)
hbox1.Add(self.bSizer8, flag=wx.ALIGN_LEFT)
hbox1.Add(self.bSizer9, flag=wx.ALIGN_LEFT|wx.LEFT, border=5)
hbox2 =wx.BoxSizer(wx.HORIZONTAL)
hbox2.Add(self.bSizer10, flag=wx.ALIGN_LEFT|wx.LEFT, border=5)

vbox.Add(bSizer_info, flag=wx.ALIGN_LEFT|wx.TOP, border=8)
vbox.Add(self.bSizer0, flag=wx.ALIGN_LEFT|wx.TOP, border=8)
Expand All @@ -800,6 +807,8 @@ def InitUI(self):
vbox.Add(self.bSizer7, flag=wx.ALIGN_LEFT|wx.TOP, border=8)
vbox.Add(hbox1, flag=wx.ALIGN_LEFT|wx.TOP, border=8)
vbox.Add(wx.StaticLine(pnl), 0, wx.ALL|wx.EXPAND, 5)
vbox.Add(hbox2, flag=wx.ALIGN_LEFT|wx.TOP, border=8)
vbox.Add(wx.StaticLine(pnl), 0, wx.ALL|wx.EXPAND, 5)
vbox.Add(hboxok, flag=wx.ALIGN_CENTER)
vbox.Add(wx.StaticLine(pnl), 0, wx.ALL|wx.EXPAND, 5)
vbox.AddSpacer(20)
Expand Down Expand Up @@ -876,8 +885,12 @@ def on_okButton(self, event):
options_dict['coil'] = coil_number
if coil_number:
coil_number = "-V " + coil_number
cooling_rates=""
cooling_rates = self.bSizer10.return_value()
options_dict['cooling_rates'] = cooling_rates

COMMAND = "sio_magic.py -F {0} -f {1} {2} {3} {4} -spc {5} -ncn {6} {7} {8} {9} {10} {11}".format(outfile, SIO_file, user, experiment_type, loc_name,spc, ncn, lab_field, peak_AF, coil_number, instrument, replicate)
COMMAND = "sio_magic.py -F {0} -f {1} {2} {3} {4} {5} -spc {6} -ncn {7} {8} {9} {10} {11} {12}".format(outfile, SIO_file, user, experiment_type, cooling_rates, loc_name,spc, ncn, lab_field, peak_AF, coil_number, instrument, replicate)
print "COMMAND", COMMAND
# to run as module:
import sio_magic
if sio_magic.main(command_line=False, **options_dict):
Expand Down
4 changes: 2 additions & 2 deletions pmag_widgets.py
Expand Up @@ -447,7 +447,7 @@ def return_value(self):


class experiment_type(wx.StaticBoxSizer):
exp_names = ('AF Demag', 'Thermal (includes thellier but not trm)', 'Shaw method', 'IRM (acquisition)', '3D IRM experiment', 'NRM only', 'TRM acquisition', 'double AF demag', 'triple AF demag (GRM protocol)', 'Cooling rate experiment')
exp_names = ('AF Demag', 'Thermal (includes thellier but not trm)', 'Shaw method', 'IRM (acquisition)', '3D IRM experiment', 'NRM only', 'TRM acquisition', 'double AF demag', 'triple AF demag (GRM protocol)', 'Cooling rate experiment', 'anisotropy experiment')

def __init__(self, parent, experiment_names=exp_names):
box = wx.StaticBox(parent, wx.ID_ANY, "")
Expand All @@ -474,7 +474,7 @@ def return_value(self):
checked.append(str(cb.Label))
if not checked:
return ''
experiment_key = {'AF Demag': 'AF', 'Thermal (includes thellier but not trm)': 'T', 'Shaw method': 'S', 'IRM (acquisition)': 'I', '3D IRM experiment': 'I3d', 'NRM only': 'N', 'TRM acquisition': 'TRM', 'anisotropy experiment': 'ANI', 'double AF demag': 'D', 'triple AF demag (GRM protocol)': 'G', 'Cooling rate experiment': 'CR', 'Anisotropy experiment': 'ANI'}
experiment_key = {'AF Demag': 'AF', 'Thermal (includes thellier but not trm)': 'T', 'Shaw method': 'S', 'IRM (acquisition)': 'I', '3D IRM experiment': 'I3d', 'NRM only': 'N', 'TRM acquisition': 'TRM', 'anisotropy experiment': 'ANI', 'double AF demag': 'D', 'triple AF demag (GRM protocol)': 'G', 'Cooling rate experiment': 'CR'}
experiment_string = ''
for ex in checked:
experiment_string += experiment_key[ex] + ':'
Expand Down
21 changes: 11 additions & 10 deletions sio_magic.py
Expand Up @@ -184,7 +184,7 @@ def main(command_line=True, **kwargs):
noave = kwargs.get('noave', 0)
codelist = kwargs.get('codelist', '')
coil = kwargs.get('coil', '')

cooling_rates = kwargs.get('cooling_rates', '')
if command_line:
if "-h" in args:
print main.__doc__
Expand Down Expand Up @@ -265,7 +265,7 @@ def main(command_line=True, **kwargs):
return False, "mag_file field is required option"
if specnum!=0:
specnum=-specnum
print 'samp_con:', samp_con
#print 'samp_con:', samp_con
if samp_con:
if "4" == samp_con[0]:
if "-" not in samp_con:
Expand Down Expand Up @@ -317,14 +317,15 @@ def main(command_line=True, **kwargs):
if "TRM" in codes:
demag="T"
trm=1
if "CR" in codes:
if "CR" in codes:
demag="T"
cooling_rate_experiment=1
ind=args.index("CR")
coolling_times=args[ind+1]
coolling_times_list=coolling_times.split(',')


if command_line:
ind=args.index("CR")
cooling_rates=args[ind+1]
cooling_rates_list=cooling_rates.split(',')
else:
cooling_rates_list=str(cooling_rates).split(',')
if demag=="T" and "ANI" in codes:
methcode="LP-AN-TRM"
if demag=="T" and "CR" in codes:
Expand Down Expand Up @@ -625,9 +626,9 @@ def main(command_line=True, **kwargs):
indx=int(treat[1][0])-1
# alteration check matjed as 0.7 in the measurement file
if indx==6:
cooling_time= coolling_times_list[-1]
cooling_time= cooling_rates_list[-1]
else:
cooling_time=coolling_times_list[indx]
cooling_time=cooling_rates_list[indx]
MagRec["measurement_description"]="cooling_rate"+":"+cooling_time+":"+"K/min"


Expand Down
2 changes: 1 addition & 1 deletion thellier_gui.py
Expand Up @@ -7620,7 +7620,7 @@ def dir2cart(d):

#---- Zijderveld block

EX=["LP-AN-ARM","LP-AN-TRM","LP-ARM-AFD","LP-ARM2-AFD","LP-TRM-AFD","LP-TRM","LP-TRM-TD","LP-X"] # list of excluded lab protocols
EX=["LP-AN-ARM","LP-AN-TRM","LP-ARM-AFD","LP-ARM2-AFD","LP-TRM-AFD","LP-TRM","LP-TRM-TD","LP-X","LP-CR-TRM"] # list of excluded lab protocols
#INC=["LT-NO","LT-AF-Z","LT-T-Z", "LT-M-Z", "LP-PI-TRM-IZ", "LP-PI-M-IZ"]
INC=["LT-NO","LT-T-Z","LT-M-Z","LT-AF-Z"]
methods=rec["magic_method_codes"].strip('\n').split(":")
Expand Down

0 comments on commit 478bd23

Please sign in to comment.