repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
PmagPy/PmagPy | dialogs/thellier_interpreter.py | thellier_auto_interpreter.find_close_value | def find_close_value(self, LIST, value):
'''
take a LIST and find the nearest value in LIST to 'value'
'''
diff = inf
for a in LIST:
if abs(value - a) < diff:
diff = abs(value - a)
result = a
return(result) | python | def find_close_value(self, LIST, value):
'''
take a LIST and find the nearest value in LIST to 'value'
'''
diff = inf
for a in LIST:
if abs(value - a) < diff:
diff = abs(value - a)
result = a
return(result) | [
"def",
"find_close_value",
"(",
"self",
",",
"LIST",
",",
"value",
")",
":",
"diff",
"=",
"inf",
"for",
"a",
"in",
"LIST",
":",
"if",
"abs",
"(",
"value",
"-",
"a",
")",
"<",
"diff",
":",
"diff",
"=",
"abs",
"(",
"value",
"-",
"a",
")",
"result... | take a LIST and find the nearest value in LIST to 'value' | [
"take",
"a",
"LIST",
"and",
"find",
"the",
"nearest",
"value",
"in",
"LIST",
"to",
"value"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/thellier_interpreter.py#L1000-L1009 |
PmagPy/PmagPy | dialogs/thellier_interpreter.py | thellier_auto_interpreter.find_sample_min_std | def find_sample_min_std(self, Intensities):
'''
find the best interpretation with the minimum stratard deviation (in units of percent % !)
'''
Best_array = []
best_array_std_perc = inf
Best_array_tmp = []
Best_interpretations = {}
Best_interpretations_tmp... | python | def find_sample_min_std(self, Intensities):
'''
find the best interpretation with the minimum stratard deviation (in units of percent % !)
'''
Best_array = []
best_array_std_perc = inf
Best_array_tmp = []
Best_interpretations = {}
Best_interpretations_tmp... | [
"def",
"find_sample_min_std",
"(",
"self",
",",
"Intensities",
")",
":",
"Best_array",
"=",
"[",
"]",
"best_array_std_perc",
"=",
"inf",
"Best_array_tmp",
"=",
"[",
"]",
"Best_interpretations",
"=",
"{",
"}",
"Best_interpretations_tmp",
"=",
"{",
"}",
"for",
"... | find the best interpretation with the minimum stratard deviation (in units of percent % !) | [
"find",
"the",
"best",
"interpretation",
"with",
"the",
"minimum",
"stratard",
"deviation",
"(",
"in",
"units",
"of",
"percent",
"%",
"!",
")"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/thellier_interpreter.py#L1011-L1041 |
PmagPy/PmagPy | dialogs/thellier_interpreter.py | thellier_auto_interpreter.find_sample_min_max_interpretation | def find_sample_min_max_interpretation(self, Intensities):
'''
find the minimum and maximum acceptable sample mean
Intensities={}
Intensities[specimen_name]=[] array of acceptable interpretations ( units of uT)
'''
# acceptance criteria
if self.acceptance_criteria... | python | def find_sample_min_max_interpretation(self, Intensities):
'''
find the minimum and maximum acceptable sample mean
Intensities={}
Intensities[specimen_name]=[] array of acceptable interpretations ( units of uT)
'''
# acceptance criteria
if self.acceptance_criteria... | [
"def",
"find_sample_min_max_interpretation",
"(",
"self",
",",
"Intensities",
")",
":",
"# acceptance criteria",
"if",
"self",
".",
"acceptance_criteria",
"[",
"'average_by_sample_or_site'",
"]",
"[",
"'value'",
"]",
"==",
"'sample'",
":",
"int_n_cutoff",
"=",
"self",... | find the minimum and maximum acceptable sample mean
Intensities={}
Intensities[specimen_name]=[] array of acceptable interpretations ( units of uT) | [
"find",
"the",
"minimum",
"and",
"maximum",
"acceptable",
"sample",
"mean",
"Intensities",
"=",
"{}",
"Intensities",
"[",
"specimen_name",
"]",
"=",
"[]",
"array",
"of",
"acceptable",
"interpretations",
"(",
"units",
"of",
"uT",
")"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/thellier_interpreter.py#L1064-L1152 |
PmagPy/PmagPy | dialogs/thellier_interpreter.py | thellier_auto_interpreter.thellier_interpreter_pars_calc | def thellier_interpreter_pars_calc(self, Grade_As):
'''
calcualte sample or site STDEV-OPT paleointensities
and statistics
Grade_As={}
'''
thellier_interpreter_pars = {}
thellier_interpreter_pars['stdev-opt'] = {}
# thellier_interpreter_pars['stdev-opt'][... | python | def thellier_interpreter_pars_calc(self, Grade_As):
'''
calcualte sample or site STDEV-OPT paleointensities
and statistics
Grade_As={}
'''
thellier_interpreter_pars = {}
thellier_interpreter_pars['stdev-opt'] = {}
# thellier_interpreter_pars['stdev-opt'][... | [
"def",
"thellier_interpreter_pars_calc",
"(",
"self",
",",
"Grade_As",
")",
":",
"thellier_interpreter_pars",
"=",
"{",
"}",
"thellier_interpreter_pars",
"[",
"'stdev-opt'",
"]",
"=",
"{",
"}",
"# thellier_interpreter_pars['stdev-opt']['B']=",
"# thellier_interpreter_pars['st... | calcualte sample or site STDEV-OPT paleointensities
and statistics
Grade_As={} | [
"calcualte",
"sample",
"or",
"site",
"STDEV",
"-",
"OPT",
"paleointensities",
"and",
"statistics",
"Grade_As",
"=",
"{}"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/thellier_interpreter.py#L1158-L1251 |
PmagPy/PmagPy | dialogs/thellier_interpreter.py | thellier_auto_interpreter.thellier_interpreter_BS_pars_calc | def thellier_interpreter_BS_pars_calc(self, Grade_As):
'''
calcualte sample or site bootstrap paleointensities
and statistics
Grade_As={}
'''
thellier_interpreter_pars = {}
thellier_interpreter_pars['fail_criteria'] = []
thellier_interpreter_pars['pass_or_... | python | def thellier_interpreter_BS_pars_calc(self, Grade_As):
'''
calcualte sample or site bootstrap paleointensities
and statistics
Grade_As={}
'''
thellier_interpreter_pars = {}
thellier_interpreter_pars['fail_criteria'] = []
thellier_interpreter_pars['pass_or_... | [
"def",
"thellier_interpreter_BS_pars_calc",
"(",
"self",
",",
"Grade_As",
")",
":",
"thellier_interpreter_pars",
"=",
"{",
"}",
"thellier_interpreter_pars",
"[",
"'fail_criteria'",
"]",
"=",
"[",
"]",
"thellier_interpreter_pars",
"[",
"'pass_or_fail'",
"]",
"=",
"'pas... | calcualte sample or site bootstrap paleointensities
and statistics
Grade_As={} | [
"calcualte",
"sample",
"or",
"site",
"bootstrap",
"paleointensities",
"and",
"statistics",
"Grade_As",
"=",
"{}"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/thellier_interpreter.py#L1253-L1314 |
PmagPy/PmagPy | pmagpy/mapping/map_magic.py | mapping | def mapping(dictionary, mapping):
"""
takes in a dictionary and a mapping which contains new key names,
and returns a new dictionary with the updated key names, i.e.:
dictionary = {'a': 1, 'b': 2, 'c': 3}
mapping = {'a': 'aa', 'c': 'cc'}
mapped_dictionary = mapping(dictionary, mapping)
mappe... | python | def mapping(dictionary, mapping):
"""
takes in a dictionary and a mapping which contains new key names,
and returns a new dictionary with the updated key names, i.e.:
dictionary = {'a': 1, 'b': 2, 'c': 3}
mapping = {'a': 'aa', 'c': 'cc'}
mapped_dictionary = mapping(dictionary, mapping)
mappe... | [
"def",
"mapping",
"(",
"dictionary",
",",
"mapping",
")",
":",
"mapped_dictionary",
"=",
"{",
"}",
"for",
"key",
",",
"value",
"in",
"dictionary",
".",
"items",
"(",
")",
":",
"if",
"key",
"in",
"list",
"(",
"mapping",
".",
"keys",
"(",
")",
")",
"... | takes in a dictionary and a mapping which contains new key names,
and returns a new dictionary with the updated key names, i.e.:
dictionary = {'a': 1, 'b': 2, 'c': 3}
mapping = {'a': 'aa', 'c': 'cc'}
mapped_dictionary = mapping(dictionary, mapping)
mapped_dictionary = {'aa': 1, b, 2, 'cc': 3} | [
"takes",
"in",
"a",
"dictionary",
"and",
"a",
"mapping",
"which",
"contains",
"new",
"key",
"names",
"and",
"returns",
"a",
"new",
"dictionary",
"with",
"the",
"updated",
"key",
"names",
"i",
".",
"e",
".",
":",
"dictionary",
"=",
"{",
"a",
":",
"1",
... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/mapping/map_magic.py#L13-L69 |
PmagPy/PmagPy | pmagpy/mapping/map_magic.py | cache_mappings | def cache_mappings(file_path):
"""
Make a full mapping for 2 --> 3 columns.
Output the mapping to json in the specified file_path.
Note: This file is currently called maps.py,
full path is PmagPy/pmagpy/mapping/maps.py.
Parameters
----------
file_path : string with full file path to dum... | python | def cache_mappings(file_path):
"""
Make a full mapping for 2 --> 3 columns.
Output the mapping to json in the specified file_path.
Note: This file is currently called maps.py,
full path is PmagPy/pmagpy/mapping/maps.py.
Parameters
----------
file_path : string with full file path to dum... | [
"def",
"cache_mappings",
"(",
"file_path",
")",
":",
"def",
"get_2_to_3",
"(",
"dm_type",
",",
"dm",
")",
":",
"table_names3_2_table_names2",
"=",
"{",
"'measurements'",
":",
"[",
"'magic_measurements'",
"]",
",",
"'locations'",
":",
"[",
"'er_locations'",
"]",
... | Make a full mapping for 2 --> 3 columns.
Output the mapping to json in the specified file_path.
Note: This file is currently called maps.py,
full path is PmagPy/pmagpy/mapping/maps.py.
Parameters
----------
file_path : string with full file path to dump mapping json.
Returns
---------
... | [
"Make",
"a",
"full",
"mapping",
"for",
"2",
"--",
">",
"3",
"columns",
".",
"Output",
"the",
"mapping",
"to",
"json",
"in",
"the",
"specified",
"file_path",
".",
"Note",
":",
"This",
"file",
"is",
"currently",
"called",
"maps",
".",
"py",
"full",
"path... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/mapping/map_magic.py#L85-L146 |
PmagPy/PmagPy | pmagpy/mapping/map_magic.py | get_thellier_gui_meas_mapping | def get_thellier_gui_meas_mapping(input_df, output=2):
"""
Get the appropriate mapping for translating measurements in Thellier GUI.
This requires special handling for treat_step_num/measurement/measurement_number.
Parameters
----------
input_df : pandas DataFrame
MagIC records
outp... | python | def get_thellier_gui_meas_mapping(input_df, output=2):
"""
Get the appropriate mapping for translating measurements in Thellier GUI.
This requires special handling for treat_step_num/measurement/measurement_number.
Parameters
----------
input_df : pandas DataFrame
MagIC records
outp... | [
"def",
"get_thellier_gui_meas_mapping",
"(",
"input_df",
",",
"output",
"=",
"2",
")",
":",
"if",
"int",
"(",
"output",
")",
"==",
"2",
":",
"thellier_gui_meas3_2_meas2_map",
"=",
"meas_magic3_2_magic2_map",
".",
"copy",
"(",
")",
"if",
"'treat_step_num'",
"in",... | Get the appropriate mapping for translating measurements in Thellier GUI.
This requires special handling for treat_step_num/measurement/measurement_number.
Parameters
----------
input_df : pandas DataFrame
MagIC records
output : int
output to this MagIC data model (2 or 3)
Outp... | [
"Get",
"the",
"appropriate",
"mapping",
"for",
"translating",
"measurements",
"in",
"Thellier",
"GUI",
".",
"This",
"requires",
"special",
"handling",
"for",
"treat_step_num",
"/",
"measurement",
"/",
"measurement_number",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/mapping/map_magic.py#L168-L202 |
PmagPy/PmagPy | pmagpy/mapping/map_magic.py | convert_meas_df_thellier_gui | def convert_meas_df_thellier_gui(meas_df_in, output):
"""
Take a measurement dataframe and convert column names
from MagIC 2 --> 3 or vice versa.
Use treat_step_num --> measurement_number if available,
otherwise measurement --> measurement_number.
Parameters
----------
meas_df_in : pand... | python | def convert_meas_df_thellier_gui(meas_df_in, output):
"""
Take a measurement dataframe and convert column names
from MagIC 2 --> 3 or vice versa.
Use treat_step_num --> measurement_number if available,
otherwise measurement --> measurement_number.
Parameters
----------
meas_df_in : pand... | [
"def",
"convert_meas_df_thellier_gui",
"(",
"meas_df_in",
",",
"output",
")",
":",
"output",
"=",
"int",
"(",
"output",
")",
"meas_mapping",
"=",
"get_thellier_gui_meas_mapping",
"(",
"meas_df_in",
",",
"output",
")",
"meas_df_out",
"=",
"meas_df_in",
".",
"rename... | Take a measurement dataframe and convert column names
from MagIC 2 --> 3 or vice versa.
Use treat_step_num --> measurement_number if available,
otherwise measurement --> measurement_number.
Parameters
----------
meas_df_in : pandas DataFrame
input dataframe with measurement data
out... | [
"Take",
"a",
"measurement",
"dataframe",
"and",
"convert",
"column",
"names",
"from",
"MagIC",
"2",
"--",
">",
"3",
"or",
"vice",
"versa",
".",
"Use",
"treat_step_num",
"--",
">",
"measurement_number",
"if",
"available",
"otherwise",
"measurement",
"--",
">",
... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/mapping/map_magic.py#L205-L224 |
PmagPy/PmagPy | pmagpy/mapping/map_magic.py | convert_meas | def convert_meas(direction, Rec):
"""
converts measurments tables from magic 2 to 3 (direction=magic3)
or from model 3 to 2.5 (direction=magic2) [not available]
"""
if direction == 'magic3':
columns = meas_magic2_2_magic3_map
MeasRec = {}
for key in columns:
if ke... | python | def convert_meas(direction, Rec):
"""
converts measurments tables from magic 2 to 3 (direction=magic3)
or from model 3 to 2.5 (direction=magic2) [not available]
"""
if direction == 'magic3':
columns = meas_magic2_2_magic3_map
MeasRec = {}
for key in columns:
if ke... | [
"def",
"convert_meas",
"(",
"direction",
",",
"Rec",
")",
":",
"if",
"direction",
"==",
"'magic3'",
":",
"columns",
"=",
"meas_magic2_2_magic3_map",
"MeasRec",
"=",
"{",
"}",
"for",
"key",
"in",
"columns",
":",
"if",
"key",
"in",
"list",
"(",
"Rec",
".",... | converts measurments tables from magic 2 to 3 (direction=magic3)
or from model 3 to 2.5 (direction=magic2) [not available] | [
"converts",
"measurments",
"tables",
"from",
"magic",
"2",
"to",
"3",
"(",
"direction",
"=",
"magic3",
")",
"or",
"from",
"model",
"3",
"to",
"2",
".",
"5",
"(",
"direction",
"=",
"magic2",
")",
"[",
"not",
"available",
"]"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/mapping/map_magic.py#L368-L382 |
PmagPy/PmagPy | pmagpy/mapping/map_magic.py | convert_site_dm3_table_intensity | def convert_site_dm3_table_intensity(sites_df):
"""
Convert MagIC site headers to short/readable
headers for a figure (used by ipmag.sites_extract)
Intensity data only.
Parameters
----------
sites_df : pandas DataFrame
sites information
Returns
---------
int_df : pandas... | python | def convert_site_dm3_table_intensity(sites_df):
"""
Convert MagIC site headers to short/readable
headers for a figure (used by ipmag.sites_extract)
Intensity data only.
Parameters
----------
sites_df : pandas DataFrame
sites information
Returns
---------
int_df : pandas... | [
"def",
"convert_site_dm3_table_intensity",
"(",
"sites_df",
")",
":",
"# now for the intensities",
"has_vadms",
",",
"has_vdms",
"=",
"False",
",",
"False",
"if",
"'int_abs'",
"not",
"in",
"sites_df",
":",
"sites_df",
"[",
"'int_abs'",
"]",
"=",
"None",
"if",
"'... | Convert MagIC site headers to short/readable
headers for a figure (used by ipmag.sites_extract)
Intensity data only.
Parameters
----------
sites_df : pandas DataFrame
sites information
Returns
---------
int_df : pandas DataFrame
intensity site data with easily readable ... | [
"Convert",
"MagIC",
"site",
"headers",
"to",
"short",
"/",
"readable",
"headers",
"for",
"a",
"figure",
"(",
"used",
"by",
"ipmag",
".",
"sites_extract",
")",
"Intensity",
"data",
"only",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/mapping/map_magic.py#L477-L562 |
PmagPy/PmagPy | pmagpy/mapping/map_magic.py | convert_site_dm3_table_directions | def convert_site_dm3_table_directions(sites_df):
"""
Convert MagIC site headers to short/readable
headers for a figure (used by ipmag.sites_extract)
Directional table only.
Parameters
----------
sites_df : pandas DataFrame
sites information
Returns
---------
dir_df : pa... | python | def convert_site_dm3_table_directions(sites_df):
"""
Convert MagIC site headers to short/readable
headers for a figure (used by ipmag.sites_extract)
Directional table only.
Parameters
----------
sites_df : pandas DataFrame
sites information
Returns
---------
dir_df : pa... | [
"def",
"convert_site_dm3_table_directions",
"(",
"sites_df",
")",
":",
"# directional",
"# do directional stuff first",
"# a few things need cleaning up",
"dir_df",
"=",
"sites_df",
".",
"copy",
"(",
")",
".",
"dropna",
"(",
"subset",
"=",
"[",
"'dir_dec'",
",",
"'dir... | Convert MagIC site headers to short/readable
headers for a figure (used by ipmag.sites_extract)
Directional table only.
Parameters
----------
sites_df : pandas DataFrame
sites information
Returns
---------
dir_df : pandas DataFrame
directional site data with easily read... | [
"Convert",
"MagIC",
"site",
"headers",
"to",
"short",
"/",
"readable",
"headers",
"for",
"a",
"figure",
"(",
"used",
"by",
"ipmag",
".",
"sites_extract",
")",
"Directional",
"table",
"only",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/mapping/map_magic.py#L565-L622 |
PmagPy/PmagPy | pmagpy/mapping/map_magic.py | convert_specimen_dm3_table | def convert_specimen_dm3_table(spec_df):
"""
Convert MagIC specimen headers to short/readable
headers for a figure (used by ipmag.specimens_extract)
"""
from pmagpy import data_model3 as dm3
# get the data model
dm = dm3.DataModel()
# get the specimen absolute intensity column headers
... | python | def convert_specimen_dm3_table(spec_df):
"""
Convert MagIC specimen headers to short/readable
headers for a figure (used by ipmag.specimens_extract)
"""
from pmagpy import data_model3 as dm3
# get the data model
dm = dm3.DataModel()
# get the specimen absolute intensity column headers
... | [
"def",
"convert_specimen_dm3_table",
"(",
"spec_df",
")",
":",
"from",
"pmagpy",
"import",
"data_model3",
"as",
"dm3",
"# get the data model",
"dm",
"=",
"dm3",
".",
"DataModel",
"(",
")",
"# get the specimen absolute intensity column headers",
"meas_group",
"=",
"[",
... | Convert MagIC specimen headers to short/readable
headers for a figure (used by ipmag.specimens_extract) | [
"Convert",
"MagIC",
"specimen",
"headers",
"to",
"short",
"/",
"readable",
"headers",
"for",
"a",
"figure",
"(",
"used",
"by",
"ipmag",
".",
"specimens_extract",
")"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/mapping/map_magic.py#L625-L676 |
PmagPy/PmagPy | programs/conversion_scripts/sufar4_asc_magic.py | main | def main():
"""
NAME
sufar4-asc_magic.py
DESCRIPTION
converts ascii files generated by SUFAR ver.4.0 to MagIC formated
files for use with PmagPy plotting software
SYNTAX
sufar4-asc_magic.py -h [command line options]
OPTIONS
-h: prints the help message and q... | python | def main():
"""
NAME
sufar4-asc_magic.py
DESCRIPTION
converts ascii files generated by SUFAR ver.4.0 to MagIC formated
files for use with PmagPy plotting software
SYNTAX
sufar4-asc_magic.py -h [command line options]
OPTIONS
-h: prints the help message and q... | [
"def",
"main",
"(",
")",
":",
"args",
"=",
"sys",
".",
"argv",
"if",
"'-h'",
"in",
"args",
":",
"print",
"(",
"main",
".",
"__doc__",
")",
"sys",
".",
"exit",
"(",
")",
"dataframe",
"=",
"extractor",
".",
"command_line_dataframe",
"(",
"[",
"[",
"'... | NAME
sufar4-asc_magic.py
DESCRIPTION
converts ascii files generated by SUFAR ver.4.0 to MagIC formated
files for use with PmagPy plotting software
SYNTAX
sufar4-asc_magic.py -h [command line options]
OPTIONS
-h: prints the help message and quits
-f FILE: sp... | [
"NAME",
"sufar4",
"-",
"asc_magic",
".",
"py"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/conversion_scripts/sufar4_asc_magic.py#L6-L79 |
PmagPy/PmagPy | programs/deprecated/make_magic_plots2.py | main | def main():
"""
NAME
make_magic_plots.py
DESCRIPTION
inspects magic directory for available plots.
SYNTAX
make_magic_plots.py [command line options]
INPUT
magic files
OPTIONS
-h prints help message and quits
-f FILE specifies input file name
... | python | def main():
"""
NAME
make_magic_plots.py
DESCRIPTION
inspects magic directory for available plots.
SYNTAX
make_magic_plots.py [command line options]
INPUT
magic files
OPTIONS
-h prints help message and quits
-f FILE specifies input file name
... | [
"def",
"main",
"(",
")",
":",
"dirlist",
"=",
"[",
"'./'",
"]",
"dir_path",
"=",
"os",
".",
"getcwd",
"(",
")",
"names",
"=",
"os",
".",
"listdir",
"(",
"dir_path",
")",
"for",
"n",
"in",
"names",
":",
"if",
"'Location'",
"in",
"n",
":",
"dirlist... | NAME
make_magic_plots.py
DESCRIPTION
inspects magic directory for available plots.
SYNTAX
make_magic_plots.py [command line options]
INPUT
magic files
OPTIONS
-h prints help message and quits
-f FILE specifies input file name
-fmt [png,eps,svg,jpg,... | [
"NAME",
"make_magic_plots",
".",
"py"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/deprecated/make_magic_plots2.py#L8-L207 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.init_UI | def init_UI(self):
"""
Set display variables (font, resolution of GUI, sizer proportions)
then builds the Side bar panel, Top bar panel, and Plots scrolleing
panel which are then placed placed together in a sizer and fit to
the GUI wx.Frame
"""
# -------------------------... | python | def init_UI(self):
"""
Set display variables (font, resolution of GUI, sizer proportions)
then builds the Side bar panel, Top bar panel, and Plots scrolleing
panel which are then placed placed together in a sizer and fit to
the GUI wx.Frame
"""
# -------------------------... | [
"def",
"init_UI",
"(",
"self",
")",
":",
"# --------------------------------------------------------------------------",
"# Setup ScrolledPanel Ctrls---------------------------------------------",
"# --------------------------------------------------------------------------",
"# ------------------... | Set display variables (font, resolution of GUI, sizer proportions)
then builds the Side bar panel, Top bar panel, and Plots scrolleing
panel which are then placed placed together in a sizer and fit to
the GUI wx.Frame | [
"Set",
"display",
"variables",
"(",
"font",
"resolution",
"of",
"GUI",
"sizer",
"proportions",
")",
"then",
"builds",
"the",
"Side",
"bar",
"panel",
"Top",
"bar",
"panel",
"and",
"Plots",
"scrolleing",
"panel",
"which",
"are",
"then",
"placed",
"placed",
"to... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L332-L821 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.get_coordinate_system | def get_coordinate_system(self):
"""
Check self.Data for available coordinate systems.
Returns
---------
initial_coordinate, coordinate_list : str, list
i.e., 'geographic', ['specimen', 'geographic']
"""
coordinate_list = ['specimen']
initial_coor... | python | def get_coordinate_system(self):
"""
Check self.Data for available coordinate systems.
Returns
---------
initial_coordinate, coordinate_list : str, list
i.e., 'geographic', ['specimen', 'geographic']
"""
coordinate_list = ['specimen']
initial_coor... | [
"def",
"get_coordinate_system",
"(",
"self",
")",
":",
"coordinate_list",
"=",
"[",
"'specimen'",
"]",
"initial_coordinate",
"=",
"'specimen'",
"for",
"specimen",
"in",
"self",
".",
"specimens",
":",
"if",
"'geographic'",
"not",
"in",
"coordinate_list",
"and",
"... | Check self.Data for available coordinate systems.
Returns
---------
initial_coordinate, coordinate_list : str, list
i.e., 'geographic', ['specimen', 'geographic'] | [
"Check",
"self",
".",
"Data",
"for",
"available",
"coordinate",
"systems",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L824-L841 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.create_menu | def create_menu(self):
"""
Create the MenuBar for the GUI current structure is:
File : Change Working Directory, Import Interpretations from LSQ
file, Import interpretations from a redo file, Save interpretations
to a redo file, Save MagIC tables, Save Plots
Edit : New In... | python | def create_menu(self):
"""
Create the MenuBar for the GUI current structure is:
File : Change Working Directory, Import Interpretations from LSQ
file, Import interpretations from a redo file, Save interpretations
to a redo file, Save MagIC tables, Save Plots
Edit : New In... | [
"def",
"create_menu",
"(",
"self",
")",
":",
"self",
".",
"menubar",
"=",
"wx",
".",
"MenuBar",
"(",
")",
"# -----------------",
"# File Menu",
"# -----------------",
"menu_file",
"=",
"wx",
".",
"Menu",
"(",
")",
"m_change_WD",
"=",
"menu_file",
".",
"Appen... | Create the MenuBar for the GUI current structure is:
File : Change Working Directory, Import Interpretations from LSQ
file, Import interpretations from a redo file, Save interpretations
to a redo file, Save MagIC tables, Save Plots
Edit : New Interpretation, Delete Interpretation, Next
... | [
"Create",
"the",
"MenuBar",
"for",
"the",
"GUI",
"current",
"structure",
"is",
":",
"File",
":",
"Change",
"Working",
"Directory",
"Import",
"Interpretations",
"from",
"LSQ",
"file",
"Import",
"interpretations",
"from",
"a",
"redo",
"file",
"Save",
"interpretati... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L844-L1085 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.draw_figure | def draw_figure(self, s, update_high_plots=True):
"""
Convenience function that sets current specimen to s and calculates
data for that specimen then redraws all plots.
Parameters
----------
s : specimen to set current specimen too
update_high_plots : bool which ... | python | def draw_figure(self, s, update_high_plots=True):
"""
Convenience function that sets current specimen to s and calculates
data for that specimen then redraws all plots.
Parameters
----------
s : specimen to set current specimen too
update_high_plots : bool which ... | [
"def",
"draw_figure",
"(",
"self",
",",
"s",
",",
"update_high_plots",
"=",
"True",
")",
":",
"self",
".",
"initialize_CART_rot",
"(",
"s",
")",
"# Draw Zij plot",
"self",
".",
"draw_zijderveld",
"(",
")",
"# Draw specimen equal area",
"self",
".",
"draw_spec_eq... | Convenience function that sets current specimen to s and calculates
data for that specimen then redraws all plots.
Parameters
----------
s : specimen to set current specimen too
update_high_plots : bool which decides if high level mean plot
updates (default: False) | [
"Convenience",
"function",
"that",
"sets",
"current",
"specimen",
"to",
"s",
"and",
"calculates",
"data",
"for",
"that",
"specimen",
"then",
"redraws",
"all",
"plots",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L1091-L1120 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.draw_zijderveld | def draw_zijderveld(self):
"""
Draws the zijderveld plot in the GUI on canvas1
"""
self.fig1.clf()
axis_bounds = [0, .1, 1, .85]
self.zijplot = self.fig1.add_axes(
axis_bounds, frameon=False, facecolor='None', label='zig_orig', zorder=0)
self.zijplot.c... | python | def draw_zijderveld(self):
"""
Draws the zijderveld plot in the GUI on canvas1
"""
self.fig1.clf()
axis_bounds = [0, .1, 1, .85]
self.zijplot = self.fig1.add_axes(
axis_bounds, frameon=False, facecolor='None', label='zig_orig', zorder=0)
self.zijplot.c... | [
"def",
"draw_zijderveld",
"(",
"self",
")",
":",
"self",
".",
"fig1",
".",
"clf",
"(",
")",
"axis_bounds",
"=",
"[",
"0",
",",
".1",
",",
"1",
",",
".85",
"]",
"self",
".",
"zijplot",
"=",
"self",
".",
"fig1",
".",
"add_axes",
"(",
"axis_bounds",
... | Draws the zijderveld plot in the GUI on canvas1 | [
"Draws",
"the",
"zijderveld",
"plot",
"in",
"the",
"GUI",
"on",
"canvas1"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L1122-L1274 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.draw_spec_eqarea | def draw_spec_eqarea(self):
"""
Calculates point positions and draws the Specimen eqarea plot on
canvas2
"""
draw_net(self.specimen_eqarea)
self.specimen_eqarea.text(-1.2, 1.15, "specimen: %s" % self.s, {
'family': self.font_type, 'fontsi... | python | def draw_spec_eqarea(self):
"""
Calculates point positions and draws the Specimen eqarea plot on
canvas2
"""
draw_net(self.specimen_eqarea)
self.specimen_eqarea.text(-1.2, 1.15, "specimen: %s" % self.s, {
'family': self.font_type, 'fontsi... | [
"def",
"draw_spec_eqarea",
"(",
"self",
")",
":",
"draw_net",
"(",
"self",
".",
"specimen_eqarea",
")",
"self",
".",
"specimen_eqarea",
".",
"text",
"(",
"-",
"1.2",
",",
"1.15",
",",
"\"specimen: %s\"",
"%",
"self",
".",
"s",
",",
"{",
"'family'",
":",
... | Calculates point positions and draws the Specimen eqarea plot on
canvas2 | [
"Calculates",
"point",
"positions",
"and",
"draws",
"the",
"Specimen",
"eqarea",
"plot",
"on",
"canvas2"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L1276-L1371 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.draw_MM0 | def draw_MM0(self):
"""
Draws the M/M0 plot in the GUI on canvas3
"""
self.fig3.clf()
self.fig3.text(0.02, 0.96, 'M/M0', {'family': self.font_type, 'fontsize': 10 *
self.GUI_RESOLUTION, 'style': 'normal', 'va': 'center', 'ha': 'left'})
... | python | def draw_MM0(self):
"""
Draws the M/M0 plot in the GUI on canvas3
"""
self.fig3.clf()
self.fig3.text(0.02, 0.96, 'M/M0', {'family': self.font_type, 'fontsize': 10 *
self.GUI_RESOLUTION, 'style': 'normal', 'va': 'center', 'ha': 'left'})
... | [
"def",
"draw_MM0",
"(",
"self",
")",
":",
"self",
".",
"fig3",
".",
"clf",
"(",
")",
"self",
".",
"fig3",
".",
"text",
"(",
"0.02",
",",
"0.96",
",",
"'M/M0'",
",",
"{",
"'family'",
":",
"self",
".",
"font_type",
",",
"'fontsize'",
":",
"10",
"*"... | Draws the M/M0 plot in the GUI on canvas3 | [
"Draws",
"the",
"M",
"/",
"M0",
"plot",
"in",
"the",
"GUI",
"on",
"canvas3"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L1373-L1459 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.plot_selected_meas | def plot_selected_meas(self):
"""
Goes through all measurements selected in logger and draws darker
marker over all specimen plots to display which measurements have
been selected
"""
self.close_warning = True
# set hex colors for cover and size of selected meas m... | python | def plot_selected_meas(self):
"""
Goes through all measurements selected in logger and draws darker
marker over all specimen plots to display which measurements have
been selected
"""
self.close_warning = True
# set hex colors for cover and size of selected meas m... | [
"def",
"plot_selected_meas",
"(",
"self",
")",
":",
"self",
".",
"close_warning",
"=",
"True",
"# set hex colors for cover and size of selected meas marker",
"blue_cover",
"=",
"\"#9999FF\"",
"red_cover",
"=",
"\"#FF9999\"",
"eqarea_outline",
"=",
"\"#FF0000\"",
"MS_selecte... | Goes through all measurements selected in logger and draws darker
marker over all specimen plots to display which measurements have
been selected | [
"Goes",
"through",
"all",
"measurements",
"selected",
"in",
"logger",
"and",
"draws",
"darker",
"marker",
"over",
"all",
"specimen",
"plots",
"to",
"display",
"which",
"measurements",
"have",
"been",
"selected"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L1461-L1557 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.draw_interpretations | def draw_interpretations(self):
"""
draw the specimen interpretations on the zijderveld, the specimen
equal area, and the M/M0 plots
Alters
------
fit.lines, fit.points, fit.eqarea_data, fit.mm0_data,
zijplot, specimen_eqarea_interpretation, mplot_interpretation
... | python | def draw_interpretations(self):
"""
draw the specimen interpretations on the zijderveld, the specimen
equal area, and the M/M0 plots
Alters
------
fit.lines, fit.points, fit.eqarea_data, fit.mm0_data,
zijplot, specimen_eqarea_interpretation, mplot_interpretation
... | [
"def",
"draw_interpretations",
"(",
"self",
")",
":",
"problems",
"=",
"{",
"}",
"if",
"self",
".",
"s",
"in",
"self",
".",
"pmag_results_data",
"[",
"'specimens'",
"]",
"and",
"self",
".",
"pmag_results_data",
"[",
"'specimens'",
"]",
"[",
"self",
".",
... | draw the specimen interpretations on the zijderveld, the specimen
equal area, and the M/M0 plots
Alters
------
fit.lines, fit.points, fit.eqarea_data, fit.mm0_data,
zijplot, specimen_eqarea_interpretation, mplot_interpretation | [
"draw",
"the",
"specimen",
"interpretations",
"on",
"the",
"zijderveld",
"the",
"specimen",
"equal",
"area",
"and",
"the",
"M",
"/",
"M0",
"plots"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L1559-L1833 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.plot_high_levels_data | def plot_high_levels_data(self):
"""
Complicated function that draws the high level mean plot on canvas4,
draws all specimen, sample, or site interpretations according to the
UPPER_LEVEL_SHOW variable, draws the fisher mean or fisher mean by
polarity of all interpretations displa... | python | def plot_high_levels_data(self):
"""
Complicated function that draws the high level mean plot on canvas4,
draws all specimen, sample, or site interpretations according to the
UPPER_LEVEL_SHOW variable, draws the fisher mean or fisher mean by
polarity of all interpretations displa... | [
"def",
"plot_high_levels_data",
"(",
"self",
")",
":",
"# self.toolbar4.home()",
"high_level",
"=",
"self",
".",
"level_box",
".",
"GetValue",
"(",
")",
"self",
".",
"UPPER_LEVEL_NAME",
"=",
"self",
".",
"level_names",
".",
"GetValue",
"(",
")",
"self",
... | Complicated function that draws the high level mean plot on canvas4,
draws all specimen, sample, or site interpretations according to the
UPPER_LEVEL_SHOW variable, draws the fisher mean or fisher mean by
polarity of all interpretations displayed, draws sample orientation
check if on, an... | [
"Complicated",
"function",
"that",
"draws",
"the",
"high",
"level",
"mean",
"plot",
"on",
"canvas4",
"draws",
"all",
"specimen",
"sample",
"or",
"site",
"interpretations",
"according",
"to",
"the",
"UPPER_LEVEL_SHOW",
"variable",
"draws",
"the",
"fisher",
"mean",
... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L1835-L1873 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.get_levels_and_coordinates_names | def get_levels_and_coordinates_names(self):
"""
Get the current level of the high level mean plot and the name of
the corrisponding site, study, etc. As well as the code for the
current coordinate system.
Returns
-------
(high_level_type,high_level_name,coordinat... | python | def get_levels_and_coordinates_names(self):
"""
Get the current level of the high level mean plot and the name of
the corrisponding site, study, etc. As well as the code for the
current coordinate system.
Returns
-------
(high_level_type,high_level_name,coordinat... | [
"def",
"get_levels_and_coordinates_names",
"(",
"self",
")",
":",
"if",
"self",
".",
"COORDINATE_SYSTEM",
"==",
"\"geographic\"",
":",
"dirtype",
"=",
"'DA-DIR-GEO'",
"elif",
"self",
".",
"COORDINATE_SYSTEM",
"==",
"\"tilt-corrected\"",
":",
"dirtype",
"=",
"'DA-DIR... | Get the current level of the high level mean plot and the name of
the corrisponding site, study, etc. As well as the code for the
current coordinate system.
Returns
-------
(high_level_type,high_level_name,coordinate_system) : tuple object
containing current high lev... | [
"Get",
"the",
"current",
"level",
"of",
"the",
"high",
"level",
"mean",
"plot",
"and",
"the",
"name",
"of",
"the",
"corrisponding",
"site",
"study",
"etc",
".",
"As",
"well",
"as",
"the",
"code",
"for",
"the",
"current",
"coordinate",
"system",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L1875-L1903 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.calc_and_plot_sample_orient_check | def calc_and_plot_sample_orient_check(self):
"""
If sample orientation is on plots the wrong arrow, wrong compass,
and rotated sample error directions for the current specimen
interpretation on the high level mean plot so that you can check
sample orientation good/bad.
""... | python | def calc_and_plot_sample_orient_check(self):
"""
If sample orientation is on plots the wrong arrow, wrong compass,
and rotated sample error directions for the current specimen
interpretation on the high level mean plot so that you can check
sample orientation good/bad.
""... | [
"def",
"calc_and_plot_sample_orient_check",
"(",
"self",
")",
":",
"fit",
"=",
"self",
".",
"current_fit",
"if",
"fit",
"==",
"None",
":",
"return",
"pars",
"=",
"fit",
".",
"get",
"(",
"'specimen'",
")",
"if",
"'specimen_dec'",
"not",
"in",
"list",
"(",
... | If sample orientation is on plots the wrong arrow, wrong compass,
and rotated sample error directions for the current specimen
interpretation on the high level mean plot so that you can check
sample orientation good/bad. | [
"If",
"sample",
"orientation",
"is",
"on",
"plots",
"the",
"wrong",
"arrow",
"wrong",
"compass",
"and",
"rotated",
"sample",
"error",
"directions",
"for",
"the",
"current",
"specimen",
"interpretation",
"on",
"the",
"high",
"level",
"mean",
"plot",
"so",
"that... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L1997-L2080 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.plot_high_level_equalarea | def plot_high_level_equalarea(self, element):
"""
Given a GUI element such as a sample or specimen tries to plot to
high level mean plot
"""
if self.ie_open:
high_level = self.ie.show_box.GetValue()
else:
high_level = self.UPPER_LEVEL_SHOW
... | python | def plot_high_level_equalarea(self, element):
"""
Given a GUI element such as a sample or specimen tries to plot to
high level mean plot
"""
if self.ie_open:
high_level = self.ie.show_box.GetValue()
else:
high_level = self.UPPER_LEVEL_SHOW
... | [
"def",
"plot_high_level_equalarea",
"(",
"self",
",",
"element",
")",
":",
"if",
"self",
".",
"ie_open",
":",
"high_level",
"=",
"self",
".",
"ie",
".",
"show_box",
".",
"GetValue",
"(",
")",
"else",
":",
"high_level",
"=",
"self",
".",
"UPPER_LEVEL_SHOW",... | Given a GUI element such as a sample or specimen tries to plot to
high level mean plot | [
"Given",
"a",
"GUI",
"element",
"such",
"as",
"a",
"sample",
"or",
"specimen",
"tries",
"to",
"plot",
"to",
"high",
"level",
"mean",
"plot"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L2082-L2201 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.plot_eqarea_pars | def plot_eqarea_pars(self, pars, fig):
"""
Given a dictionary of parameters (pars) that is returned from
pmag.domean plots those pars to the given fig
"""
if pars == {}:
pass
elif 'calculation_type' in list(pars.keys()) and pars['calculation_type'] == 'DE-BFP'... | python | def plot_eqarea_pars(self, pars, fig):
"""
Given a dictionary of parameters (pars) that is returned from
pmag.domean plots those pars to the given fig
"""
if pars == {}:
pass
elif 'calculation_type' in list(pars.keys()) and pars['calculation_type'] == 'DE-BFP'... | [
"def",
"plot_eqarea_pars",
"(",
"self",
",",
"pars",
",",
"fig",
")",
":",
"if",
"pars",
"==",
"{",
"}",
":",
"pass",
"elif",
"'calculation_type'",
"in",
"list",
"(",
"pars",
".",
"keys",
"(",
")",
")",
"and",
"pars",
"[",
"'calculation_type'",
"]",
... | Given a dictionary of parameters (pars) that is returned from
pmag.domean plots those pars to the given fig | [
"Given",
"a",
"dictionary",
"of",
"parameters",
"(",
"pars",
")",
"that",
"is",
"returned",
"from",
"pmag",
".",
"domean",
"plots",
"those",
"pars",
"to",
"the",
"given",
"fig"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L2203-L2269 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.plot_eqarea_mean | def plot_eqarea_mean(self, meanpars, fig):
"""
Given a dictionary of parameters from pmag.dofisher, pmag.dolnp, or
pmag.dobingham (meanpars) plots parameters to fig
"""
mpars_to_plot = []
if meanpars == {}:
return
if meanpars['calculation_type'] == 'Fi... | python | def plot_eqarea_mean(self, meanpars, fig):
"""
Given a dictionary of parameters from pmag.dofisher, pmag.dolnp, or
pmag.dobingham (meanpars) plots parameters to fig
"""
mpars_to_plot = []
if meanpars == {}:
return
if meanpars['calculation_type'] == 'Fi... | [
"def",
"plot_eqarea_mean",
"(",
"self",
",",
"meanpars",
",",
"fig",
")",
":",
"mpars_to_plot",
"=",
"[",
"]",
"if",
"meanpars",
"==",
"{",
"}",
":",
"return",
"if",
"meanpars",
"[",
"'calculation_type'",
"]",
"==",
"'Fisher by polarity'",
":",
"for",
"mod... | Given a dictionary of parameters from pmag.dofisher, pmag.dolnp, or
pmag.dobingham (meanpars) plots parameters to fig | [
"Given",
"a",
"dictionary",
"of",
"parameters",
"from",
"pmag",
".",
"dofisher",
"pmag",
".",
"dolnp",
"or",
"pmag",
".",
"dobingham",
"(",
"meanpars",
")",
"plots",
"parameters",
"to",
"fig"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L2271-L2326 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.initialize_CART_rot | def initialize_CART_rot(self, s):
"""
Sets current specimen to s and calculates the data necessary to plot
the specimen plots (zijderveld, specimen eqarea, M/M0)
Parameters
----------
s: specimen to set as the GUI's current specimen
"""
self.s = s # only... | python | def initialize_CART_rot(self, s):
"""
Sets current specimen to s and calculates the data necessary to plot
the specimen plots (zijderveld, specimen eqarea, M/M0)
Parameters
----------
s: specimen to set as the GUI's current specimen
"""
self.s = s # only... | [
"def",
"initialize_CART_rot",
"(",
"self",
",",
"s",
")",
":",
"self",
".",
"s",
"=",
"s",
"# only place in code where self.s is to be set directly",
"if",
"self",
".",
"orthogonal_box",
".",
"GetValue",
"(",
")",
"==",
"\"X=East\"",
":",
"self",
".",
"ORTHO_PLO... | Sets current specimen to s and calculates the data necessary to plot
the specimen plots (zijderveld, specimen eqarea, M/M0)
Parameters
----------
s: specimen to set as the GUI's current specimen | [
"Sets",
"current",
"specimen",
"to",
"s",
"and",
"calculates",
"the",
"data",
"necessary",
"to",
"plot",
"the",
"specimen",
"plots",
"(",
"zijderveld",
"specimen",
"eqarea",
"M",
"/",
"M0",
")"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L2336-L2434 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.add_fit | def add_fit(self, specimen, name, fmin, fmax, PCA_type="DE-BFL", color=None, suppress_warnings=False, saved=True):
"""
Goes through the data checks required to add an interpretation to
the param specimen with the name param name, the bounds param fmin
and param fmax, and calculation type... | python | def add_fit(self, specimen, name, fmin, fmax, PCA_type="DE-BFL", color=None, suppress_warnings=False, saved=True):
"""
Goes through the data checks required to add an interpretation to
the param specimen with the name param name, the bounds param fmin
and param fmax, and calculation type... | [
"def",
"add_fit",
"(",
"self",
",",
"specimen",
",",
"name",
",",
"fmin",
",",
"fmax",
",",
"PCA_type",
"=",
"\"DE-BFL\"",
",",
"color",
"=",
"None",
",",
"suppress_warnings",
"=",
"False",
",",
"saved",
"=",
"True",
")",
":",
"if",
"specimen",
"not",
... | Goes through the data checks required to add an interpretation to
the param specimen with the name param name, the bounds param fmin
and param fmax, and calculation type param PCA_type.
Parameters
----------
specimen : specimen with measurement data to add the
interpreta... | [
"Goes",
"through",
"the",
"data",
"checks",
"required",
"to",
"add",
"an",
"interpretation",
"to",
"the",
"param",
"specimen",
"with",
"the",
"name",
"param",
"name",
"the",
"bounds",
"param",
"fmin",
"and",
"param",
"fmax",
"and",
"calculation",
"type",
"pa... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L2436-L2494 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.delete_fit | def delete_fit(self, fit, specimen=None):
"""
removes fit from GUI results data
Parameters
----------
fit : fit to remove
specimen : specimen of fit to remove, if not provided and
set to None then the function will find the specimen itself
"""
if ... | python | def delete_fit(self, fit, specimen=None):
"""
removes fit from GUI results data
Parameters
----------
fit : fit to remove
specimen : specimen of fit to remove, if not provided and
set to None then the function will find the specimen itself
"""
if ... | [
"def",
"delete_fit",
"(",
"self",
",",
"fit",
",",
"specimen",
"=",
"None",
")",
":",
"if",
"specimen",
"==",
"None",
":",
"for",
"spec",
"in",
"self",
".",
"pmag_results_data",
"[",
"'specimens'",
"]",
":",
"if",
"fit",
"in",
"self",
".",
"pmag_result... | removes fit from GUI results data
Parameters
----------
fit : fit to remove
specimen : specimen of fit to remove, if not provided and
set to None then the function will find the specimen itself | [
"removes",
"fit",
"from",
"GUI",
"results",
"data"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L2496-L2524 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.calculate_vgp_data | def calculate_vgp_data(self):
"""
Calculates VGPS for all samples, sites, and locations
Returns
-------
VGP_Data : dictionary of structure {sample: {comp: data},
site: {comp: data}, location: {comp: data}}
"""
# get criteria if it exists else use defa... | python | def calculate_vgp_data(self):
"""
Calculates VGPS for all samples, sites, and locations
Returns
-------
VGP_Data : dictionary of structure {sample: {comp: data},
site: {comp: data}, location: {comp: data}}
"""
# get criteria if it exists else use defa... | [
"def",
"calculate_vgp_data",
"(",
"self",
")",
":",
"# get criteria if it exists else use default",
"crit_data",
"=",
"self",
".",
"read_criteria_file",
"(",
")",
"if",
"crit_data",
"==",
"None",
":",
"crit_data",
"=",
"pmag",
".",
"default_criteria",
"(",
"0",
")... | Calculates VGPS for all samples, sites, and locations
Returns
-------
VGP_Data : dictionary of structure {sample: {comp: data},
site: {comp: data}, location: {comp: data}} | [
"Calculates",
"VGPS",
"for",
"all",
"samples",
"sites",
"and",
"locations"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L2526-L2771 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.convert_ages_to_calendar_year | def convert_ages_to_calendar_year(self, er_ages_rec):
"""
convert all age units to calendar year
Parameters
----------
er_ages_rec : Dict type object containing preferbly at least keys
'age', 'age_unit', and either 'age_range_high', 'age_range_low'
or 'ag... | python | def convert_ages_to_calendar_year(self, er_ages_rec):
"""
convert all age units to calendar year
Parameters
----------
er_ages_rec : Dict type object containing preferbly at least keys
'age', 'age_unit', and either 'age_range_high', 'age_range_low'
or 'ag... | [
"def",
"convert_ages_to_calendar_year",
"(",
"self",
",",
"er_ages_rec",
")",
":",
"if",
"\"age\"",
"not",
"in",
"list",
"(",
"er_ages_rec",
".",
"keys",
"(",
")",
")",
":",
"return",
"(",
"er_ages_rec",
")",
"if",
"\"age_unit\"",
"not",
"in",
"list",
"(",... | convert all age units to calendar year
Parameters
----------
er_ages_rec : Dict type object containing preferbly at least keys
'age', 'age_unit', and either 'age_range_high', 'age_range_low'
or 'age_sigma'
Returns
-------
er_ages_rec : Same dict ... | [
"convert",
"all",
"age",
"units",
"to",
"calendar",
"year"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L2773-L2846 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.generate_warning_text | def generate_warning_text(self):
"""
generates warnings for the current specimen then adds them to the
current warning text for the GUI which will be rendered on a call to
update_warning_box.
"""
self.warning_text = ""
if self.s in list(self.pmag_results_data['spe... | python | def generate_warning_text(self):
"""
generates warnings for the current specimen then adds them to the
current warning text for the GUI which will be rendered on a call to
update_warning_box.
"""
self.warning_text = ""
if self.s in list(self.pmag_results_data['spe... | [
"def",
"generate_warning_text",
"(",
"self",
")",
":",
"self",
".",
"warning_text",
"=",
"\"\"",
"if",
"self",
".",
"s",
"in",
"list",
"(",
"self",
".",
"pmag_results_data",
"[",
"'specimens'",
"]",
".",
"keys",
"(",
")",
")",
":",
"for",
"fit",
"in",
... | generates warnings for the current specimen then adds them to the
current warning text for the GUI which will be rendered on a call to
update_warning_box. | [
"generates",
"warnings",
"for",
"the",
"current",
"specimen",
"then",
"adds",
"them",
"to",
"the",
"current",
"warning",
"text",
"for",
"the",
"GUI",
"which",
"will",
"be",
"rendered",
"on",
"a",
"call",
"to",
"update_warning_box",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L2848-L2907 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.read_criteria_file | def read_criteria_file(self, criteria_file_name=None):
"""
reads 2.5 or 3.0 formatted PmagPy criteria file and returns a set of
nested dictionary 2.5 formated criteria data that can be passed into
pmag.grade to filter data.
Parameters
----------
criteria_file : n... | python | def read_criteria_file(self, criteria_file_name=None):
"""
reads 2.5 or 3.0 formatted PmagPy criteria file and returns a set of
nested dictionary 2.5 formated criteria data that can be passed into
pmag.grade to filter data.
Parameters
----------
criteria_file : n... | [
"def",
"read_criteria_file",
"(",
"self",
",",
"criteria_file_name",
"=",
"None",
")",
":",
"# import pdb; pdb.set_trace()",
"acceptance_criteria",
"=",
"pmag",
".",
"initialize_acceptance_criteria",
"(",
")",
"if",
"self",
".",
"data_model",
"==",
"3",
":",
... | reads 2.5 or 3.0 formatted PmagPy criteria file and returns a set of
nested dictionary 2.5 formated criteria data that can be passed into
pmag.grade to filter data.
Parameters
----------
criteria_file : name of criteria file to read in
Returns
-------
ne... | [
"reads",
"2",
".",
"5",
"or",
"3",
".",
"0",
"formatted",
"PmagPy",
"criteria",
"file",
"and",
"returns",
"a",
"set",
"of",
"nested",
"dictionary",
"2",
".",
"5",
"formated",
"criteria",
"data",
"that",
"can",
"be",
"passed",
"into",
"pmag",
".",
"grad... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L2909-L2960 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.get_PCA_parameters | def get_PCA_parameters(self, specimen, fit, tmin, tmax, coordinate_system, calculation_type):
"""
Uses pmag.domean to preform a line, line-with-origin, line-anchored,
or plane least squared regression or a fisher mean on the
measurement data of specimen in coordinate system between bound... | python | def get_PCA_parameters(self, specimen, fit, tmin, tmax, coordinate_system, calculation_type):
"""
Uses pmag.domean to preform a line, line-with-origin, line-anchored,
or plane least squared regression or a fisher mean on the
measurement data of specimen in coordinate system between bound... | [
"def",
"get_PCA_parameters",
"(",
"self",
",",
"specimen",
",",
"fit",
",",
"tmin",
",",
"tmax",
",",
"coordinate_system",
",",
"calculation_type",
")",
":",
"if",
"tmin",
"==",
"''",
"or",
"tmax",
"==",
"''",
":",
"return",
"beg_pca",
",",
"end_pca",
"=... | Uses pmag.domean to preform a line, line-with-origin, line-anchored,
or plane least squared regression or a fisher mean on the
measurement data of specimen in coordinate system between bounds
tmin to tmax
Parameters
----------
specimen : specimen with measurement data in... | [
"Uses",
"pmag",
".",
"domean",
"to",
"preform",
"a",
"line",
"line",
"-",
"with",
"-",
"origin",
"line",
"-",
"anchored",
"or",
"plane",
"least",
"squared",
"regression",
"or",
"a",
"fisher",
"mean",
"on",
"the",
"measurement",
"data",
"of",
"specimen",
... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L2962-L3029 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.autointerpret | def autointerpret(self, event, step_size=None, calculation_type="DE-BFL"):
"""
Clears current interpretations and adds interpretations to every
specimen of type = calculation_type by attempting fits of size =
step size and type = calculation_type and testing the mad or a95
then f... | python | def autointerpret(self, event, step_size=None, calculation_type="DE-BFL"):
"""
Clears current interpretations and adds interpretations to every
specimen of type = calculation_type by attempting fits of size =
step size and type = calculation_type and testing the mad or a95
then f... | [
"def",
"autointerpret",
"(",
"self",
",",
"event",
",",
"step_size",
"=",
"None",
",",
"calculation_type",
"=",
"\"DE-BFL\"",
")",
":",
"if",
"not",
"self",
".",
"user_warning",
"(",
"\"This feature is in ALPHA and still in development and testing. It is subject to bugs a... | Clears current interpretations and adds interpretations to every
specimen of type = calculation_type by attempting fits of size =
step size and type = calculation_type and testing the mad or a95
then finding peaks in these to note areas of maximum error then fits
between these peaks excl... | [
"Clears",
"current",
"interpretations",
"and",
"adds",
"interpretations",
"to",
"every",
"specimen",
"of",
"type",
"=",
"calculation_type",
"by",
"attempting",
"fits",
"of",
"size",
"=",
"step",
"size",
"and",
"type",
"=",
"calculation_type",
"and",
"testing",
"... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L3031-L3066 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.autointerpret_specimen | def autointerpret_specimen(self, specimen, step_size, calculation_type):
"""In Dev"""
if self.COORDINATE_SYSTEM == 'geographic':
block = self.Data[specimen]['zijdblock_geo']
elif self.COORDINATE_SYSTEM == 'tilt-corrected':
block = self.Data[specimen]['zijdblock_tilt']
... | python | def autointerpret_specimen(self, specimen, step_size, calculation_type):
"""In Dev"""
if self.COORDINATE_SYSTEM == 'geographic':
block = self.Data[specimen]['zijdblock_geo']
elif self.COORDINATE_SYSTEM == 'tilt-corrected':
block = self.Data[specimen]['zijdblock_tilt']
... | [
"def",
"autointerpret_specimen",
"(",
"self",
",",
"specimen",
",",
"step_size",
",",
"calculation_type",
")",
":",
"if",
"self",
".",
"COORDINATE_SYSTEM",
"==",
"'geographic'",
":",
"block",
"=",
"self",
".",
"Data",
"[",
"specimen",
"]",
"[",
"'zijdblock_geo... | In Dev | [
"In",
"Dev"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L3068-L3107 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.get_high_level_mean_pars | def get_high_level_mean_pars(self, high_level_type, high_level_name, calculation_type, elements_type, mean_fit, dirtype):
"""
Gets the Parameters of a mean of lower level data such as a Site
level Fisher mean of Specimen interpretations
Parameters
----------
high_level_t... | python | def get_high_level_mean_pars(self, high_level_type, high_level_name, calculation_type, elements_type, mean_fit, dirtype):
"""
Gets the Parameters of a mean of lower level data such as a Site
level Fisher mean of Specimen interpretations
Parameters
----------
high_level_t... | [
"def",
"get_high_level_mean_pars",
"(",
"self",
",",
"high_level_type",
",",
"high_level_name",
",",
"calculation_type",
",",
"elements_type",
",",
"mean_fit",
",",
"dirtype",
")",
":",
"elements_list",
"=",
"self",
".",
"Data_hierarchy",
"[",
"high_level_type",
"]"... | Gets the Parameters of a mean of lower level data such as a Site
level Fisher mean of Specimen interpretations
Parameters
----------
high_level_type : 'samples','sites','locations','study'
high_level_name : sample, site, location, or study whose
data to which to appl... | [
"Gets",
"the",
"Parameters",
"of",
"a",
"mean",
"of",
"lower",
"level",
"data",
"such",
"as",
"a",
"Site",
"level",
"Fisher",
"mean",
"of",
"Specimen",
"interpretations"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L3109-L3184 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.calculate_mean | def calculate_mean(self, pars_for_mean, calculation_type):
"""
Uses pmag.dolnp or pmag.fisher_by_pol to do a fisher mean or fisher
mean by polarity on the list of dictionaries in pars for mean
Parameters
----------
pars_for_mean : list of dictionaries with all data to av... | python | def calculate_mean(self, pars_for_mean, calculation_type):
"""
Uses pmag.dolnp or pmag.fisher_by_pol to do a fisher mean or fisher
mean by polarity on the list of dictionaries in pars for mean
Parameters
----------
pars_for_mean : list of dictionaries with all data to av... | [
"def",
"calculate_mean",
"(",
"self",
",",
"pars_for_mean",
",",
"calculation_type",
")",
":",
"if",
"len",
"(",
"pars_for_mean",
")",
"==",
"0",
":",
"return",
"(",
"{",
"}",
")",
"elif",
"len",
"(",
"pars_for_mean",
")",
"==",
"1",
":",
"return",
"("... | Uses pmag.dolnp or pmag.fisher_by_pol to do a fisher mean or fisher
mean by polarity on the list of dictionaries in pars for mean
Parameters
----------
pars_for_mean : list of dictionaries with all data to average
calculation_type : type of mean to take (options: Fisher,
... | [
"Uses",
"pmag",
".",
"dolnp",
"or",
"pmag",
".",
"fisher_by_pol",
"to",
"do",
"a",
"fisher",
"mean",
"or",
"fisher",
"mean",
"by",
"polarity",
"on",
"the",
"list",
"of",
"dictionaries",
"in",
"pars",
"for",
"mean"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L3219-L3265 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.calculate_high_levels_data | def calculate_high_levels_data(self):
"""
calculates high level mean data for the high level mean plot using
information in level_box, level_names, mean_type_box, and
mean_fit_box also updates the information in the ie to match high
level mean data in main GUI.
"""
... | python | def calculate_high_levels_data(self):
"""
calculates high level mean data for the high level mean plot using
information in level_box, level_names, mean_type_box, and
mean_fit_box also updates the information in the ie to match high
level mean data in main GUI.
"""
... | [
"def",
"calculate_high_levels_data",
"(",
"self",
")",
":",
"high_level_type",
"=",
"str",
"(",
"self",
".",
"level_box",
".",
"GetValue",
"(",
")",
")",
"if",
"high_level_type",
"==",
"'sample'",
":",
"high_level_type",
"=",
"'samples'",
"if",
"high_level_type"... | calculates high level mean data for the high level mean plot using
information in level_box, level_names, mean_type_box, and
mean_fit_box also updates the information in the ie to match high
level mean data in main GUI. | [
"calculates",
"high",
"level",
"mean",
"data",
"for",
"the",
"high",
"level",
"mean",
"plot",
"using",
"information",
"in",
"level_box",
"level_names",
"mean_type_box",
"and",
"mean_fit_box",
"also",
"updates",
"the",
"information",
"in",
"the",
"ie",
"to",
"mat... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L3307-L3327 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.quiet_reset_backend | def quiet_reset_backend(self, reset_interps=True):
"""
Doesn't update plots or logger or any visable data but resets all
measurement data, hierarchy data, and optionally resets
intepretations.
Parameters
----------
reset_interps : bool to tell the function to res... | python | def quiet_reset_backend(self, reset_interps=True):
"""
Doesn't update plots or logger or any visable data but resets all
measurement data, hierarchy data, and optionally resets
intepretations.
Parameters
----------
reset_interps : bool to tell the function to res... | [
"def",
"quiet_reset_backend",
"(",
"self",
",",
"reset_interps",
"=",
"True",
")",
":",
"new_Data_info",
"=",
"self",
".",
"get_data_info",
"(",
")",
"new_Data",
",",
"new_Data_hierarchy",
"=",
"self",
".",
"get_data",
"(",
")",
"if",
"not",
"new_Data",
":",... | Doesn't update plots or logger or any visable data but resets all
measurement data, hierarchy data, and optionally resets
intepretations.
Parameters
----------
reset_interps : bool to tell the function to reset fits or
not. | [
"Doesn",
"t",
"update",
"plots",
"or",
"logger",
"or",
"any",
"visable",
"data",
"but",
"resets",
"all",
"measurement",
"data",
"hierarchy",
"data",
"and",
"optionally",
"resets",
"intepretations",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L3329-L3397 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.reset_backend | def reset_backend(self, warn_user=True, reset_interps=True):
"""
Resets GUI data and updates GUI displays such as plots, boxes, and
logger
Parameters
----------
warn_user : bool which decides if a warning dialog is displayed to
the user to ask about reseting ... | python | def reset_backend(self, warn_user=True, reset_interps=True):
"""
Resets GUI data and updates GUI displays such as plots, boxes, and
logger
Parameters
----------
warn_user : bool which decides if a warning dialog is displayed to
the user to ask about reseting ... | [
"def",
"reset_backend",
"(",
"self",
",",
"warn_user",
"=",
"True",
",",
"reset_interps",
"=",
"True",
")",
":",
"if",
"warn_user",
"and",
"not",
"self",
".",
"data_loss_warning",
"(",
")",
":",
"return",
"False",
"# reset backend, including get_data(), get_data_i... | Resets GUI data and updates GUI displays such as plots, boxes, and
logger
Parameters
----------
warn_user : bool which decides if a warning dialog is displayed to
the user to ask about reseting data
reset_interps : bool which decides if interpretations are read in
... | [
"Resets",
"GUI",
"data",
"and",
"updates",
"GUI",
"displays",
"such",
"as",
"plots",
"boxes",
"and",
"logger"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L3399-L3446 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.recalculate_current_specimen_interpreatations | def recalculate_current_specimen_interpreatations(self):
"""
recalculates all interpretations on all specimens for all coordinate
systems. Does not display recalcuated data.
"""
self.initialize_CART_rot(self.s)
if str(self.s) in self.pmag_results_data['specimens']:
... | python | def recalculate_current_specimen_interpreatations(self):
"""
recalculates all interpretations on all specimens for all coordinate
systems. Does not display recalcuated data.
"""
self.initialize_CART_rot(self.s)
if str(self.s) in self.pmag_results_data['specimens']:
... | [
"def",
"recalculate_current_specimen_interpreatations",
"(",
"self",
")",
":",
"self",
".",
"initialize_CART_rot",
"(",
"self",
".",
"s",
")",
"if",
"str",
"(",
"self",
".",
"s",
")",
"in",
"self",
".",
"pmag_results_data",
"[",
"'specimens'",
"]",
":",
"for... | recalculates all interpretations on all specimens for all coordinate
systems. Does not display recalcuated data. | [
"recalculates",
"all",
"interpretations",
"on",
"all",
"specimens",
"for",
"all",
"coordinate",
"systems",
".",
"Does",
"not",
"display",
"recalcuated",
"data",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L3448-L3464 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.parse_bound_data | def parse_bound_data(self, tmin0, tmax0, specimen):
"""
converts Kelvin/Tesla temperature/AF data from the MagIC/Redo format
to that of Celsius/milliTesla which is used by the GUI as it is
often more intuitive
Parameters
----------
tmin0 : the input temperature/A... | python | def parse_bound_data(self, tmin0, tmax0, specimen):
"""
converts Kelvin/Tesla temperature/AF data from the MagIC/Redo format
to that of Celsius/milliTesla which is used by the GUI as it is
often more intuitive
Parameters
----------
tmin0 : the input temperature/A... | [
"def",
"parse_bound_data",
"(",
"self",
",",
"tmin0",
",",
"tmax0",
",",
"specimen",
")",
":",
"if",
"specimen",
"not",
"in",
"self",
".",
"Data",
":",
"print",
"(",
"(",
"\"no measurement data found loaded for specimen %s and will be ignored\"",
"%",
"(",
"specim... | converts Kelvin/Tesla temperature/AF data from the MagIC/Redo format
to that of Celsius/milliTesla which is used by the GUI as it is
often more intuitive
Parameters
----------
tmin0 : the input temperature/AF lower bound value to convert
tmax0 : the input temperature/AF ... | [
"converts",
"Kelvin",
"/",
"Tesla",
"temperature",
"/",
"AF",
"data",
"from",
"the",
"MagIC",
"/",
"Redo",
"format",
"to",
"that",
"of",
"Celsius",
"/",
"milliTesla",
"which",
"is",
"used",
"by",
"the",
"GUI",
"as",
"it",
"is",
"often",
"more",
"intuitiv... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L3466-L3522 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.get_indices | def get_indices(self, fit=None, tmin=None, tmax=None, specimen=None):
"""
Finds the appropriate indices in self.Data[self.s]['zijdplot_steps']
given a set of upper/lower bounds. This is to resolve duplicate
steps using the convention that the first good step of that name is
the i... | python | def get_indices(self, fit=None, tmin=None, tmax=None, specimen=None):
"""
Finds the appropriate indices in self.Data[self.s]['zijdplot_steps']
given a set of upper/lower bounds. This is to resolve duplicate
steps using the convention that the first good step of that name is
the i... | [
"def",
"get_indices",
"(",
"self",
",",
"fit",
"=",
"None",
",",
"tmin",
"=",
"None",
",",
"tmax",
"=",
"None",
",",
"specimen",
"=",
"None",
")",
":",
"if",
"specimen",
"==",
"None",
":",
"specimen",
"=",
"self",
".",
"s",
"if",
"fit",
"and",
"n... | Finds the appropriate indices in self.Data[self.s]['zijdplot_steps']
given a set of upper/lower bounds. This is to resolve duplicate
steps using the convention that the first good step of that name is
the indicated step by that bound if there are no steps of the names
tmin or tmax then i... | [
"Finds",
"the",
"appropriate",
"indices",
"in",
"self",
".",
"Data",
"[",
"self",
".",
"s",
"]",
"[",
"zijdplot_steps",
"]",
"given",
"a",
"set",
"of",
"upper",
"/",
"lower",
"bounds",
".",
"This",
"is",
"to",
"resolve",
"duplicate",
"steps",
"using",
... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L3524-L3635 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.merge_pmag_recs | def merge_pmag_recs(self, old_recs):
"""
Takes in a list of dictionaries old_recs and returns a list of
dictionaries where every dictionary in the returned list has the
same keys as all the others.
Parameters
----------
old_recs : list of dictionaries to fix
... | python | def merge_pmag_recs(self, old_recs):
"""
Takes in a list of dictionaries old_recs and returns a list of
dictionaries where every dictionary in the returned list has the
same keys as all the others.
Parameters
----------
old_recs : list of dictionaries to fix
... | [
"def",
"merge_pmag_recs",
"(",
"self",
",",
"old_recs",
")",
":",
"recs",
"=",
"{",
"}",
"recs",
"=",
"deepcopy",
"(",
"old_recs",
")",
"headers",
"=",
"[",
"]",
"for",
"rec",
"in",
"recs",
":",
"for",
"key",
"in",
"list",
"(",
"rec",
".",
"keys",
... | Takes in a list of dictionaries old_recs and returns a list of
dictionaries where every dictionary in the returned list has the
same keys as all the others.
Parameters
----------
old_recs : list of dictionaries to fix
Returns
-------
recs : list of dicti... | [
"Takes",
"in",
"a",
"list",
"of",
"dictionaries",
"old_recs",
"and",
"returns",
"a",
"list",
"of",
"dictionaries",
"where",
"every",
"dictionary",
"in",
"the",
"returned",
"list",
"has",
"the",
"same",
"keys",
"as",
"all",
"the",
"others",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L3637-L3662 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.select_specimen | def select_specimen(self, specimen):
"""
Goes through the calculations necessary to plot measurement data for
specimen and sets specimen as current GUI specimen, also attempts to
handle changing current fit.
"""
try:
fit_index = self.pmag_results_data['specime... | python | def select_specimen(self, specimen):
"""
Goes through the calculations necessary to plot measurement data for
specimen and sets specimen as current GUI specimen, also attempts to
handle changing current fit.
"""
try:
fit_index = self.pmag_results_data['specime... | [
"def",
"select_specimen",
"(",
"self",
",",
"specimen",
")",
":",
"try",
":",
"fit_index",
"=",
"self",
".",
"pmag_results_data",
"[",
"'specimens'",
"]",
"[",
"self",
".",
"s",
"]",
".",
"index",
"(",
"self",
".",
"current_fit",
")",
"except",
"KeyError... | Goes through the calculations necessary to plot measurement data for
specimen and sets specimen as current GUI specimen, also attempts to
handle changing current fit. | [
"Goes",
"through",
"the",
"calculations",
"necessary",
"to",
"plot",
"measurement",
"data",
"for",
"specimen",
"and",
"sets",
"specimen",
"as",
"current",
"GUI",
"specimen",
"also",
"attempts",
"to",
"handle",
"changing",
"current",
"fit",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L3668-L3692 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.clear_interpretations | def clear_interpretations(self, message=None):
"""
Clears all specimen interpretations
Parameters
----------
message : message to display when warning the user that all
fits will be deleted. If None default message is used (None is
default)
"""
if... | python | def clear_interpretations(self, message=None):
"""
Clears all specimen interpretations
Parameters
----------
message : message to display when warning the user that all
fits will be deleted. If None default message is used (None is
default)
"""
if... | [
"def",
"clear_interpretations",
"(",
"self",
",",
"message",
"=",
"None",
")",
":",
"if",
"self",
".",
"total_num_of_interpertations",
"(",
")",
"==",
"0",
":",
"print",
"(",
"\"There are no interpretations\"",
")",
"return",
"True",
"if",
"message",
"==",
"No... | Clears all specimen interpretations
Parameters
----------
message : message to display when warning the user that all
fits will be deleted. If None default message is used (None is
default) | [
"Clears",
"all",
"specimen",
"interpretations"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L3694-L3725 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.mark_meas_good | def mark_meas_good(self, g_index):
"""
Marks the g_index'th measuremnt of current specimen good
Parameters
----------
g_index : int that gives the index of the measurement to mark good,
indexed from 0
"""
meas_index, ind_data = 0, []
for i, me... | python | def mark_meas_good(self, g_index):
"""
Marks the g_index'th measuremnt of current specimen good
Parameters
----------
g_index : int that gives the index of the measurement to mark good,
indexed from 0
"""
meas_index, ind_data = 0, []
for i, me... | [
"def",
"mark_meas_good",
"(",
"self",
",",
"g_index",
")",
":",
"meas_index",
",",
"ind_data",
"=",
"0",
",",
"[",
"]",
"for",
"i",
",",
"meas_data",
"in",
"enumerate",
"(",
"self",
".",
"mag_meas_data",
")",
":",
"if",
"meas_data",
"[",
"'er_specimen_na... | Marks the g_index'th measuremnt of current specimen good
Parameters
----------
g_index : int that gives the index of the measurement to mark good,
indexed from 0 | [
"Marks",
"the",
"g_index",
"th",
"measuremnt",
"of",
"current",
"specimen",
"good"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L3740-L3776 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.mark_fit_good | def mark_fit_good(self, fit, spec=None):
"""
Marks fit good so it is used in high level means
Parameters
----------
fit : fit to mark good
spec : specimen of fit to mark good (optional though runtime will
increase if not provided)
"""
if spec ... | python | def mark_fit_good(self, fit, spec=None):
"""
Marks fit good so it is used in high level means
Parameters
----------
fit : fit to mark good
spec : specimen of fit to mark good (optional though runtime will
increase if not provided)
"""
if spec ... | [
"def",
"mark_fit_good",
"(",
"self",
",",
"fit",
",",
"spec",
"=",
"None",
")",
":",
"if",
"spec",
"==",
"None",
":",
"for",
"spec",
",",
"fits",
"in",
"list",
"(",
"self",
".",
"pmag_results_data",
"[",
"'specimens'",
"]",
".",
"items",
"(",
")",
... | Marks fit good so it is used in high level means
Parameters
----------
fit : fit to mark good
spec : specimen of fit to mark good (optional though runtime will
increase if not provided) | [
"Marks",
"fit",
"good",
"so",
"it",
"is",
"used",
"in",
"high",
"level",
"means"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L3817-L3841 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.mark_fit_bad | def mark_fit_bad(self, fit):
"""
Marks fit bad so it is excluded from high level means
Parameters
----------
fit : fit to mark bad
"""
if fit not in self.bad_fits:
self.bad_fits.append(fit)
return True
else:
return Fals... | python | def mark_fit_bad(self, fit):
"""
Marks fit bad so it is excluded from high level means
Parameters
----------
fit : fit to mark bad
"""
if fit not in self.bad_fits:
self.bad_fits.append(fit)
return True
else:
return Fals... | [
"def",
"mark_fit_bad",
"(",
"self",
",",
"fit",
")",
":",
"if",
"fit",
"not",
"in",
"self",
".",
"bad_fits",
":",
"self",
".",
"bad_fits",
".",
"append",
"(",
"fit",
")",
"return",
"True",
"else",
":",
"return",
"False"
] | Marks fit bad so it is excluded from high level means
Parameters
----------
fit : fit to mark bad | [
"Marks",
"fit",
"bad",
"so",
"it",
"is",
"excluded",
"from",
"high",
"level",
"means"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L3843-L3855 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.get_data | def get_data(self):
"""
reads data from current WD measurement.txt or magic_measurements.txt
depending on data model and sorts it into main measurements data
structures given bellow:
Data - {specimen: {
zijdblock:[[treatment temp-str,dec-float, inc-float,
... | python | def get_data(self):
"""
reads data from current WD measurement.txt or magic_measurements.txt
depending on data model and sorts it into main measurements data
structures given bellow:
Data - {specimen: {
zijdblock:[[treatment temp-str,dec-float, inc-float,
... | [
"def",
"get_data",
"(",
"self",
")",
":",
"# ------------------------------------------------",
"# Read magic measurement file and sort to blocks",
"# ------------------------------------------------",
"# All meas data information is stored in Data[secimen]={}",
"Data",
"=",
"{",
"}",
"D... | reads data from current WD measurement.txt or magic_measurements.txt
depending on data model and sorts it into main measurements data
structures given bellow:
Data - {specimen: {
zijdblock:[[treatment temp-str,dec-float, inc-float,
mag_moment-float, ZI-flo... | [
"reads",
"data",
"from",
"current",
"WD",
"measurement",
".",
"txt",
"or",
"magic_measurements",
".",
"txt",
"depending",
"on",
"data",
"model",
"and",
"sorts",
"it",
"into",
"main",
"measurements",
"data",
"structures",
"given",
"bellow",
":",
"Data",
"-",
... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L3861-L4422 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.get_interpretations3 | def get_interpretations3(self):
"""
Used instead of update_pmag_tables in data model 3.0 to fetch
interpretations from contribution objects
"""
if "specimen" not in self.spec_data.columns or \
"meas_step_min" not in self.spec_data.columns or \
"meas_step_max... | python | def get_interpretations3(self):
"""
Used instead of update_pmag_tables in data model 3.0 to fetch
interpretations from contribution objects
"""
if "specimen" not in self.spec_data.columns or \
"meas_step_min" not in self.spec_data.columns or \
"meas_step_max... | [
"def",
"get_interpretations3",
"(",
"self",
")",
":",
"if",
"\"specimen\"",
"not",
"in",
"self",
".",
"spec_data",
".",
"columns",
"or",
"\"meas_step_min\"",
"not",
"in",
"self",
".",
"spec_data",
".",
"columns",
"or",
"\"meas_step_max\"",
"not",
"in",
"self",... | Used instead of update_pmag_tables in data model 3.0 to fetch
interpretations from contribution objects | [
"Used",
"instead",
"of",
"update_pmag_tables",
"in",
"data",
"model",
"3",
".",
"0",
"to",
"fetch",
"interpretations",
"from",
"contribution",
"objects"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L4424-L4495 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.get_data_info | def get_data_info(self):
"""
imports er tables and places data into Data_info data structure
outlined bellow:
Data_info - {er_samples: {er_samples.txt info}
er_sites: {er_sites.txt info}
er_locations: {er_locations.txt info}
... | python | def get_data_info(self):
"""
imports er tables and places data into Data_info data structure
outlined bellow:
Data_info - {er_samples: {er_samples.txt info}
er_sites: {er_sites.txt info}
er_locations: {er_locations.txt info}
... | [
"def",
"get_data_info",
"(",
"self",
")",
":",
"Data_info",
"=",
"{",
"}",
"data_er_samples",
"=",
"{",
"}",
"data_er_sites",
"=",
"{",
"}",
"data_er_locations",
"=",
"{",
"}",
"data_er_ages",
"=",
"{",
"}",
"if",
"self",
".",
"data_model",
"==",
"3.0",
... | imports er tables and places data into Data_info data structure
outlined bellow:
Data_info - {er_samples: {er_samples.txt info}
er_sites: {er_sites.txt info}
er_locations: {er_locations.txt info}
er_ages: {er_ages.txt info}} | [
"imports",
"er",
"tables",
"and",
"places",
"data",
"into",
"Data_info",
"data",
"structure",
"outlined",
"bellow",
":",
"Data_info",
"-",
"{",
"er_samples",
":",
"{",
"er_samples",
".",
"txt",
"info",
"}",
"er_sites",
":",
"{",
"er_sites",
".",
"txt",
"in... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L4497-L4630 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.get_preferences | def get_preferences(self):
"""
Gets preferences for certain display variables from
zeq_gui_preferences.
"""
# default
preferences = {}
preferences['gui_resolution'] = 100.
preferences['show_Zij_treatments'] = True
preferences['show_Zij_treatments_s... | python | def get_preferences(self):
"""
Gets preferences for certain display variables from
zeq_gui_preferences.
"""
# default
preferences = {}
preferences['gui_resolution'] = 100.
preferences['show_Zij_treatments'] = True
preferences['show_Zij_treatments_s... | [
"def",
"get_preferences",
"(",
"self",
")",
":",
"# default",
"preferences",
"=",
"{",
"}",
"preferences",
"[",
"'gui_resolution'",
"]",
"=",
"100.",
"preferences",
"[",
"'show_Zij_treatments'",
"]",
"=",
"True",
"preferences",
"[",
"'show_Zij_treatments_steps'",
... | Gets preferences for certain display variables from
zeq_gui_preferences. | [
"Gets",
"preferences",
"for",
"certain",
"display",
"variables",
"from",
"zeq_gui_preferences",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L4632-L4655 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.read_magic_file | def read_magic_file(self, path, sort_by_this_name):
"""
reads a magic formated data file from path and sorts the keys
according to sort_by_this_name
Parameters
----------
path : path to file to read
sort_by_this_name : variable to sort data by
"""
... | python | def read_magic_file(self, path, sort_by_this_name):
"""
reads a magic formated data file from path and sorts the keys
according to sort_by_this_name
Parameters
----------
path : path to file to read
sort_by_this_name : variable to sort data by
"""
... | [
"def",
"read_magic_file",
"(",
"self",
",",
"path",
",",
"sort_by_this_name",
")",
":",
"DATA",
"=",
"{",
"}",
"try",
":",
"with",
"open",
"(",
"path",
",",
"'r'",
")",
"as",
"finput",
":",
"lines",
"=",
"list",
"(",
"finput",
".",
"readlines",
"(",
... | reads a magic formated data file from path and sorts the keys
according to sort_by_this_name
Parameters
----------
path : path to file to read
sort_by_this_name : variable to sort data by | [
"reads",
"a",
"magic",
"formated",
"data",
"file",
"from",
"path",
"and",
"sorts",
"the",
"keys",
"according",
"to",
"sort_by_this_name"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L4657-L4693 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.read_from_LSQ | def read_from_LSQ(self, LSQ_file):
"""
Clears all current interpretations and replaces them with
interpretations read from LSQ file.
Parameters
----------
LSQ_file : path to LSQ file to read in
"""
cont = self.user_warning(
"LSQ import only wo... | python | def read_from_LSQ(self, LSQ_file):
"""
Clears all current interpretations and replaces them with
interpretations read from LSQ file.
Parameters
----------
LSQ_file : path to LSQ file to read in
"""
cont = self.user_warning(
"LSQ import only wo... | [
"def",
"read_from_LSQ",
"(",
"self",
",",
"LSQ_file",
")",
":",
"cont",
"=",
"self",
".",
"user_warning",
"(",
"\"LSQ import only works if all measurements are present and not averaged during import from magnetometer files to magic format. Do you wish to continue reading interpretations?... | Clears all current interpretations and replaces them with
interpretations read from LSQ file.
Parameters
----------
LSQ_file : path to LSQ file to read in | [
"Clears",
"all",
"current",
"interpretations",
"and",
"replaces",
"them",
"with",
"interpretations",
"read",
"from",
"LSQ",
"file",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L4695-L4744 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.read_redo_file | def read_redo_file(self, redo_file):
"""
Reads a .redo formated file and replaces all current interpretations
with interpretations taken from the .redo file
Parameters
----------
redo_file : path to .redo file to read
"""
if not self.clear_interpretations... | python | def read_redo_file(self, redo_file):
"""
Reads a .redo formated file and replaces all current interpretations
with interpretations taken from the .redo file
Parameters
----------
redo_file : path to .redo file to read
"""
if not self.clear_interpretations... | [
"def",
"read_redo_file",
"(",
"self",
",",
"redo_file",
")",
":",
"if",
"not",
"self",
".",
"clear_interpretations",
"(",
")",
":",
"return",
"print",
"(",
"\"-I- read redo file and processing new bounds\"",
")",
"fin",
"=",
"open",
"(",
"redo_file",
",",
"'r'",... | Reads a .redo formated file and replaces all current interpretations
with interpretations taken from the .redo file
Parameters
----------
redo_file : path to .redo file to read | [
"Reads",
"a",
".",
"redo",
"formated",
"file",
"and",
"replaces",
"all",
"current",
"interpretations",
"with",
"interpretations",
"taken",
"from",
"the",
".",
"redo",
"file"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L4746-L4799 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.change_WD | def change_WD(self, new_WD, meas_file=""):
"""
Changes Demag GUI's current WD to new_WD if possible
Parameters
----------
new_WD : WD to change to current GUI's WD
"""
new_WD = os.path.abspath(new_WD)
if not os.path.isdir(new_WD):
return
... | python | def change_WD(self, new_WD, meas_file=""):
"""
Changes Demag GUI's current WD to new_WD if possible
Parameters
----------
new_WD : WD to change to current GUI's WD
"""
new_WD = os.path.abspath(new_WD)
if not os.path.isdir(new_WD):
return
... | [
"def",
"change_WD",
"(",
"self",
",",
"new_WD",
",",
"meas_file",
"=",
"\"\"",
")",
":",
"new_WD",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"new_WD",
")",
"if",
"not",
"os",
".",
"path",
".",
"isdir",
"(",
"new_WD",
")",
":",
"return",
"self",
... | Changes Demag GUI's current WD to new_WD if possible
Parameters
----------
new_WD : WD to change to current GUI's WD | [
"Changes",
"Demag",
"GUI",
"s",
"current",
"WD",
"to",
"new_WD",
"if",
"possible"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L4801-L4849 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.init_log_file | def init_log_file(self):
"""
redirects stdout to a log file to prevent printing to a hanging
terminal when dealing with the compiled binary.
"""
# redirect terminal output
self.old_stdout = sys.stdout
sys.stdout = open(os.path.join(self.WD, "demag_gui.log"), 'w+') | python | def init_log_file(self):
"""
redirects stdout to a log file to prevent printing to a hanging
terminal when dealing with the compiled binary.
"""
# redirect terminal output
self.old_stdout = sys.stdout
sys.stdout = open(os.path.join(self.WD, "demag_gui.log"), 'w+') | [
"def",
"init_log_file",
"(",
"self",
")",
":",
"# redirect terminal output",
"self",
".",
"old_stdout",
"=",
"sys",
".",
"stdout",
"sys",
".",
"stdout",
"=",
"open",
"(",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"WD",
",",
"\"demag_gui.log\"",
"... | redirects stdout to a log file to prevent printing to a hanging
terminal when dealing with the compiled binary. | [
"redirects",
"stdout",
"to",
"a",
"log",
"file",
"to",
"prevent",
"printing",
"to",
"a",
"hanging",
"terminal",
"when",
"dealing",
"with",
"the",
"compiled",
"binary",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L4855-L4862 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.update_pmag_tables | def update_pmag_tables(self):
"""
Reads pmag tables from data model 2.5 and updates them with updates
their data
"""
pmag_specimens, pmag_samples, pmag_sites = [], [], []
print("-I- Reading previous interpretations from specimen/sample/site tables")
try:
... | python | def update_pmag_tables(self):
"""
Reads pmag tables from data model 2.5 and updates them with updates
their data
"""
pmag_specimens, pmag_samples, pmag_sites = [], [], []
print("-I- Reading previous interpretations from specimen/sample/site tables")
try:
... | [
"def",
"update_pmag_tables",
"(",
"self",
")",
":",
"pmag_specimens",
",",
"pmag_samples",
",",
"pmag_sites",
"=",
"[",
"]",
",",
"[",
"]",
",",
"[",
"]",
"print",
"(",
"\"-I- Reading previous interpretations from specimen/sample/site tables\"",
")",
"try",
":",
"... | Reads pmag tables from data model 2.5 and updates them with updates
their data | [
"Reads",
"pmag",
"tables",
"from",
"data",
"model",
"2",
".",
"5",
"and",
"updates",
"them",
"with",
"updates",
"their",
"data"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L4875-L5038 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.write_acceptance_criteria_to_file | def write_acceptance_criteria_to_file(self):
"""
Writes current GUI acceptance criteria to criteria.txt or
pmag_criteria.txt depending on data model
"""
crit_list = list(self.acceptance_criteria.keys())
crit_list.sort()
rec = {}
rec['pmag_criteria_code'] =... | python | def write_acceptance_criteria_to_file(self):
"""
Writes current GUI acceptance criteria to criteria.txt or
pmag_criteria.txt depending on data model
"""
crit_list = list(self.acceptance_criteria.keys())
crit_list.sort()
rec = {}
rec['pmag_criteria_code'] =... | [
"def",
"write_acceptance_criteria_to_file",
"(",
"self",
")",
":",
"crit_list",
"=",
"list",
"(",
"self",
".",
"acceptance_criteria",
".",
"keys",
"(",
")",
")",
"crit_list",
".",
"sort",
"(",
")",
"rec",
"=",
"{",
"}",
"rec",
"[",
"'pmag_criteria_code'",
... | Writes current GUI acceptance criteria to criteria.txt or
pmag_criteria.txt depending on data model | [
"Writes",
"current",
"GUI",
"acceptance",
"criteria",
"to",
"criteria",
".",
"txt",
"or",
"pmag_criteria",
".",
"txt",
"depending",
"on",
"data",
"model"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L5040-L5073 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.show_dlg | def show_dlg(self, dlg):
"""
Abstraction function that is to be used instead of dlg.ShowModal
Parameters
----------
dlg : dialog to ShowModal if possible
"""
if not self.test_mode:
dlg.Center()
return dlg.ShowModal()
else:
... | python | def show_dlg(self, dlg):
"""
Abstraction function that is to be used instead of dlg.ShowModal
Parameters
----------
dlg : dialog to ShowModal if possible
"""
if not self.test_mode:
dlg.Center()
return dlg.ShowModal()
else:
... | [
"def",
"show_dlg",
"(",
"self",
",",
"dlg",
")",
":",
"if",
"not",
"self",
".",
"test_mode",
":",
"dlg",
".",
"Center",
"(",
")",
"return",
"dlg",
".",
"ShowModal",
"(",
")",
"else",
":",
"return",
"dlg",
".",
"GetAffirmativeId",
"(",
")"
] | Abstraction function that is to be used instead of dlg.ShowModal
Parameters
----------
dlg : dialog to ShowModal if possible | [
"Abstraction",
"function",
"that",
"is",
"to",
"be",
"used",
"instead",
"of",
"dlg",
".",
"ShowModal"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L5079-L5091 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.get_DIR | def get_DIR(self):
"""
Dialog that allows user to choose a working directory
"""
dlg = wx.DirDialog(self, "Choose a directory:", defaultPath=self.currentDirectory,
style=wx.DD_DEFAULT_STYLE | wx.DD_NEW_DIR_BUTTON | wx.DD_CHANGE_DIR)
ok = self.show_dlg(d... | python | def get_DIR(self):
"""
Dialog that allows user to choose a working directory
"""
dlg = wx.DirDialog(self, "Choose a directory:", defaultPath=self.currentDirectory,
style=wx.DD_DEFAULT_STYLE | wx.DD_NEW_DIR_BUTTON | wx.DD_CHANGE_DIR)
ok = self.show_dlg(d... | [
"def",
"get_DIR",
"(",
"self",
")",
":",
"dlg",
"=",
"wx",
".",
"DirDialog",
"(",
"self",
",",
"\"Choose a directory:\"",
",",
"defaultPath",
"=",
"self",
".",
"currentDirectory",
",",
"style",
"=",
"wx",
".",
"DD_DEFAULT_STYLE",
"|",
"wx",
".",
"DD_NEW_DI... | Dialog that allows user to choose a working directory | [
"Dialog",
"that",
"allows",
"user",
"to",
"choose",
"a",
"working",
"directory"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L5093-L5106 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.choose_meas_file | def choose_meas_file(self, event=None):
"""
Opens a dialog allowing the user to pick a measurement file
"""
dlg = wx.FileDialog(
self, message="Please choose a measurement file",
defaultDir=self.WD,
defaultFile="measurements.txt",
wildcard=... | python | def choose_meas_file(self, event=None):
"""
Opens a dialog allowing the user to pick a measurement file
"""
dlg = wx.FileDialog(
self, message="Please choose a measurement file",
defaultDir=self.WD,
defaultFile="measurements.txt",
wildcard=... | [
"def",
"choose_meas_file",
"(",
"self",
",",
"event",
"=",
"None",
")",
":",
"dlg",
"=",
"wx",
".",
"FileDialog",
"(",
"self",
",",
"message",
"=",
"\"Please choose a measurement file\"",
",",
"defaultDir",
"=",
"self",
".",
"WD",
",",
"defaultFile",
"=",
... | Opens a dialog allowing the user to pick a measurement file | [
"Opens",
"a",
"dialog",
"allowing",
"the",
"user",
"to",
"pick",
"a",
"measurement",
"file"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L5108-L5126 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.saved_dlg | def saved_dlg(self, message, caption='Saved:'):
"""
Shows a dialog that tells the user that a file has been saved
Parameters
----------
message : message to display to user
caption : title for dialog (default: "Saved:")
"""
dlg = wx.MessageDialog(self, ca... | python | def saved_dlg(self, message, caption='Saved:'):
"""
Shows a dialog that tells the user that a file has been saved
Parameters
----------
message : message to display to user
caption : title for dialog (default: "Saved:")
"""
dlg = wx.MessageDialog(self, ca... | [
"def",
"saved_dlg",
"(",
"self",
",",
"message",
",",
"caption",
"=",
"'Saved:'",
")",
":",
"dlg",
"=",
"wx",
".",
"MessageDialog",
"(",
"self",
",",
"caption",
"=",
"caption",
",",
"message",
"=",
"message",
",",
"style",
"=",
"wx",
".",
"OK",
")",
... | Shows a dialog that tells the user that a file has been saved
Parameters
----------
message : message to display to user
caption : title for dialog (default: "Saved:") | [
"Shows",
"a",
"dialog",
"that",
"tells",
"the",
"user",
"that",
"a",
"file",
"has",
"been",
"saved"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L5128-L5140 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.user_warning | def user_warning(self, message, caption='Warning!'):
"""
Shows a dialog that warns the user about some action
Parameters
----------
message : message to display to user
caption : title for dialog (default: "Warning!")
Returns
-------
continue_boo... | python | def user_warning(self, message, caption='Warning!'):
"""
Shows a dialog that warns the user about some action
Parameters
----------
message : message to display to user
caption : title for dialog (default: "Warning!")
Returns
-------
continue_boo... | [
"def",
"user_warning",
"(",
"self",
",",
"message",
",",
"caption",
"=",
"'Warning!'",
")",
":",
"dlg",
"=",
"wx",
".",
"MessageDialog",
"(",
"self",
",",
"message",
",",
"caption",
",",
"wx",
".",
"OK",
"|",
"wx",
".",
"CANCEL",
"|",
"wx",
".",
"I... | Shows a dialog that warns the user about some action
Parameters
----------
message : message to display to user
caption : title for dialog (default: "Warning!")
Returns
-------
continue_bool : True or False | [
"Shows",
"a",
"dialog",
"that",
"warns",
"the",
"user",
"about",
"some",
"action"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L5142-L5162 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.on_close_criteria_box | def on_close_criteria_box(self, dia):
"""
Function called on close of change acceptance criteria dialog that
writes new criteria to the hardrive and sets new criteria as GUI's
current criteria.
Parameters
----------
dia : closed change criteria dialog
"""... | python | def on_close_criteria_box(self, dia):
"""
Function called on close of change acceptance criteria dialog that
writes new criteria to the hardrive and sets new criteria as GUI's
current criteria.
Parameters
----------
dia : closed change criteria dialog
"""... | [
"def",
"on_close_criteria_box",
"(",
"self",
",",
"dia",
")",
":",
"window_list_specimens",
"=",
"[",
"'specimen_n'",
",",
"'specimen_mad'",
",",
"'specimen_dang'",
",",
"'specimen_alpha95'",
"]",
"window_list_samples",
"=",
"[",
"'sample_n'",
",",
"'sample_n_lines'",... | Function called on close of change acceptance criteria dialog that
writes new criteria to the hardrive and sets new criteria as GUI's
current criteria.
Parameters
----------
dia : closed change criteria dialog | [
"Function",
"called",
"on",
"close",
"of",
"change",
"acceptance",
"criteria",
"dialog",
"that",
"writes",
"new",
"criteria",
"to",
"the",
"hardrive",
"and",
"sets",
"new",
"criteria",
"as",
"GUI",
"s",
"current",
"criteria",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L5171-L5249 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.show_crit_window_err_messege | def show_crit_window_err_messege(self, crit):
"""
error message if a valid naumber is not entered to criteria dialog
boxes
"""
dlg = wx.MessageDialog(
self, caption="Error:", message="not a vaild value for statistic %s\n ignoring value" % crit, style=wx.OK)
re... | python | def show_crit_window_err_messege(self, crit):
"""
error message if a valid naumber is not entered to criteria dialog
boxes
"""
dlg = wx.MessageDialog(
self, caption="Error:", message="not a vaild value for statistic %s\n ignoring value" % crit, style=wx.OK)
re... | [
"def",
"show_crit_window_err_messege",
"(",
"self",
",",
"crit",
")",
":",
"dlg",
"=",
"wx",
".",
"MessageDialog",
"(",
"self",
",",
"caption",
"=",
"\"Error:\"",
",",
"message",
"=",
"\"not a vaild value for statistic %s\\n ignoring value\"",
"%",
"crit",
",",
"s... | error message if a valid naumber is not entered to criteria dialog
boxes | [
"error",
"message",
"if",
"a",
"valid",
"naumber",
"is",
"not",
"entered",
"to",
"criteria",
"dialog",
"boxes"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L5251-L5260 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.On_close_MagIC_dialog | def On_close_MagIC_dialog(self, dia):
"""
Function called after save high level pmag table dialog. It
calculates VGPs, high level means, and saves them the hard drive.
Parameters
----------
dia : save higher level pmag tables
"""
def add_missing_ages(df)... | python | def On_close_MagIC_dialog(self, dia):
"""
Function called after save high level pmag table dialog. It
calculates VGPs, high level means, and saves them the hard drive.
Parameters
----------
dia : save higher level pmag tables
"""
def add_missing_ages(df)... | [
"def",
"On_close_MagIC_dialog",
"(",
"self",
",",
"dia",
")",
":",
"def",
"add_missing_ages",
"(",
"df",
")",
":",
"\"\"\"\n Take a dataframe and add min/max age, age, age_sigma, age_units.\n Use values gained from dialog, but don't overwrite values already\n ... | Function called after save high level pmag table dialog. It
calculates VGPs, high level means, and saves them the hard drive.
Parameters
----------
dia : save higher level pmag tables | [
"Function",
"called",
"after",
"save",
"high",
"level",
"pmag",
"table",
"dialog",
".",
"It",
"calculates",
"VGPs",
"high",
"level",
"means",
"and",
"saves",
"them",
"the",
"hard",
"drive",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L5262-L6042 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.update_selection | def update_selection(self):
"""
Convenience function update display (figures, text boxes and
statistics windows) with a new selection of specimen
"""
self.clear_boxes()
# commented out to allow propogation of higher level viewing state
self.clear_high_level_pars(... | python | def update_selection(self):
"""
Convenience function update display (figures, text boxes and
statistics windows) with a new selection of specimen
"""
self.clear_boxes()
# commented out to allow propogation of higher level viewing state
self.clear_high_level_pars(... | [
"def",
"update_selection",
"(",
"self",
")",
":",
"self",
".",
"clear_boxes",
"(",
")",
"# commented out to allow propogation of higher level viewing state",
"self",
".",
"clear_high_level_pars",
"(",
")",
"if",
"self",
".",
"UPPER_LEVEL_SHOW",
"!=",
"\"specimens\"",
":... | Convenience function update display (figures, text boxes and
statistics windows) with a new selection of specimen | [
"Convenience",
"function",
"update",
"display",
"(",
"figures",
"text",
"boxes",
"and",
"statistics",
"windows",
")",
"with",
"a",
"new",
"selection",
"of",
"specimen"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L6067-L6153 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.update_warning_box | def update_warning_box(self):
"""
updates the warning box with whatever the warning_text variable
contains for this specimen
"""
self.warning_box.Clear()
if self.warning_text == "":
self.warning_box.AppendText("No Problems")
else:
self.warn... | python | def update_warning_box(self):
"""
updates the warning box with whatever the warning_text variable
contains for this specimen
"""
self.warning_box.Clear()
if self.warning_text == "":
self.warning_box.AppendText("No Problems")
else:
self.warn... | [
"def",
"update_warning_box",
"(",
"self",
")",
":",
"self",
".",
"warning_box",
".",
"Clear",
"(",
")",
"if",
"self",
".",
"warning_text",
"==",
"\"\"",
":",
"self",
".",
"warning_box",
".",
"AppendText",
"(",
"\"No Problems\"",
")",
"else",
":",
"self",
... | updates the warning box with whatever the warning_text variable
contains for this specimen | [
"updates",
"the",
"warning",
"box",
"with",
"whatever",
"the",
"warning_text",
"variable",
"contains",
"for",
"this",
"specimen"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L6155-L6164 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.update_GUI_with_new_interpretation | def update_GUI_with_new_interpretation(self):
"""
update statistics boxes and figures with a new interpretatiom when
selecting new temperature bound
"""
self.update_fit_bounds_and_statistics()
self.draw_interpretations()
self.calculate_high_levels_data()
... | python | def update_GUI_with_new_interpretation(self):
"""
update statistics boxes and figures with a new interpretatiom when
selecting new temperature bound
"""
self.update_fit_bounds_and_statistics()
self.draw_interpretations()
self.calculate_high_levels_data()
... | [
"def",
"update_GUI_with_new_interpretation",
"(",
"self",
")",
":",
"self",
".",
"update_fit_bounds_and_statistics",
"(",
")",
"self",
".",
"draw_interpretations",
"(",
")",
"self",
".",
"calculate_high_levels_data",
"(",
")",
"self",
".",
"plot_high_levels_data",
"("... | update statistics boxes and figures with a new interpretatiom when
selecting new temperature bound | [
"update",
"statistics",
"boxes",
"and",
"figures",
"with",
"a",
"new",
"interpretatiom",
"when",
"selecting",
"new",
"temperature",
"bound"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L6166-L6175 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.update_high_level_stats | def update_high_level_stats(self):
"""
updates high level statistics in bottom left of GUI.
"""
self.clear_high_level_pars()
dirtype = str(self.coordinates_box.GetValue())
if dirtype == 'specimen':
dirtype = 'DA-DIR'
elif dirtype == 'geographic':
... | python | def update_high_level_stats(self):
"""
updates high level statistics in bottom left of GUI.
"""
self.clear_high_level_pars()
dirtype = str(self.coordinates_box.GetValue())
if dirtype == 'specimen':
dirtype = 'DA-DIR'
elif dirtype == 'geographic':
... | [
"def",
"update_high_level_stats",
"(",
"self",
")",
":",
"self",
".",
"clear_high_level_pars",
"(",
")",
"dirtype",
"=",
"str",
"(",
"self",
".",
"coordinates_box",
".",
"GetValue",
"(",
")",
")",
"if",
"dirtype",
"==",
"'specimen'",
":",
"dirtype",
"=",
"... | updates high level statistics in bottom left of GUI. | [
"updates",
"high",
"level",
"statistics",
"in",
"bottom",
"left",
"of",
"GUI",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L6251-L6302 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.update_bounds_boxes | def update_bounds_boxes(self):
"""
updates bounds boxes with bounds of current specimen and fit
"""
if self.s not in list(self.Data.keys()):
self.select_specimen(list(self.Data.keys())[0])
self.T_list = self.Data[self.s]['zijdblock_steps']
if self.current_fit:... | python | def update_bounds_boxes(self):
"""
updates bounds boxes with bounds of current specimen and fit
"""
if self.s not in list(self.Data.keys()):
self.select_specimen(list(self.Data.keys())[0])
self.T_list = self.Data[self.s]['zijdblock_steps']
if self.current_fit:... | [
"def",
"update_bounds_boxes",
"(",
"self",
")",
":",
"if",
"self",
".",
"s",
"not",
"in",
"list",
"(",
"self",
".",
"Data",
".",
"keys",
"(",
")",
")",
":",
"self",
".",
"select_specimen",
"(",
"list",
"(",
"self",
".",
"Data",
".",
"keys",
"(",
... | updates bounds boxes with bounds of current specimen and fit | [
"updates",
"bounds",
"boxes",
"with",
"bounds",
"of",
"current",
"specimen",
"and",
"fit"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L6304-L6318 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.update_PCA_box | def update_PCA_box(self):
"""
updates PCA box with current fit's PCA type
"""
if self.s in list(self.pmag_results_data['specimens'].keys()):
if self.current_fit:
tmin = self.current_fit.tmin
tmax = self.current_fit.tmax
calcula... | python | def update_PCA_box(self):
"""
updates PCA box with current fit's PCA type
"""
if self.s in list(self.pmag_results_data['specimens'].keys()):
if self.current_fit:
tmin = self.current_fit.tmin
tmax = self.current_fit.tmax
calcula... | [
"def",
"update_PCA_box",
"(",
"self",
")",
":",
"if",
"self",
".",
"s",
"in",
"list",
"(",
"self",
".",
"pmag_results_data",
"[",
"'specimens'",
"]",
".",
"keys",
"(",
")",
")",
":",
"if",
"self",
".",
"current_fit",
":",
"tmin",
"=",
"self",
".",
... | updates PCA box with current fit's PCA type | [
"updates",
"PCA",
"box",
"with",
"current",
"fit",
"s",
"PCA",
"type"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L6320-L6348 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.update_fit_boxes | def update_fit_boxes(self, new_fit=False):
"""
alters fit_box and mean_fit_box lists to match with changes in
specimen or new/removed interpretations
Parameters
----------
new_fit : boolean representing if there is a new fit
Alters
------
fit_box... | python | def update_fit_boxes(self, new_fit=False):
"""
alters fit_box and mean_fit_box lists to match with changes in
specimen or new/removed interpretations
Parameters
----------
new_fit : boolean representing if there is a new fit
Alters
------
fit_box... | [
"def",
"update_fit_boxes",
"(",
"self",
",",
"new_fit",
"=",
"False",
")",
":",
"# update the fit box",
"self",
".",
"update_fit_box",
"(",
"new_fit",
")",
"# select new fit",
"self",
".",
"on_select_fit",
"(",
"None",
")",
"# update the high level fits box",
"self"... | alters fit_box and mean_fit_box lists to match with changes in
specimen or new/removed interpretations
Parameters
----------
new_fit : boolean representing if there is a new fit
Alters
------
fit_box selection, tmin_box selection, tmax_box selection,
mea... | [
"alters",
"fit_box",
"and",
"mean_fit_box",
"lists",
"to",
"match",
"with",
"changes",
"in",
"specimen",
"or",
"new",
"/",
"removed",
"interpretations"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L6350-L6369 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.update_fit_box | def update_fit_box(self, new_fit=False):
"""
alters fit_box lists to match with changes in specimen or new/
removed interpretations
Parameters
----------
new_fit : boolean representing if there is a new fit
Alters
------
fit_box selection and cho... | python | def update_fit_box(self, new_fit=False):
"""
alters fit_box lists to match with changes in specimen or new/
removed interpretations
Parameters
----------
new_fit : boolean representing if there is a new fit
Alters
------
fit_box selection and cho... | [
"def",
"update_fit_box",
"(",
"self",
",",
"new_fit",
"=",
"False",
")",
":",
"# get new fit data",
"if",
"self",
".",
"s",
"in",
"list",
"(",
"self",
".",
"pmag_results_data",
"[",
"'specimens'",
"]",
".",
"keys",
"(",
")",
")",
":",
"self",
".",
"fit... | alters fit_box lists to match with changes in specimen or new/
removed interpretations
Parameters
----------
new_fit : boolean representing if there is a new fit
Alters
------
fit_box selection and choices, current_fit | [
"alters",
"fit_box",
"lists",
"to",
"match",
"with",
"changes",
"in",
"specimen",
"or",
"new",
"/",
"removed",
"interpretations"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L6371-L6409 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.update_mean_fit_box | def update_mean_fit_box(self):
"""
alters mean_fit_box list to match with changes in specimen or new/
removed interpretations
Alters
------
mean_fit_box selection and choices, mean_types_box string selection
"""
self.mean_fit_box.Clear()
# update ... | python | def update_mean_fit_box(self):
"""
alters mean_fit_box list to match with changes in specimen or new/
removed interpretations
Alters
------
mean_fit_box selection and choices, mean_types_box string selection
"""
self.mean_fit_box.Clear()
# update ... | [
"def",
"update_mean_fit_box",
"(",
"self",
")",
":",
"self",
".",
"mean_fit_box",
".",
"Clear",
"(",
")",
"# update high level mean fit box",
"fit_index",
"=",
"None",
"if",
"self",
".",
"mean_fit",
"in",
"self",
".",
"all_fits_list",
":",
"fit_index",
"=",
"s... | alters mean_fit_box list to match with changes in specimen or new/
removed interpretations
Alters
------
mean_fit_box selection and choices, mean_types_box string selection | [
"alters",
"mean_fit_box",
"list",
"to",
"match",
"with",
"changes",
"in",
"specimen",
"or",
"new",
"/",
"removed",
"interpretations"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L6411-L6451 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.show_high_levels_pars | def show_high_levels_pars(self, mpars):
"""
shows in the high level mean display area in the bottom left of the
GUI the data in mpars.
"""
FONT_WEIGHT = self.GUI_RESOLUTION+(self.GUI_RESOLUTION-1)*5
font2 = wx.Font(12+min(1, FONT_WEIGHT), wx.SWISS,
... | python | def show_high_levels_pars(self, mpars):
"""
shows in the high level mean display area in the bottom left of the
GUI the data in mpars.
"""
FONT_WEIGHT = self.GUI_RESOLUTION+(self.GUI_RESOLUTION-1)*5
font2 = wx.Font(12+min(1, FONT_WEIGHT), wx.SWISS,
... | [
"def",
"show_high_levels_pars",
"(",
"self",
",",
"mpars",
")",
":",
"FONT_WEIGHT",
"=",
"self",
".",
"GUI_RESOLUTION",
"+",
"(",
"self",
".",
"GUI_RESOLUTION",
"-",
"1",
")",
"*",
"5",
"font2",
"=",
"wx",
".",
"Font",
"(",
"12",
"+",
"min",
"(",
"1"... | shows in the high level mean display area in the bottom left of the
GUI the data in mpars. | [
"shows",
"in",
"the",
"high",
"level",
"mean",
"display",
"area",
"in",
"the",
"bottom",
"left",
"of",
"the",
"GUI",
"the",
"data",
"in",
"mpars",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L6466-L6538 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.clear_boxes | def clear_boxes(self):
"""
Clear all boxes
"""
self.tmin_box.Clear()
self.tmin_box.SetStringSelection("")
if self.current_fit:
self.tmin_box.SetItems(self.T_list)
self.tmin_box.SetSelection(-1)
self.tmax_box.Clear()
self.tmax_box.S... | python | def clear_boxes(self):
"""
Clear all boxes
"""
self.tmin_box.Clear()
self.tmin_box.SetStringSelection("")
if self.current_fit:
self.tmin_box.SetItems(self.T_list)
self.tmin_box.SetSelection(-1)
self.tmax_box.Clear()
self.tmax_box.S... | [
"def",
"clear_boxes",
"(",
"self",
")",
":",
"self",
".",
"tmin_box",
".",
"Clear",
"(",
")",
"self",
".",
"tmin_box",
".",
"SetStringSelection",
"(",
"\"\"",
")",
"if",
"self",
".",
"current_fit",
":",
"self",
".",
"tmin_box",
".",
"SetItems",
"(",
"s... | Clear all boxes | [
"Clear",
"all",
"boxes"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L6555-L6581 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.clear_high_level_pars | def clear_high_level_pars(self):
"""
clears all high level pars display boxes
"""
for val in ['mean_type', 'dec', 'inc', 'alpha95', 'K', 'R', 'n_lines', 'n_planes']:
COMMAND = """self.%s_window.SetValue("")""" % (val)
exec(COMMAND)
if self.ie_open:
... | python | def clear_high_level_pars(self):
"""
clears all high level pars display boxes
"""
for val in ['mean_type', 'dec', 'inc', 'alpha95', 'K', 'R', 'n_lines', 'n_planes']:
COMMAND = """self.%s_window.SetValue("")""" % (val)
exec(COMMAND)
if self.ie_open:
... | [
"def",
"clear_high_level_pars",
"(",
"self",
")",
":",
"for",
"val",
"in",
"[",
"'mean_type'",
",",
"'dec'",
",",
"'inc'",
",",
"'alpha95'",
",",
"'K'",
",",
"'R'",
",",
"'n_lines'",
",",
"'n_planes'",
"]",
":",
"COMMAND",
"=",
"\"\"\"self.%s_window.SetValue... | clears all high level pars display boxes | [
"clears",
"all",
"high",
"level",
"pars",
"display",
"boxes"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L6583-L6594 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.on_menu_make_MagIC_results_tables | def on_menu_make_MagIC_results_tables(self, event):
"""
Creates or Updates Specimens or Pmag Specimens MagIC table,
overwrites .redo file for safety, and starts User dialog to
generate other MagIC tables for later contribution to the MagIC
database. The following describes th... | python | def on_menu_make_MagIC_results_tables(self, event):
"""
Creates or Updates Specimens or Pmag Specimens MagIC table,
overwrites .redo file for safety, and starts User dialog to
generate other MagIC tables for later contribution to the MagIC
database. The following describes th... | [
"def",
"on_menu_make_MagIC_results_tables",
"(",
"self",
",",
"event",
")",
":",
"# ---------------------------------------",
"# save pmag_*.txt.tmp without directional data",
"# ---------------------------------------",
"self",
".",
"on_menu_save_interpretation",
"(",
"None",
")",
... | Creates or Updates Specimens or Pmag Specimens MagIC table,
overwrites .redo file for safety, and starts User dialog to
generate other MagIC tables for later contribution to the MagIC
database. The following describes the steps used in the 2.5 data
format to do this:
1. rea... | [
"Creates",
"or",
"Updates",
"Specimens",
"or",
"Pmag",
"Specimens",
"MagIC",
"table",
"overwrites",
".",
"redo",
"file",
"for",
"safety",
"and",
"starts",
"User",
"dialog",
"to",
"generate",
"other",
"MagIC",
"tables",
"for",
"later",
"contribution",
"to",
"th... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L6630-L6929 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.on_menu_import_meas_file | def on_menu_import_meas_file(self, event):
"""
Open measurement file, reset self.magic_file
and self.WD, and reset everything.
"""
# use new measurement file and corresponding WD
meas_file = self.choose_meas_file()
WD = os.path.split(meas_file)[0]
self.WD ... | python | def on_menu_import_meas_file(self, event):
"""
Open measurement file, reset self.magic_file
and self.WD, and reset everything.
"""
# use new measurement file and corresponding WD
meas_file = self.choose_meas_file()
WD = os.path.split(meas_file)[0]
self.WD ... | [
"def",
"on_menu_import_meas_file",
"(",
"self",
",",
"event",
")",
":",
"# use new measurement file and corresponding WD",
"meas_file",
"=",
"self",
".",
"choose_meas_file",
"(",
")",
"WD",
"=",
"os",
".",
"path",
".",
"split",
"(",
"meas_file",
")",
"[",
"0",
... | Open measurement file, reset self.magic_file
and self.WD, and reset everything. | [
"Open",
"measurement",
"file",
"reset",
"self",
".",
"magic_file",
"and",
"self",
".",
"WD",
"and",
"reset",
"everything",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L7018-L7029 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.on_menu_criteria_file | def on_menu_criteria_file(self, event):
"""
read pmag_criteria.txt file
and open changecriteria dialog
"""
if self.data_model == 3:
default_file = "criteria.txt"
else:
default_file = "pmag_criteria.txt"
read_sucsess = False
dlg = wx... | python | def on_menu_criteria_file(self, event):
"""
read pmag_criteria.txt file
and open changecriteria dialog
"""
if self.data_model == 3:
default_file = "criteria.txt"
else:
default_file = "pmag_criteria.txt"
read_sucsess = False
dlg = wx... | [
"def",
"on_menu_criteria_file",
"(",
"self",
",",
"event",
")",
":",
"if",
"self",
".",
"data_model",
"==",
"3",
":",
"default_file",
"=",
"\"criteria.txt\"",
"else",
":",
"default_file",
"=",
"\"pmag_criteria.txt\"",
"read_sucsess",
"=",
"False",
"dlg",
"=",
... | read pmag_criteria.txt file
and open changecriteria dialog | [
"read",
"pmag_criteria",
".",
"txt",
"file",
"and",
"open",
"changecriteria",
"dialog"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L7281-L7319 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.right_click_zijderveld | def right_click_zijderveld(self, event):
"""
toggles between zoom and pan effects for the zijderveld on right
click
Parameters
----------
event : the wx.MouseEvent that triggered the call of this function
Alters
------
zijderveld_setting, toolbar... | python | def right_click_zijderveld(self, event):
"""
toggles between zoom and pan effects for the zijderveld on right
click
Parameters
----------
event : the wx.MouseEvent that triggered the call of this function
Alters
------
zijderveld_setting, toolbar... | [
"def",
"right_click_zijderveld",
"(",
"self",
",",
"event",
")",
":",
"if",
"event",
".",
"LeftIsDown",
"(",
")",
"or",
"event",
".",
"ButtonDClick",
"(",
")",
":",
"return",
"elif",
"self",
".",
"zijderveld_setting",
"==",
"\"Zoom\"",
":",
"self",
".",
... | toggles between zoom and pan effects for the zijderveld on right
click
Parameters
----------
event : the wx.MouseEvent that triggered the call of this function
Alters
------
zijderveld_setting, toolbar1 setting | [
"toggles",
"between",
"zoom",
"and",
"pan",
"effects",
"for",
"the",
"zijderveld",
"on",
"right",
"click"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L7511-L7537 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.on_change_zijd_mouse_cursor | def on_change_zijd_mouse_cursor(self, event):
"""
If mouse is over data point making it selectable change the shape of
the cursor
Parameters
----------
event : the wx Mouseevent for that click
"""
if not array(self.CART_rot).any():
return
... | python | def on_change_zijd_mouse_cursor(self, event):
"""
If mouse is over data point making it selectable change the shape of
the cursor
Parameters
----------
event : the wx Mouseevent for that click
"""
if not array(self.CART_rot).any():
return
... | [
"def",
"on_change_zijd_mouse_cursor",
"(",
"self",
",",
"event",
")",
":",
"if",
"not",
"array",
"(",
"self",
".",
"CART_rot",
")",
".",
"any",
"(",
")",
":",
"return",
"pos",
"=",
"event",
".",
"GetPosition",
"(",
")",
"width",
",",
"height",
"=",
"... | If mouse is over data point making it selectable change the shape of
the cursor
Parameters
----------
event : the wx Mouseevent for that click | [
"If",
"mouse",
"is",
"over",
"data",
"point",
"making",
"it",
"selectable",
"change",
"the",
"shape",
"of",
"the",
"cursor"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L7557-L7589 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.on_zijd_select | def on_zijd_select(self, event):
"""
Get mouse position on double click find the nearest interpretation
to the mouse
position then select that interpretation
Parameters
----------
event : the wx Mouseevent for that click
Alters
------
cur... | python | def on_zijd_select(self, event):
"""
Get mouse position on double click find the nearest interpretation
to the mouse
position then select that interpretation
Parameters
----------
event : the wx Mouseevent for that click
Alters
------
cur... | [
"def",
"on_zijd_select",
"(",
"self",
",",
"event",
")",
":",
"if",
"not",
"array",
"(",
"self",
".",
"CART_rot_good",
")",
".",
"any",
"(",
")",
":",
"return",
"pos",
"=",
"event",
".",
"GetPosition",
"(",
")",
"width",
",",
"height",
"=",
"self",
... | Get mouse position on double click find the nearest interpretation
to the mouse
position then select that interpretation
Parameters
----------
event : the wx Mouseevent for that click
Alters
------
current_fit | [
"Get",
"mouse",
"position",
"on",
"double",
"click",
"find",
"the",
"nearest",
"interpretation",
"to",
"the",
"mouse",
"position",
"then",
"select",
"that",
"interpretation"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L7591-L7635 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.on_zijd_mark | def on_zijd_mark(self, event):
"""
Get mouse position on double right click find the interpretation in
range of mouse
position then mark that interpretation bad or good
Parameters
----------
event : the wx Mouseevent for that click
Alters
------
... | python | def on_zijd_mark(self, event):
"""
Get mouse position on double right click find the interpretation in
range of mouse
position then mark that interpretation bad or good
Parameters
----------
event : the wx Mouseevent for that click
Alters
------
... | [
"def",
"on_zijd_mark",
"(",
"self",
",",
"event",
")",
":",
"if",
"not",
"array",
"(",
"self",
".",
"CART_rot",
")",
".",
"any",
"(",
")",
":",
"return",
"pos",
"=",
"event",
".",
"GetPosition",
"(",
")",
"width",
",",
"height",
"=",
"self",
".",
... | Get mouse position on double right click find the interpretation in
range of mouse
position then mark that interpretation bad or good
Parameters
----------
event : the wx Mouseevent for that click
Alters
------
current_fit | [
"Get",
"mouse",
"position",
"on",
"double",
"right",
"click",
"find",
"the",
"interpretation",
"in",
"range",
"of",
"mouse",
"position",
"then",
"mark",
"that",
"interpretation",
"bad",
"or",
"good"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L7637-L7685 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.right_click_specimen_equalarea | def right_click_specimen_equalarea(self, event):
"""
toggles between zoom and pan effects for the specimen equal area on
right click
Parameters
----------
event : the wx.MouseEvent that triggered the call of this function
Alters
------
specimen_E... | python | def right_click_specimen_equalarea(self, event):
"""
toggles between zoom and pan effects for the specimen equal area on
right click
Parameters
----------
event : the wx.MouseEvent that triggered the call of this function
Alters
------
specimen_E... | [
"def",
"right_click_specimen_equalarea",
"(",
"self",
",",
"event",
")",
":",
"if",
"event",
".",
"LeftIsDown",
"(",
")",
"or",
"event",
".",
"ButtonDClick",
"(",
")",
":",
"return",
"elif",
"self",
".",
"specimen_EA_setting",
"==",
"\"Zoom\"",
":",
"self",
... | toggles between zoom and pan effects for the specimen equal area on
right click
Parameters
----------
event : the wx.MouseEvent that triggered the call of this function
Alters
------
specimen_EA_setting, toolbar2 setting | [
"toggles",
"between",
"zoom",
"and",
"pan",
"effects",
"for",
"the",
"specimen",
"equal",
"area",
"on",
"right",
"click"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L7687-L7713 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.on_change_specimen_mouse_cursor | def on_change_specimen_mouse_cursor(self, event):
"""
If mouse is over data point making it selectable change the shape of
the cursor
Parameters
----------
event : the wx Mouseevent for that click
"""
if not self.specimen_EA_xdata or not self.specimen_EA_... | python | def on_change_specimen_mouse_cursor(self, event):
"""
If mouse is over data point making it selectable change the shape of
the cursor
Parameters
----------
event : the wx Mouseevent for that click
"""
if not self.specimen_EA_xdata or not self.specimen_EA_... | [
"def",
"on_change_specimen_mouse_cursor",
"(",
"self",
",",
"event",
")",
":",
"if",
"not",
"self",
".",
"specimen_EA_xdata",
"or",
"not",
"self",
".",
"specimen_EA_ydata",
":",
"return",
"pos",
"=",
"event",
".",
"GetPosition",
"(",
")",
"width",
",",
"heig... | If mouse is over data point making it selectable change the shape of
the cursor
Parameters
----------
event : the wx Mouseevent for that click | [
"If",
"mouse",
"is",
"over",
"data",
"point",
"making",
"it",
"selectable",
"change",
"the",
"shape",
"of",
"the",
"cursor"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L7729-L7761 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.on_equalarea_specimen_select | def on_equalarea_specimen_select(self, event):
"""
Get mouse position on double click find the nearest interpretation
to the mouse
position then select that interpretation
Parameters
----------
event : the wx Mouseevent for that click
Alters
----... | python | def on_equalarea_specimen_select(self, event):
"""
Get mouse position on double click find the nearest interpretation
to the mouse
position then select that interpretation
Parameters
----------
event : the wx Mouseevent for that click
Alters
----... | [
"def",
"on_equalarea_specimen_select",
"(",
"self",
",",
"event",
")",
":",
"if",
"not",
"self",
".",
"specimen_EA_xdata",
"or",
"not",
"self",
".",
"specimen_EA_ydata",
":",
"return",
"pos",
"=",
"event",
".",
"GetPosition",
"(",
")",
"width",
",",
"height"... | Get mouse position on double click find the nearest interpretation
to the mouse
position then select that interpretation
Parameters
----------
event : the wx Mouseevent for that click
Alters
------
current_fit | [
"Get",
"mouse",
"position",
"on",
"double",
"click",
"find",
"the",
"nearest",
"interpretation",
"to",
"the",
"mouse",
"position",
"then",
"select",
"that",
"interpretation"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L7763-L7800 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.right_click_high_equalarea | def right_click_high_equalarea(self, event):
"""
toggles between zoom and pan effects for the high equal area on
right click
Parameters
----------
event : the wx.MouseEvent that triggered the call of this function
Alters
------
high_EA_setting, t... | python | def right_click_high_equalarea(self, event):
"""
toggles between zoom and pan effects for the high equal area on
right click
Parameters
----------
event : the wx.MouseEvent that triggered the call of this function
Alters
------
high_EA_setting, t... | [
"def",
"right_click_high_equalarea",
"(",
"self",
",",
"event",
")",
":",
"if",
"event",
".",
"LeftIsDown",
"(",
")",
":",
"return",
"elif",
"self",
".",
"high_EA_setting",
"==",
"\"Zoom\"",
":",
"self",
".",
"high_EA_setting",
"=",
"\"Pan\"",
"try",
":",
... | toggles between zoom and pan effects for the high equal area on
right click
Parameters
----------
event : the wx.MouseEvent that triggered the call of this function
Alters
------
high_EA_setting, toolbar4 setting | [
"toggles",
"between",
"zoom",
"and",
"pan",
"effects",
"for",
"the",
"high",
"equal",
"area",
"on",
"right",
"click"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L7802-L7828 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.on_change_high_mouse_cursor | def on_change_high_mouse_cursor(self, event):
"""
If mouse is over data point making it selectable change the shape of
the cursor
Parameters
----------
event : the wx Mouseevent for that click
"""
if self.ie_open and self.ie.show_box.GetValue() != "specim... | python | def on_change_high_mouse_cursor(self, event):
"""
If mouse is over data point making it selectable change the shape of
the cursor
Parameters
----------
event : the wx Mouseevent for that click
"""
if self.ie_open and self.ie.show_box.GetValue() != "specim... | [
"def",
"on_change_high_mouse_cursor",
"(",
"self",
",",
"event",
")",
":",
"if",
"self",
".",
"ie_open",
"and",
"self",
".",
"ie",
".",
"show_box",
".",
"GetValue",
"(",
")",
"!=",
"\"specimens\"",
":",
"return",
"pos",
"=",
"event",
".",
"GetPosition",
... | If mouse is over data point making it selectable change the shape of
the cursor
Parameters
----------
event : the wx Mouseevent for that click | [
"If",
"mouse",
"is",
"over",
"data",
"point",
"making",
"it",
"selectable",
"change",
"the",
"shape",
"of",
"the",
"cursor"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L7844-L7878 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.on_equalarea_high_select | def on_equalarea_high_select(self, event, fig=None, canvas=None):
"""
Get mouse position on double click find the nearest interpretation
to the mouse position then select that interpretation
Parameters
----------
event : the wx Mouseevent for that click
Alters
... | python | def on_equalarea_high_select(self, event, fig=None, canvas=None):
"""
Get mouse position on double click find the nearest interpretation
to the mouse position then select that interpretation
Parameters
----------
event : the wx Mouseevent for that click
Alters
... | [
"def",
"on_equalarea_high_select",
"(",
"self",
",",
"event",
",",
"fig",
"=",
"None",
",",
"canvas",
"=",
"None",
")",
":",
"if",
"self",
".",
"ie_open",
"and",
"self",
".",
"ie",
".",
"show_box",
".",
"GetValue",
"(",
")",
"!=",
"\"specimens\"",
":",... | Get mouse position on double click find the nearest interpretation
to the mouse position then select that interpretation
Parameters
----------
event : the wx Mouseevent for that click
Alters
------
current_fit, s, mean_fit, fit_box selection, mean_fit_box select... | [
"Get",
"mouse",
"position",
"on",
"double",
"click",
"find",
"the",
"nearest",
"interpretation",
"to",
"the",
"mouse",
"position",
"then",
"select",
"that",
"interpretation"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L7880-L7981 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.Add_text | def Add_text(self):
"""
Add measurement data lines to the text window.
"""
self.selected_meas = []
if self.COORDINATE_SYSTEM == 'geographic':
zijdblock = self.Data[self.s]['zijdblock_geo']
elif self.COORDINATE_SYSTEM == 'tilt-corrected':
zijdblock ... | python | def Add_text(self):
"""
Add measurement data lines to the text window.
"""
self.selected_meas = []
if self.COORDINATE_SYSTEM == 'geographic':
zijdblock = self.Data[self.s]['zijdblock_geo']
elif self.COORDINATE_SYSTEM == 'tilt-corrected':
zijdblock ... | [
"def",
"Add_text",
"(",
"self",
")",
":",
"self",
".",
"selected_meas",
"=",
"[",
"]",
"if",
"self",
".",
"COORDINATE_SYSTEM",
"==",
"'geographic'",
":",
"zijdblock",
"=",
"self",
".",
"Data",
"[",
"self",
".",
"s",
"]",
"[",
"'zijdblock_geo'",
"]",
"e... | Add measurement data lines to the text window. | [
"Add",
"measurement",
"data",
"lines",
"to",
"the",
"text",
"window",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L7998-L8048 |
PmagPy/PmagPy | programs/demag_gui.py | Demag_GUI.select_bounds_in_logger | def select_bounds_in_logger(self, index):
"""
sets index as the upper or lower bound of a fit based on what the
other bound is and selects it in the logger. Requires 2 calls to
completely update a interpretation. NOTE: Requires an interpretation
to exist before it is called.
... | python | def select_bounds_in_logger(self, index):
"""
sets index as the upper or lower bound of a fit based on what the
other bound is and selects it in the logger. Requires 2 calls to
completely update a interpretation. NOTE: Requires an interpretation
to exist before it is called.
... | [
"def",
"select_bounds_in_logger",
"(",
"self",
",",
"index",
")",
":",
"tmin_index",
",",
"tmax_index",
"=",
"\"\"",
",",
"\"\"",
"if",
"str",
"(",
"self",
".",
"tmin_box",
".",
"GetValue",
"(",
")",
")",
"!=",
"\"\"",
":",
"tmin_index",
"=",
"self",
"... | sets index as the upper or lower bound of a fit based on what the
other bound is and selects it in the logger. Requires 2 calls to
completely update a interpretation. NOTE: Requires an interpretation
to exist before it is called.
Parameters
----------
index : index of th... | [
"sets",
"index",
"as",
"the",
"upper",
"or",
"lower",
"bound",
"of",
"a",
"fit",
"based",
"on",
"what",
"the",
"other",
"bound",
"is",
"and",
"selects",
"it",
"in",
"the",
"logger",
".",
"Requires",
"2",
"calls",
"to",
"completely",
"update",
"a",
"int... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L8059-L8113 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.