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
programs/demag_gui.py
Demag_GUI.on_right_click_listctrl
def on_right_click_listctrl(self, event): """ right click on the listctrl toggles measurement bad """ g_index = event.GetIndex() if self.Data[self.s]['measurement_flag'][g_index] == 'g': self.mark_meas_bad(g_index) else: self.mark_meas_good(g_inde...
python
def on_right_click_listctrl(self, event): """ right click on the listctrl toggles measurement bad """ g_index = event.GetIndex() if self.Data[self.s]['measurement_flag'][g_index] == 'g': self.mark_meas_bad(g_index) else: self.mark_meas_good(g_inde...
[ "def", "on_right_click_listctrl", "(", "self", ",", "event", ")", ":", "g_index", "=", "event", ".", "GetIndex", "(", ")", "if", "self", ".", "Data", "[", "self", ".", "s", "]", "[", "'measurement_flag'", "]", "[", "g_index", "]", "==", "'g'", ":", "...
right click on the listctrl toggles measurement bad
[ "right", "click", "on", "the", "listctrl", "toggles", "measurement", "bad" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L8115-L8137
PmagPy/PmagPy
programs/demag_gui.py
Demag_GUI.onSelect_specimen
def onSelect_specimen(self, event): """ update figures and text when a new specimen is selected """ self.selected_meas = [] self.select_specimen(str(self.specimens_box.GetValue())) if self.ie_open: self.ie.change_selected(self.current_fit) self.update_...
python
def onSelect_specimen(self, event): """ update figures and text when a new specimen is selected """ self.selected_meas = [] self.select_specimen(str(self.specimens_box.GetValue())) if self.ie_open: self.ie.change_selected(self.current_fit) self.update_...
[ "def", "onSelect_specimen", "(", "self", ",", "event", ")", ":", "self", ".", "selected_meas", "=", "[", "]", "self", ".", "select_specimen", "(", "str", "(", "self", ".", "specimens_box", ".", "GetValue", "(", ")", ")", ")", "if", "self", ".", "ie_ope...
update figures and text when a new specimen is selected
[ "update", "figures", "and", "text", "when", "a", "new", "specimen", "is", "selected" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L8160-L8168
PmagPy/PmagPy
programs/demag_gui.py
Demag_GUI.on_enter_specimen
def on_enter_specimen(self, event): """ upon enter on the specimen box it makes that specimen the current specimen """ new_specimen = self.specimens_box.GetValue() if new_specimen not in self.specimens: self.user_warning( "%s is not a valid spe...
python
def on_enter_specimen(self, event): """ upon enter on the specimen box it makes that specimen the current specimen """ new_specimen = self.specimens_box.GetValue() if new_specimen not in self.specimens: self.user_warning( "%s is not a valid spe...
[ "def", "on_enter_specimen", "(", "self", ",", "event", ")", ":", "new_specimen", "=", "self", ".", "specimens_box", ".", "GetValue", "(", ")", "if", "new_specimen", "not", "in", "self", ".", "specimens", ":", "self", ".", "user_warning", "(", "\"%s is not a ...
upon enter on the specimen box it makes that specimen the current specimen
[ "upon", "enter", "on", "the", "specimen", "box", "it", "makes", "that", "specimen", "the", "current", "specimen" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L8170-L8184
PmagPy/PmagPy
programs/demag_gui.py
Demag_GUI.get_new_PCA_parameters
def get_new_PCA_parameters(self, event): """ calculate statistics when temperatures are selected or PCA type is changed """ tmin = str(self.tmin_box.GetValue()) tmax = str(self.tmax_box.GetValue()) if tmin == "" or tmax == "": return if tmin ...
python
def get_new_PCA_parameters(self, event): """ calculate statistics when temperatures are selected or PCA type is changed """ tmin = str(self.tmin_box.GetValue()) tmax = str(self.tmax_box.GetValue()) if tmin == "" or tmax == "": return if tmin ...
[ "def", "get_new_PCA_parameters", "(", "self", ",", "event", ")", ":", "tmin", "=", "str", "(", "self", ".", "tmin_box", ".", "GetValue", "(", ")", ")", "tmax", "=", "str", "(", "self", ".", "tmax_box", ".", "GetValue", "(", ")", ")", "if", "tmin", ...
calculate statistics when temperatures are selected or PCA type is changed
[ "calculate", "statistics", "when", "temperatures", "are", "selected", "or", "PCA", "type", "is", "changed" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L8221-L8253
PmagPy/PmagPy
programs/demag_gui.py
Demag_GUI.on_select_fit
def on_select_fit(self, event): """ Picks out the fit selected in the fit combobox and sets it to the current fit of the GUI then calls the select function of the fit to set the GUI's bounds boxes and alter other such parameters Parameters ---------- event : the ...
python
def on_select_fit(self, event): """ Picks out the fit selected in the fit combobox and sets it to the current fit of the GUI then calls the select function of the fit to set the GUI's bounds boxes and alter other such parameters Parameters ---------- event : the ...
[ "def", "on_select_fit", "(", "self", ",", "event", ")", ":", "fit_val", "=", "self", ".", "fit_box", ".", "GetValue", "(", ")", "if", "self", ".", "s", "not", "in", "self", ".", "pmag_results_data", "[", "'specimens'", "]", "or", "not", "self", ".", ...
Picks out the fit selected in the fit combobox and sets it to the current fit of the GUI then calls the select function of the fit to set the GUI's bounds boxes and alter other such parameters Parameters ---------- event : the wx.ComboBoxEvent that triggers this function ...
[ "Picks", "out", "the", "fit", "selected", "in", "the", "fit", "combobox", "and", "sets", "it", "to", "the", "current", "fit", "of", "the", "GUI", "then", "calls", "the", "select", "function", "of", "the", "fit", "to", "set", "the", "GUI", "s", "bounds"...
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L8362-L8392
PmagPy/PmagPy
programs/demag_gui.py
Demag_GUI.on_enter_fit_name
def on_enter_fit_name(self, event): """ Allows the entering of new fit names in the fit combobox Parameters ---------- event : the wx.ComboBoxEvent that triggers this function Alters ------ current_fit.name """ if self.current_fit == None...
python
def on_enter_fit_name(self, event): """ Allows the entering of new fit names in the fit combobox Parameters ---------- event : the wx.ComboBoxEvent that triggers this function Alters ------ current_fit.name """ if self.current_fit == None...
[ "def", "on_enter_fit_name", "(", "self", ",", "event", ")", ":", "if", "self", ".", "current_fit", "==", "None", ":", "self", ".", "on_btn_add_fit", "(", "event", ")", "value", "=", "self", ".", "fit_box", ".", "GetValue", "(", ")", "if", "':'", "in", ...
Allows the entering of new fit names in the fit combobox Parameters ---------- event : the wx.ComboBoxEvent that triggers this function Alters ------ current_fit.name
[ "Allows", "the", "entering", "of", "new", "fit", "names", "in", "the", "fit", "combobox" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L8394-L8420
PmagPy/PmagPy
programs/demag_gui.py
Demag_GUI.on_save_interpretation_button
def on_save_interpretation_button(self, event): """ on the save button the interpretation is saved to pmag_results_table data in all coordinate systems """ if self.current_fit: self.current_fit.saved = True calculation_type = self.current_fit.get(self.COO...
python
def on_save_interpretation_button(self, event): """ on the save button the interpretation is saved to pmag_results_table data in all coordinate systems """ if self.current_fit: self.current_fit.saved = True calculation_type = self.current_fit.get(self.COO...
[ "def", "on_save_interpretation_button", "(", "self", ",", "event", ")", ":", "if", "self", ".", "current_fit", ":", "self", ".", "current_fit", ".", "saved", "=", "True", "calculation_type", "=", "self", ".", "current_fit", ".", "get", "(", "self", ".", "C...
on the save button the interpretation is saved to pmag_results_table data in all coordinate systems
[ "on", "the", "save", "button", "the", "interpretation", "is", "saved", "to", "pmag_results_table", "data", "in", "all", "coordinate", "systems" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L8426-L8453
PmagPy/PmagPy
programs/demag_gui.py
Demag_GUI.on_btn_add_fit
def on_btn_add_fit(self, event): """ add a new interpretation to the current specimen Parameters ---------- event : the wx.ButtonEvent that triggered this function Alters ------ pmag_results_data """ if self.auto_save.GetValue(): ...
python
def on_btn_add_fit(self, event): """ add a new interpretation to the current specimen Parameters ---------- event : the wx.ButtonEvent that triggered this function Alters ------ pmag_results_data """ if self.auto_save.GetValue(): ...
[ "def", "on_btn_add_fit", "(", "self", ",", "event", ")", ":", "if", "self", ".", "auto_save", ".", "GetValue", "(", ")", ":", "self", ".", "current_fit", "=", "self", ".", "add_fit", "(", "self", ".", "s", ",", "None", ",", "None", ",", "None", ","...
add a new interpretation to the current specimen Parameters ---------- event : the wx.ButtonEvent that triggered this function Alters ------ pmag_results_data
[ "add", "a", "new", "interpretation", "to", "the", "current", "specimen" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L8455-L8479
PmagPy/PmagPy
programs/demag_gui.py
Demag_GUI.on_btn_delete_fit
def on_btn_delete_fit(self, event): """ removes the current interpretation Parameters ---------- event : the wx.ButtonEvent that triggered this function """ self.delete_fit(self.current_fit, specimen=self.s)
python
def on_btn_delete_fit(self, event): """ removes the current interpretation Parameters ---------- event : the wx.ButtonEvent that triggered this function """ self.delete_fit(self.current_fit, specimen=self.s)
[ "def", "on_btn_delete_fit", "(", "self", ",", "event", ")", ":", "self", ".", "delete_fit", "(", "self", ".", "current_fit", ",", "specimen", "=", "self", ".", "s", ")" ]
removes the current interpretation Parameters ---------- event : the wx.ButtonEvent that triggered this function
[ "removes", "the", "current", "interpretation" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L8481-L8489
PmagPy/PmagPy
programs/demag_gui.py
Demag_GUI.do_auto_save
def do_auto_save(self): """ Delete current fit if auto_save==False, unless current fit has explicitly been saved. """ if not self.auto_save.GetValue(): if self.current_fit: if not self.current_fit.saved: self.delete_fit(self.current...
python
def do_auto_save(self): """ Delete current fit if auto_save==False, unless current fit has explicitly been saved. """ if not self.auto_save.GetValue(): if self.current_fit: if not self.current_fit.saved: self.delete_fit(self.current...
[ "def", "do_auto_save", "(", "self", ")", ":", "if", "not", "self", ".", "auto_save", ".", "GetValue", "(", ")", ":", "if", "self", ".", "current_fit", ":", "if", "not", "self", ".", "current_fit", ".", "saved", ":", "self", ".", "delete_fit", "(", "s...
Delete current fit if auto_save==False, unless current fit has explicitly been saved.
[ "Delete", "current", "fit", "if", "auto_save", "==", "False", "unless", "current", "fit", "has", "explicitly", "been", "saved", "." ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L8516-L8524
PmagPy/PmagPy
programs/demag_gui.py
Demag_GUI.on_next_button
def on_next_button(self, event): """ update figures and text when a next button is selected """ self.do_auto_save() self.selected_meas = [] index = self.specimens.index(self.s) try: fit_index = self.pmag_results_data['specimens'][self.s].index( ...
python
def on_next_button(self, event): """ update figures and text when a next button is selected """ self.do_auto_save() self.selected_meas = [] index = self.specimens.index(self.s) try: fit_index = self.pmag_results_data['specimens'][self.s].index( ...
[ "def", "on_next_button", "(", "self", ",", "event", ")", ":", "self", ".", "do_auto_save", "(", ")", "self", ".", "selected_meas", "=", "[", "]", "index", "=", "self", ".", "specimens", ".", "index", "(", "self", ".", "s", ")", "try", ":", "fit_index...
update figures and text when a next button is selected
[ "update", "figures", "and", "text", "when", "a", "next", "button", "is", "selected" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/demag_gui.py#L8527-L8557
PmagPy/PmagPy
programs/chi_magic.py
main
def main(): """ NAME chi_magic.py DESCRIPTION plots magnetic susceptibility as a function of frequency and temperature and AC field SYNTAX chi_magic.py [command line options] OPTIONS -h prints help message and quits -f FILE, specify measurements format file...
python
def main(): """ NAME chi_magic.py DESCRIPTION plots magnetic susceptibility as a function of frequency and temperature and AC field SYNTAX chi_magic.py [command line options] OPTIONS -h prints help message and quits -f FILE, specify measurements format file...
[ "def", "main", "(", ")", ":", "if", "\"-h\"", "in", "sys", ".", "argv", ":", "print", "(", "main", ".", "__doc__", ")", "return", "infile", "=", "pmag", ".", "get_named_arg", "(", "\"-f\"", ",", "\"measurements.txt\"", ")", "dir_path", "=", "pmag", "."...
NAME chi_magic.py DESCRIPTION plots magnetic susceptibility as a function of frequency and temperature and AC field SYNTAX chi_magic.py [command line options] OPTIONS -h prints help message and quits -f FILE, specify measurements format file, default "measurements....
[ "NAME", "chi_magic", ".", "py" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/chi_magic.py#L10-L43
PmagPy/PmagPy
programs/watsons_f.py
main
def main(): """ NAME watsons_f.py DESCRIPTION calculates Watson's F statistic from input files INPUT FORMAT takes dec/inc as first two columns in two space delimited files SYNTAX watsons_f.py [command line options] OPTIONS -h prints help message and qui...
python
def main(): """ NAME watsons_f.py DESCRIPTION calculates Watson's F statistic from input files INPUT FORMAT takes dec/inc as first two columns in two space delimited files SYNTAX watsons_f.py [command line options] OPTIONS -h prints help message and qui...
[ "def", "main", "(", ")", ":", "D", ",", "D1", ",", "D2", "=", "[", "]", ",", "[", "]", ",", "[", "]", "Flip", "=", "0", "if", "'-h'", "in", "sys", ".", "argv", ":", "# check if help is needed", "print", "(", "main", ".", "__doc__", ")", "sys", ...
NAME watsons_f.py DESCRIPTION calculates Watson's F statistic from input files INPUT FORMAT takes dec/inc as first two columns in two space delimited files SYNTAX watsons_f.py [command line options] OPTIONS -h prints help message and quits -f FILE (with...
[ "NAME", "watsons_f", ".", "py" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/watsons_f.py#L11-L83
PmagPy/PmagPy
programs/deprecated/thellier_magic_redo.py
main
def main(): """ NAME thellier_magic_redo.py DESCRIPTION Calculates paleointensity parameters for thellier-thellier type data using bounds stored in the "redo" file SYNTAX thellier_magic_redo [command line options] OPTIONS -h prints help message -usr...
python
def main(): """ NAME thellier_magic_redo.py DESCRIPTION Calculates paleointensity parameters for thellier-thellier type data using bounds stored in the "redo" file SYNTAX thellier_magic_redo [command line options] OPTIONS -h prints help message -usr...
[ "def", "main", "(", ")", ":", "dir_path", "=", "'.'", "critout", "=", "\"\"", "version_num", "=", "pmag", ".", "get_version", "(", ")", "field", ",", "first_save", "=", "-", "1", ",", "1", "spec", ",", "recnum", ",", "start", ",", "end", "=", "0", ...
NAME thellier_magic_redo.py DESCRIPTION Calculates paleointensity parameters for thellier-thellier type data using bounds stored in the "redo" file SYNTAX thellier_magic_redo [command line options] OPTIONS -h prints help message -usr USER: identify user, ...
[ "NAME", "thellier_magic_redo", ".", "py" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/deprecated/thellier_magic_redo.py#L8-L383
PmagPy/PmagPy
programs/conversion_scripts2/pmd_magic2.py
main
def main(command_line=True, **kwargs): """ NAME pmd_magic.py DESCRIPTION converts PMD (Enkin) format files to magic_measurements format files SYNTAX pmd_magic.py [command line options] OPTIONS -h: prints the help message and quits. -f FILE: specify input...
python
def main(command_line=True, **kwargs): """ NAME pmd_magic.py DESCRIPTION converts PMD (Enkin) format files to magic_measurements format files SYNTAX pmd_magic.py [command line options] OPTIONS -h: prints the help message and quits. -f FILE: specify input...
[ "def", "main", "(", "command_line", "=", "True", ",", "*", "*", "kwargs", ")", ":", "# initialize some stuff", "noave", "=", "0", "inst", "=", "\"\"", "samp_con", ",", "Z", "=", "'1'", ",", "\"\"", "missing", "=", "1", "demag", "=", "\"N\"", "er_locati...
NAME pmd_magic.py DESCRIPTION converts PMD (Enkin) format files to magic_measurements format files SYNTAX pmd_magic.py [command line options] OPTIONS -h: prints the help message and quits. -f FILE: specify input file, or -F FILE: specify output file, def...
[ "NAME", "pmd_magic", ".", "py", "DESCRIPTION", "converts", "PMD", "(", "Enkin", ")", "format", "files", "to", "magic_measurements", "format", "files" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/conversion_scripts2/pmd_magic2.py#L7-L276
PmagPy/PmagPy
SPD/lib/lib_arai_plot_statistics.py
York_Regression
def York_Regression(x_segment, y_segment, x_mean, y_mean, n, lab_dc_field, steps_Arai): """ input: x_segment, y_segment, x_mean, y_mean, n, lab_dc_field, steps_Arai output: x_err, y_err, x_tag, y_tag, b, b_sigma, specimen_b_beta, y_intercept, x_intercept, x_prime, y_prime, delta_x_prime, delta_...
python
def York_Regression(x_segment, y_segment, x_mean, y_mean, n, lab_dc_field, steps_Arai): """ input: x_segment, y_segment, x_mean, y_mean, n, lab_dc_field, steps_Arai output: x_err, y_err, x_tag, y_tag, b, b_sigma, specimen_b_beta, y_intercept, x_intercept, x_prime, y_prime, delta_x_prime, delta_...
[ "def", "York_Regression", "(", "x_segment", ",", "y_segment", ",", "x_mean", ",", "y_mean", ",", "n", ",", "lab_dc_field", ",", "steps_Arai", ")", ":", "x_err", "=", "x_segment", "-", "x_mean", "y_err", "=", "y_segment", "-", "y_mean", "york_b", "=", "-", ...
input: x_segment, y_segment, x_mean, y_mean, n, lab_dc_field, steps_Arai output: x_err, y_err, x_tag, y_tag, b, b_sigma, specimen_b_beta, y_intercept, x_intercept, x_prime, y_prime, delta_x_prime, delta_y_prime, f_Coe, g_Coe, g_lim, specimen_q, specimen_w, count_IZ, count_ZI, B_lab, B_anc, ...
[ "input", ":", "x_segment", "y_segment", "x_mean", "y_mean", "n", "lab_dc_field", "steps_Arai", "output", ":", "x_err", "y_err", "x_tag", "y_tag", "b", "b_sigma", "specimen_b_beta", "y_intercept", "x_intercept", "x_prime", "y_prime", "delta_x_prime", "delta_y_prime", "...
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/lib/lib_arai_plot_statistics.py#L10-L68
PmagPy/PmagPy
SPD/lib/lib_arai_plot_statistics.py
get_vds
def get_vds(zdata, delta_y_prime, start, end): """takes zdata array: [[1, 2, 3], [3, 4, 5]], delta_y_prime: 1, start value, and end value. gets vds and f_vds, etc. """ vector_diffs = [] for k in range(len(zdata)-1): # gets diff between two vectors vector_diffs.append(numpy.sqrt(sum((numpy.array...
python
def get_vds(zdata, delta_y_prime, start, end): """takes zdata array: [[1, 2, 3], [3, 4, 5]], delta_y_prime: 1, start value, and end value. gets vds and f_vds, etc. """ vector_diffs = [] for k in range(len(zdata)-1): # gets diff between two vectors vector_diffs.append(numpy.sqrt(sum((numpy.array...
[ "def", "get_vds", "(", "zdata", ",", "delta_y_prime", ",", "start", ",", "end", ")", ":", "vector_diffs", "=", "[", "]", "for", "k", "in", "range", "(", "len", "(", "zdata", ")", "-", "1", ")", ":", "# gets diff between two vectors", "vector_diffs", ".",...
takes zdata array: [[1, 2, 3], [3, 4, 5]], delta_y_prime: 1, start value, and end value. gets vds and f_vds, etc.
[ "takes", "zdata", "array", ":", "[[", "1", "2", "3", "]", "[", "3", "4", "5", "]]", "delta_y_prime", ":", "1", "start", "value", "and", "end", "value", ".", "gets", "vds", "and", "f_vds", "etc", "." ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/lib/lib_arai_plot_statistics.py#L70-L86
PmagPy/PmagPy
SPD/lib/lib_arai_plot_statistics.py
get_SCAT_box
def get_SCAT_box(slope, x_mean, y_mean, beta_threshold = .1): """ takes in data and returns information about SCAT box: the largest possible x_value, the largest possible y_value, and functions for the two bounding lines of the box """ # if beta_threshold is -999, that means null if beta_thr...
python
def get_SCAT_box(slope, x_mean, y_mean, beta_threshold = .1): """ takes in data and returns information about SCAT box: the largest possible x_value, the largest possible y_value, and functions for the two bounding lines of the box """ # if beta_threshold is -999, that means null if beta_thr...
[ "def", "get_SCAT_box", "(", "slope", ",", "x_mean", ",", "y_mean", ",", "beta_threshold", "=", ".1", ")", ":", "# if beta_threshold is -999, that means null", "if", "beta_threshold", "==", "-", "999", ":", "beta_threshold", "=", ".1", "slope_err_threshold", "=", "...
takes in data and returns information about SCAT box: the largest possible x_value, the largest possible y_value, and functions for the two bounding lines of the box
[ "takes", "in", "data", "and", "returns", "information", "about", "SCAT", "box", ":", "the", "largest", "possible", "x_value", "the", "largest", "possible", "y_value", "and", "functions", "for", "the", "two", "bounding", "lines", "of", "the", "box" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/lib/lib_arai_plot_statistics.py#L88-L130
PmagPy/PmagPy
SPD/lib/lib_arai_plot_statistics.py
in_SCAT_box
def in_SCAT_box(x, y, low_bound, high_bound, x_max, y_max): """determines if a particular point falls within a box""" passing = True upper_limit = high_bound(x) lower_limit = low_bound(x) if x > x_max or y > y_max: passing = False if x < 0 or y < 0: passing = False if y > upp...
python
def in_SCAT_box(x, y, low_bound, high_bound, x_max, y_max): """determines if a particular point falls within a box""" passing = True upper_limit = high_bound(x) lower_limit = low_bound(x) if x > x_max or y > y_max: passing = False if x < 0 or y < 0: passing = False if y > upp...
[ "def", "in_SCAT_box", "(", "x", ",", "y", ",", "low_bound", ",", "high_bound", ",", "x_max", ",", "y_max", ")", ":", "passing", "=", "True", "upper_limit", "=", "high_bound", "(", "x", ")", "lower_limit", "=", "low_bound", "(", "x", ")", "if", "x", "...
determines if a particular point falls within a box
[ "determines", "if", "a", "particular", "point", "falls", "within", "a", "box" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/lib/lib_arai_plot_statistics.py#L132-L145
PmagPy/PmagPy
SPD/lib/lib_arai_plot_statistics.py
get_SCAT_points
def get_SCAT_points(x_Arai_segment, y_Arai_segment, tmin, tmax, ptrm_checks_temperatures, ptrm_checks_starting_temperatures, x_ptrm_check, y_ptrm_check, tail_checks_temperatures, tail_checks_starting_temperatures, x_tail_check, y_tail_check): """returns re...
python
def get_SCAT_points(x_Arai_segment, y_Arai_segment, tmin, tmax, ptrm_checks_temperatures, ptrm_checks_starting_temperatures, x_ptrm_check, y_ptrm_check, tail_checks_temperatures, tail_checks_starting_temperatures, x_tail_check, y_tail_check): """returns re...
[ "def", "get_SCAT_points", "(", "x_Arai_segment", ",", "y_Arai_segment", ",", "tmin", ",", "tmax", ",", "ptrm_checks_temperatures", ",", "ptrm_checks_starting_temperatures", ",", "x_ptrm_check", ",", "y_ptrm_check", ",", "tail_checks_temperatures", ",", "tail_checks_starting...
returns relevant points for a SCAT test
[ "returns", "relevant", "points", "for", "a", "SCAT", "test" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/lib/lib_arai_plot_statistics.py#L147-L181
PmagPy/PmagPy
SPD/lib/lib_arai_plot_statistics.py
get_SCAT
def get_SCAT(points, low_bound, high_bound, x_max, y_max): """ runs SCAT test and returns boolean """ # iterate through all relevant points and see if any of them fall outside of your SCAT box SCAT = True for point in points: result = in_SCAT_box(point[0], point[1], low_bound, high_bound...
python
def get_SCAT(points, low_bound, high_bound, x_max, y_max): """ runs SCAT test and returns boolean """ # iterate through all relevant points and see if any of them fall outside of your SCAT box SCAT = True for point in points: result = in_SCAT_box(point[0], point[1], low_bound, high_bound...
[ "def", "get_SCAT", "(", "points", ",", "low_bound", ",", "high_bound", ",", "x_max", ",", "y_max", ")", ":", "# iterate through all relevant points and see if any of them fall outside of your SCAT box", "SCAT", "=", "True", "for", "point", "in", "points", ":", "result",...
runs SCAT test and returns boolean
[ "runs", "SCAT", "test", "and", "returns", "boolean" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/lib/lib_arai_plot_statistics.py#L183-L194
PmagPy/PmagPy
SPD/lib/lib_arai_plot_statistics.py
fancy_SCAT
def fancy_SCAT(points, low_bound, high_bound, x_max, y_max): """ runs SCAT test and returns 'Pass' or 'Fail' """ # iterate through all relevant points and see if any of them fall outside of your SCAT box # {'points_arai': [(x,y),(x,y)], 'points_ptrm': [(x,y),(x,y)], ...} SCAT = 'Pass' SCATs ...
python
def fancy_SCAT(points, low_bound, high_bound, x_max, y_max): """ runs SCAT test and returns 'Pass' or 'Fail' """ # iterate through all relevant points and see if any of them fall outside of your SCAT box # {'points_arai': [(x,y),(x,y)], 'points_ptrm': [(x,y),(x,y)], ...} SCAT = 'Pass' SCATs ...
[ "def", "fancy_SCAT", "(", "points", ",", "low_bound", ",", "high_bound", ",", "x_max", ",", "y_max", ")", ":", "# iterate through all relevant points and see if any of them fall outside of your SCAT box", "# {'points_arai': [(x,y),(x,y)], 'points_ptrm': [(x,y),(x,y)], ...}", "SCAT", ...
runs SCAT test and returns 'Pass' or 'Fail'
[ "runs", "SCAT", "test", "and", "returns", "Pass", "or", "Fail" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/lib/lib_arai_plot_statistics.py#L196-L216
PmagPy/PmagPy
SPD/lib/lib_arai_plot_statistics.py
get_FRAC
def get_FRAC(vds, vector_diffs_segment): """ input: vds, vector_diffs_segment output: FRAC """ for num in vector_diffs_segment: if num < 0: raise ValueError('vector diffs should not be negative') if vds == 0: raise ValueError('attempting to divide by zero. vds should ...
python
def get_FRAC(vds, vector_diffs_segment): """ input: vds, vector_diffs_segment output: FRAC """ for num in vector_diffs_segment: if num < 0: raise ValueError('vector diffs should not be negative') if vds == 0: raise ValueError('attempting to divide by zero. vds should ...
[ "def", "get_FRAC", "(", "vds", ",", "vector_diffs_segment", ")", ":", "for", "num", "in", "vector_diffs_segment", ":", "if", "num", "<", "0", ":", "raise", "ValueError", "(", "'vector diffs should not be negative'", ")", "if", "vds", "==", "0", ":", "raise", ...
input: vds, vector_diffs_segment output: FRAC
[ "input", ":", "vds", "vector_diffs_segment", "output", ":", "FRAC" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/lib/lib_arai_plot_statistics.py#L219-L230
PmagPy/PmagPy
SPD/lib/lib_arai_plot_statistics.py
get_R_corr2
def get_R_corr2(x_avg, y_avg, x_segment, y_segment): # """ input: x_avg, y_avg, x_segment, y_segment output: R_corr2 """ xd = x_segment - x_avg # detrend x_segment yd = y_segment - y_avg # detrend y_segment if sum(xd**2) * sum(yd**2) == 0: # prevent divide by zero error return float(...
python
def get_R_corr2(x_avg, y_avg, x_segment, y_segment): # """ input: x_avg, y_avg, x_segment, y_segment output: R_corr2 """ xd = x_segment - x_avg # detrend x_segment yd = y_segment - y_avg # detrend y_segment if sum(xd**2) * sum(yd**2) == 0: # prevent divide by zero error return float(...
[ "def", "get_R_corr2", "(", "x_avg", ",", "y_avg", ",", "x_segment", ",", "y_segment", ")", ":", "#", "xd", "=", "x_segment", "-", "x_avg", "# detrend x_segment", "yd", "=", "y_segment", "-", "y_avg", "# detrend y_segment", "if", "sum", "(", "xd", "**", "2"...
input: x_avg, y_avg, x_segment, y_segment output: R_corr2
[ "input", ":", "x_avg", "y_avg", "x_segment", "y_segment", "output", ":", "R_corr2" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/lib/lib_arai_plot_statistics.py#L232-L242
PmagPy/PmagPy
SPD/lib/lib_arai_plot_statistics.py
get_R_det2
def get_R_det2(y_segment, y_avg, y_prime): """ takes in an array of y values, the mean of those values, and the array of y prime values. returns R_det2 """ numerator = sum((numpy.array(y_segment) - numpy.array(y_prime))**2) denominator = sum((numpy.array(y_segment) - y_avg)**2) if denominato...
python
def get_R_det2(y_segment, y_avg, y_prime): """ takes in an array of y values, the mean of those values, and the array of y prime values. returns R_det2 """ numerator = sum((numpy.array(y_segment) - numpy.array(y_prime))**2) denominator = sum((numpy.array(y_segment) - y_avg)**2) if denominato...
[ "def", "get_R_det2", "(", "y_segment", ",", "y_avg", ",", "y_prime", ")", ":", "numerator", "=", "sum", "(", "(", "numpy", ".", "array", "(", "y_segment", ")", "-", "numpy", ".", "array", "(", "y_prime", ")", ")", "**", "2", ")", "denominator", "=", ...
takes in an array of y values, the mean of those values, and the array of y prime values. returns R_det2
[ "takes", "in", "an", "array", "of", "y", "values", "the", "mean", "of", "those", "values", "and", "the", "array", "of", "y", "prime", "values", ".", "returns", "R_det2" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/lib/lib_arai_plot_statistics.py#L244-L255
PmagPy/PmagPy
SPD/lib/lib_arai_plot_statistics.py
get_b_wiggle
def get_b_wiggle(x, y, y_int): """returns instantaneous slope from the ratio of NRM lost to TRM gained at the ith step""" if x == 0: b_wiggle = 0 else: b_wiggle = old_div((y_int - y), x) return b_wiggle
python
def get_b_wiggle(x, y, y_int): """returns instantaneous slope from the ratio of NRM lost to TRM gained at the ith step""" if x == 0: b_wiggle = 0 else: b_wiggle = old_div((y_int - y), x) return b_wiggle
[ "def", "get_b_wiggle", "(", "x", ",", "y", ",", "y_int", ")", ":", "if", "x", "==", "0", ":", "b_wiggle", "=", "0", "else", ":", "b_wiggle", "=", "old_div", "(", "(", "y_int", "-", "y", ")", ",", "x", ")", "return", "b_wiggle" ]
returns instantaneous slope from the ratio of NRM lost to TRM gained at the ith step
[ "returns", "instantaneous", "slope", "from", "the", "ratio", "of", "NRM", "lost", "to", "TRM", "gained", "at", "the", "ith", "step" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/lib/lib_arai_plot_statistics.py#L257-L263
PmagPy/PmagPy
SPD/lib/lib_arai_plot_statistics.py
get_Z
def get_Z(x_segment, y_segment, x_int, y_int, slope): """ input: x_segment, y_segment, x_int, y_int, slope output: Z (Arai plot zigzag parameter) """ Z = 0 first_time = True for num, x in enumerate(x_segment): b_wiggle = get_b_wiggle(x, y_segment[num], y_int) z = old_div((x *...
python
def get_Z(x_segment, y_segment, x_int, y_int, slope): """ input: x_segment, y_segment, x_int, y_int, slope output: Z (Arai plot zigzag parameter) """ Z = 0 first_time = True for num, x in enumerate(x_segment): b_wiggle = get_b_wiggle(x, y_segment[num], y_int) z = old_div((x *...
[ "def", "get_Z", "(", "x_segment", ",", "y_segment", ",", "x_int", ",", "y_int", ",", "slope", ")", ":", "Z", "=", "0", "first_time", "=", "True", "for", "num", ",", "x", "in", "enumerate", "(", "x_segment", ")", ":", "b_wiggle", "=", "get_b_wiggle", ...
input: x_segment, y_segment, x_int, y_int, slope output: Z (Arai plot zigzag parameter)
[ "input", ":", "x_segment", "y_segment", "x_int", "y_int", "slope", "output", ":", "Z", "(", "Arai", "plot", "zigzag", "parameter", ")" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/lib/lib_arai_plot_statistics.py#L265-L277
PmagPy/PmagPy
SPD/lib/lib_arai_plot_statistics.py
get_Zstar
def get_Zstar(x_segment, y_segment, x_int, y_int, slope, n): """ input: x_segment, y_segment, x_int, y_int, slope, n output: Z* (Arai plot zigzag parameter (alternate)) """ total = 0 first_time = True for num, x in enumerate(x_segment): b_wiggle = get_b_wiggle(x, y_segment[num], y_in...
python
def get_Zstar(x_segment, y_segment, x_int, y_int, slope, n): """ input: x_segment, y_segment, x_int, y_int, slope, n output: Z* (Arai plot zigzag parameter (alternate)) """ total = 0 first_time = True for num, x in enumerate(x_segment): b_wiggle = get_b_wiggle(x, y_segment[num], y_in...
[ "def", "get_Zstar", "(", "x_segment", ",", "y_segment", ",", "x_int", ",", "y_int", ",", "slope", ",", "n", ")", ":", "total", "=", "0", "first_time", "=", "True", "for", "num", ",", "x", "in", "enumerate", "(", "x_segment", ")", ":", "b_wiggle", "="...
input: x_segment, y_segment, x_int, y_int, slope, n output: Z* (Arai plot zigzag parameter (alternate))
[ "input", ":", "x_segment", "y_segment", "x_int", "y_int", "slope", "n", "output", ":", "Z", "*", "(", "Arai", "plot", "zigzag", "parameter", "(", "alternate", "))" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/lib/lib_arai_plot_statistics.py#L279-L292
PmagPy/PmagPy
SPD/lib/lib_arai_plot_statistics.py
get_normed_points
def get_normed_points(point_array, norm): # good to go """ input: point_array, norm output: normed array """ norm = float(norm) #floated_array = [] #for p in point_array: # need to make sure each point is a float #floated_array.append(float(p)) points = old_div(numpy.array(point_...
python
def get_normed_points(point_array, norm): # good to go """ input: point_array, norm output: normed array """ norm = float(norm) #floated_array = [] #for p in point_array: # need to make sure each point is a float #floated_array.append(float(p)) points = old_div(numpy.array(point_...
[ "def", "get_normed_points", "(", "point_array", ",", "norm", ")", ":", "# good to go", "norm", "=", "float", "(", "norm", ")", "#floated_array = []", "#for p in point_array: # need to make sure each point is a float", "#floated_array.append(float(p))", "points", "=", "old_div...
input: point_array, norm output: normed array
[ "input", ":", "point_array", "norm", "output", ":", "normed", "array" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/lib/lib_arai_plot_statistics.py#L297-L307
PmagPy/PmagPy
SPD/lib/lib_arai_plot_statistics.py
get_xy_array
def get_xy_array(x_segment, y_segment): """ input: x_segment, y_segment output: xy_segment, ( format: [(x[0], y[0]), (x[1], y[1])] """ xy_array = [] for num, x in enumerate(x_segment): xy_array.append((x, y_segment[num])) return xy_array
python
def get_xy_array(x_segment, y_segment): """ input: x_segment, y_segment output: xy_segment, ( format: [(x[0], y[0]), (x[1], y[1])] """ xy_array = [] for num, x in enumerate(x_segment): xy_array.append((x, y_segment[num])) return xy_array
[ "def", "get_xy_array", "(", "x_segment", ",", "y_segment", ")", ":", "xy_array", "=", "[", "]", "for", "num", ",", "x", "in", "enumerate", "(", "x_segment", ")", ":", "xy_array", ".", "append", "(", "(", "x", ",", "y_segment", "[", "num", "]", ")", ...
input: x_segment, y_segment output: xy_segment, ( format: [(x[0], y[0]), (x[1], y[1])]
[ "input", ":", "x_segment", "y_segment", "output", ":", "xy_segment", "(", "format", ":", "[", "(", "x", "[", "0", "]", "y", "[", "0", "]", ")", "(", "x", "[", "1", "]", "y", "[", "1", "]", ")", "]" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/lib/lib_arai_plot_statistics.py#L309-L317
PmagPy/PmagPy
programs/stats.py
main
def main(): """ NAME stats.py DEFINITION calculates Gauss statistics for input data SYNTAX stats [command line options][< filename] INPUT single column of numbers OPTIONS -h prints help message and quits -i interactive entry of file name ...
python
def main(): """ NAME stats.py DEFINITION calculates Gauss statistics for input data SYNTAX stats [command line options][< filename] INPUT single column of numbers OPTIONS -h prints help message and quits -i interactive entry of file name ...
[ "def", "main", "(", ")", ":", "if", "'-h'", "in", "sys", ".", "argv", ":", "print", "(", "main", ".", "__doc__", ")", "sys", ".", "exit", "(", ")", "if", "'-i'", "in", "sys", ".", "argv", ":", "file", "=", "input", "(", "\"Enter file name: \"", "...
NAME stats.py DEFINITION calculates Gauss statistics for input data SYNTAX stats [command line options][< filename] INPUT single column of numbers OPTIONS -h prints help message and quits -i interactive entry of file name -f input file name ...
[ "NAME", "stats", ".", "py", "DEFINITION", "calculates", "Gauss", "statistics", "for", "input", "data" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/stats.py#L7-L65
PmagPy/PmagPy
programs/magic_select.py
main
def main(): """ NAME magic_select.py DESCRIPTION picks out records and dictitem options saves to magic_special file SYNTAX magic_select.py [command line optins] OPTIONS -h prints help message and quits -f FILE: specify input magic format file -F FIL...
python
def main(): """ NAME magic_select.py DESCRIPTION picks out records and dictitem options saves to magic_special file SYNTAX magic_select.py [command line optins] OPTIONS -h prints help message and quits -f FILE: specify input magic format file -F FIL...
[ "def", "main", "(", ")", ":", "dir_path", "=", "\".\"", "flag", "=", "''", "if", "'-WD'", "in", "sys", ".", "argv", ":", "ind", "=", "sys", ".", "argv", ".", "index", "(", "'-WD'", ")", "dir_path", "=", "sys", ".", "argv", "[", "ind", "+", "1",...
NAME magic_select.py DESCRIPTION picks out records and dictitem options saves to magic_special file SYNTAX magic_select.py [command line optins] OPTIONS -h prints help message and quits -f FILE: specify input magic format file -F FILE: specify output magic ...
[ "NAME", "magic_select", ".", "py" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/magic_select.py#L7-L93
PmagPy/PmagPy
programs/aniso_magic2.py
main
def main(): """ NAME aniso_magic.py DESCRIPTION plots anisotropy data with either bootstrap or hext ellipses SYNTAX aniso_magic.py [-h] [command line options] OPTIONS -h plots help message and quits -usr USER: set the user name -f AFILE, specify rmag...
python
def main(): """ NAME aniso_magic.py DESCRIPTION plots anisotropy data with either bootstrap or hext ellipses SYNTAX aniso_magic.py [-h] [command line options] OPTIONS -h plots help message and quits -usr USER: set the user name -f AFILE, specify rmag...
[ "def", "main", "(", ")", ":", "#", "dir_path", "=", "\".\"", "version_num", "=", "pmag", ".", "get_version", "(", ")", "verbose", "=", "pmagplotlib", ".", "verbose", "args", "=", "sys", ".", "argv", "ipar", ",", "ihext", ",", "ivec", ",", "iboot", ",...
NAME aniso_magic.py DESCRIPTION plots anisotropy data with either bootstrap or hext ellipses SYNTAX aniso_magic.py [-h] [command line options] OPTIONS -h plots help message and quits -usr USER: set the user name -f AFILE, specify rmag_anisotropy formatted fi...
[ "NAME", "aniso_magic", ".", "py" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/aniso_magic2.py#L20-L579
PmagPy/PmagPy
programs/di_geo.py
main
def main(): """ NAME di_geo.py DESCRIPTION rotates specimen coordinate dec, inc data to geographic coordinates using the azimuth and plunge of the X direction INPUT FORMAT declination inclination azimuth plunge SYNTAX di_geo.py [-h][-i][-f FILE] [< filename ] ...
python
def main(): """ NAME di_geo.py DESCRIPTION rotates specimen coordinate dec, inc data to geographic coordinates using the azimuth and plunge of the X direction INPUT FORMAT declination inclination azimuth plunge SYNTAX di_geo.py [-h][-i][-f FILE] [< filename ] ...
[ "def", "main", "(", ")", ":", "if", "'-h'", "in", "sys", ".", "argv", ":", "print", "(", "main", ".", "__doc__", ")", "sys", ".", "exit", "(", ")", "if", "'-F'", "in", "sys", ".", "argv", ":", "ind", "=", "sys", ".", "argv", ".", "index", "("...
NAME di_geo.py DESCRIPTION rotates specimen coordinate dec, inc data to geographic coordinates using the azimuth and plunge of the X direction INPUT FORMAT declination inclination azimuth plunge SYNTAX di_geo.py [-h][-i][-f FILE] [< filename ] OPTIONS -h p...
[ "NAME", "di_geo", ".", "py" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/di_geo.py#L9-L64
PmagPy/PmagPy
programs/eqarea_ell.py
main
def main(): """ NAME eqarea_ell.py DESCRIPTION makes equal area projections from declination/inclination data and plot ellipses SYNTAX eqarea_ell.py -h [command line options] INPUT takes space delimited Dec/Inc data OPTIONS -h prints help message ...
python
def main(): """ NAME eqarea_ell.py DESCRIPTION makes equal area projections from declination/inclination data and plot ellipses SYNTAX eqarea_ell.py -h [command line options] INPUT takes space delimited Dec/Inc data OPTIONS -h prints help message ...
[ "def", "main", "(", ")", ":", "FIG", "=", "{", "}", "# plot dictionary", "FIG", "[", "'eq'", "]", "=", "1", "# eqarea is figure 1", "fmt", ",", "dist", ",", "mode", ",", "plot", "=", "'svg'", ",", "'F'", ",", "1", ",", "0", "sym", "=", "{", "'low...
NAME eqarea_ell.py DESCRIPTION makes equal area projections from declination/inclination data and plot ellipses SYNTAX eqarea_ell.py -h [command line options] INPUT takes space delimited Dec/Inc data OPTIONS -h prints help message and quits -f FIL...
[ "NAME", "eqarea_ell", ".", "py" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/eqarea_ell.py#L12-L237
PmagPy/PmagPy
programs/di_eq.py
main
def main(): """ NAME di_eq.py DESCRIPTION converts dec, inc pairs to x,y pairs using equal area projection NB: do only upper or lower hemisphere at a time: does not distinguish between up and down. SYNTAX di_eq.py [command line options] [< filename] OPTIO...
python
def main(): """ NAME di_eq.py DESCRIPTION converts dec, inc pairs to x,y pairs using equal area projection NB: do only upper or lower hemisphere at a time: does not distinguish between up and down. SYNTAX di_eq.py [command line options] [< filename] OPTIO...
[ "def", "main", "(", ")", ":", "out", "=", "\"\"", "UP", "=", "0", "if", "'-h'", "in", "sys", ".", "argv", ":", "print", "(", "main", ".", "__doc__", ")", "sys", ".", "exit", "(", ")", "if", "'-f'", "in", "sys", ".", "argv", ":", "ind", "=", ...
NAME di_eq.py DESCRIPTION converts dec, inc pairs to x,y pairs using equal area projection NB: do only upper or lower hemisphere at a time: does not distinguish between up and down. SYNTAX di_eq.py [command line options] [< filename] OPTIONS -h prints he...
[ "NAME", "di_eq", ".", "py", "DESCRIPTION", "converts", "dec", "inc", "pairs", "to", "x", "y", "pairs", "using", "equal", "area", "projection", "NB", ":", "do", "only", "upper", "or", "lower", "hemisphere", "at", "a", "time", ":", "does", "not", "distingu...
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/di_eq.py#L7-L42
PmagPy/PmagPy
pmagpy/spline.py
spline_interpolate
def spline_interpolate(x1, y1, x2): """ Given a function at a set of points (x1, y1), interpolate to evaluate it at points x2. """ sp = Spline(x1, y1) return sp(x2)
python
def spline_interpolate(x1, y1, x2): """ Given a function at a set of points (x1, y1), interpolate to evaluate it at points x2. """ sp = Spline(x1, y1) return sp(x2)
[ "def", "spline_interpolate", "(", "x1", ",", "y1", ",", "x2", ")", ":", "sp", "=", "Spline", "(", "x1", ",", "y1", ")", "return", "sp", "(", "x2", ")" ]
Given a function at a set of points (x1, y1), interpolate to evaluate it at points x2.
[ "Given", "a", "function", "at", "a", "set", "of", "points", "(", "x1", "y1", ")", "interpolate", "to", "evaluate", "it", "at", "points", "x2", "." ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/spline.py#L163-L169
PmagPy/PmagPy
pmagpy/spline.py
logspline_interpolate
def logspline_interpolate(x1, y1, x2): """ Given a function at a set of points (x1, y1), interpolate to evaluate it at points x2. """ sp = Spline(log(x1), log(y1)) return exp(sp(log(x2)))
python
def logspline_interpolate(x1, y1, x2): """ Given a function at a set of points (x1, y1), interpolate to evaluate it at points x2. """ sp = Spline(log(x1), log(y1)) return exp(sp(log(x2)))
[ "def", "logspline_interpolate", "(", "x1", ",", "y1", ",", "x2", ")", ":", "sp", "=", "Spline", "(", "log", "(", "x1", ")", ",", "log", "(", "y1", ")", ")", "return", "exp", "(", "sp", "(", "log", "(", "x2", ")", ")", ")" ]
Given a function at a set of points (x1, y1), interpolate to evaluate it at points x2.
[ "Given", "a", "function", "at", "a", "set", "of", "points", "(", "x1", "y1", ")", "interpolate", "to", "evaluate", "it", "at", "points", "x2", "." ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/spline.py#L171-L177
PmagPy/PmagPy
pmagpy/spline.py
linear_interpolate
def linear_interpolate(x1, y1, x2): """ Given a function at a set of points (x1, y1), interpolate to evaluate it at points x2. """ li = LinInt(x1, y1) return li(x2)
python
def linear_interpolate(x1, y1, x2): """ Given a function at a set of points (x1, y1), interpolate to evaluate it at points x2. """ li = LinInt(x1, y1) return li(x2)
[ "def", "linear_interpolate", "(", "x1", ",", "y1", ",", "x2", ")", ":", "li", "=", "LinInt", "(", "x1", ",", "y1", ")", "return", "li", "(", "x2", ")" ]
Given a function at a set of points (x1, y1), interpolate to evaluate it at points x2.
[ "Given", "a", "function", "at", "a", "set", "of", "points", "(", "x1", "y1", ")", "interpolate", "to", "evaluate", "it", "at", "points", "x2", "." ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/spline.py#L180-L186
PmagPy/PmagPy
pmagpy/spline.py
LinInt.call
def call(self, x): """ Evaluate the interpolant, assuming x is a scalar. """ # if out of range, return endpoint if x <= self.x_vals[0]: return self.y_vals[0] if x >= self.x_vals[-1]: return self.y_vals[-1] pos = numpy.searchsorted(self.x_vals,...
python
def call(self, x): """ Evaluate the interpolant, assuming x is a scalar. """ # if out of range, return endpoint if x <= self.x_vals[0]: return self.y_vals[0] if x >= self.x_vals[-1]: return self.y_vals[-1] pos = numpy.searchsorted(self.x_vals,...
[ "def", "call", "(", "self", ",", "x", ")", ":", "# if out of range, return endpoint", "if", "x", "<=", "self", ".", "x_vals", "[", "0", "]", ":", "return", "self", ".", "y_vals", "[", "0", "]", "if", "x", ">=", "self", ".", "x_vals", "[", "-", "1",...
Evaluate the interpolant, assuming x is a scalar.
[ "Evaluate", "the", "interpolant", "assuming", "x", "is", "a", "scalar", "." ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/spline.py#L143-L161
PmagPy/PmagPy
programs/aarm_magic.py
main
def main(): """ NAME aarm_magic.py DESCRIPTION Converts AARM data to best-fit tensor (6 elements plus sigma) Original program ARMcrunch written to accomodate ARM anisotropy data collected from 6 axial directions (+X,+Y,+Z,-X,-Y,-Z) using the off-axis remanence ...
python
def main(): """ NAME aarm_magic.py DESCRIPTION Converts AARM data to best-fit tensor (6 elements plus sigma) Original program ARMcrunch written to accomodate ARM anisotropy data collected from 6 axial directions (+X,+Y,+Z,-X,-Y,-Z) using the off-axis remanence ...
[ "def", "main", "(", ")", ":", "# initialize some parameters", "args", "=", "sys", ".", "argv", "if", "\"-h\"", "in", "args", ":", "print", "(", "main", ".", "__doc__", ")", "sys", ".", "exit", "(", ")", "#meas_file = \"aarm_measurements.txt\"", "#rmag_anis = \...
NAME aarm_magic.py DESCRIPTION Converts AARM data to best-fit tensor (6 elements plus sigma) Original program ARMcrunch written to accomodate ARM anisotropy data collected from 6 axial directions (+X,+Y,+Z,-X,-Y,-Z) using the off-axis remanence terms to construct the t...
[ "NAME", "aarm_magic", ".", "py" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/aarm_magic.py#L7-L75
PmagPy/PmagPy
programs/dmag_magic2.py
main
def main(): """ NAME dmag_magic2.py DESCRIPTION plots intensity decay curves for demagnetization experiments SYNTAX dmag_magic -h [command line options] INPUT takes magic formatted magic_measurements.txt files OPTIONS -h prints help message and quits ...
python
def main(): """ NAME dmag_magic2.py DESCRIPTION plots intensity decay curves for demagnetization experiments SYNTAX dmag_magic -h [command line options] INPUT takes magic formatted magic_measurements.txt files OPTIONS -h prints help message and quits ...
[ "def", "main", "(", ")", ":", "FIG", "=", "{", "}", "# plot dictionary", "FIG", "[", "'demag'", "]", "=", "1", "# demag is figure 1", "in_file", ",", "plot_key", ",", "LT", "=", "'magic_measurements.txt'", ",", "'er_location_name'", ",", "\"LT-AF-Z\"", "XLP", ...
NAME dmag_magic2.py DESCRIPTION plots intensity decay curves for demagnetization experiments SYNTAX dmag_magic -h [command line options] INPUT takes magic formatted magic_measurements.txt files OPTIONS -h prints help message and quits -f FILE: specify in...
[ "NAME", "dmag_magic2", ".", "py" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/dmag_magic2.py#L11-L164
PmagPy/PmagPy
programs/deprecated/mini_magic.py
main
def main(): """ NAME mini_magic.py DESCRIPTION converts the Yale minispin format to magic_measurements format files SYNTAX mini_magic.py [command line options] OPTIONS -h: prints the help message and quits. -usr USER: identify user, default is "" ...
python
def main(): """ NAME mini_magic.py DESCRIPTION converts the Yale minispin format to magic_measurements format files SYNTAX mini_magic.py [command line options] OPTIONS -h: prints the help message and quits. -usr USER: identify user, default is "" ...
[ "def", "main", "(", ")", ":", "args", "=", "sys", ".", "argv", "if", "\"-h\"", "in", "args", ":", "print", "(", "main", ".", "__doc__", ")", "sys", ".", "exit", "(", ")", "# initialize some stuff", "methcode", "=", "\"LP-NO\"", "demag", "=", "\"N\"", ...
NAME mini_magic.py DESCRIPTION converts the Yale minispin format to magic_measurements format files SYNTAX mini_magic.py [command line options] OPTIONS -h: prints the help message and quits. -usr USER: identify user, default is "" -f FILE: specify input f...
[ "NAME", "mini_magic", ".", "py" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/deprecated/mini_magic.py#L7-L78
PmagPy/PmagPy
programs/deprecated/customize_criteria.py
main
def main(): """ NAME customize_criteria.py NB: This program has been deprecated - use demag_gui or thellier_gui to customize acceptance criteria - OR pandas from within a jupyter notebook DESCRIPTION Allows user to specify acceptance criteria, saves them in pmag_criteria...
python
def main(): """ NAME customize_criteria.py NB: This program has been deprecated - use demag_gui or thellier_gui to customize acceptance criteria - OR pandas from within a jupyter notebook DESCRIPTION Allows user to specify acceptance criteria, saves them in pmag_criteria...
[ "def", "main", "(", ")", ":", "infile", ",", "critout", "=", "\"\"", ",", "\"pmag_criteria.txt\"", "# parse command line options", "if", "'-h'", "in", "sys", ".", "argv", ":", "print", "(", "main", ".", "__doc__", ")", "sys", ".", "exit", "(", ")", "if",...
NAME customize_criteria.py NB: This program has been deprecated - use demag_gui or thellier_gui to customize acceptance criteria - OR pandas from within a jupyter notebook DESCRIPTION Allows user to specify acceptance criteria, saves them in pmag_criteria.txt SYNTAX ...
[ "NAME", "customize_criteria", ".", "py", "NB", ":", "This", "program", "has", "been", "deprecated", "-", "use", "demag_gui", "or", "thellier_gui", "to", "customize", "acceptance", "criteria", "-", "OR", "pandas", "from", "within", "a", "jupyter", "notebook" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/deprecated/customize_criteria.py#L7-L72
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.get_DIR
def get_DIR(self, WD=None): """ open dialog box for choosing a working directory """ if "-WD" in sys.argv and FIRST_RUN: ind = sys.argv.index('-WD') self.WD = sys.argv[ind + 1] elif not WD: # if no arg was passed in for WD, make a dialog to choose one ...
python
def get_DIR(self, WD=None): """ open dialog box for choosing a working directory """ if "-WD" in sys.argv and FIRST_RUN: ind = sys.argv.index('-WD') self.WD = sys.argv[ind + 1] elif not WD: # if no arg was passed in for WD, make a dialog to choose one ...
[ "def", "get_DIR", "(", "self", ",", "WD", "=", "None", ")", ":", "if", "\"-WD\"", "in", "sys", ".", "argv", "and", "FIRST_RUN", ":", "ind", "=", "sys", ".", "argv", ".", "index", "(", "'-WD'", ")", "self", ".", "WD", "=", "sys", ".", "argv", "[...
open dialog box for choosing a working directory
[ "open", "dialog", "box", "for", "choosing", "a", "working", "directory" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L465-L495
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.Main_Frame
def Main_Frame(self): """ Build main frame od panel: buttons, etc. choose the first specimen and display data """ #-------------------------------------------------------------------- # initialize first specimen in list as current specimen #----------------------...
python
def Main_Frame(self): """ Build main frame od panel: buttons, etc. choose the first specimen and display data """ #-------------------------------------------------------------------- # initialize first specimen in list as current specimen #----------------------...
[ "def", "Main_Frame", "(", "self", ")", ":", "#--------------------------------------------------------------------", "# initialize first specimen in list as current specimen", "#--------------------------------------------------------------------", "try", ":", "self", ".", "s", "=", "s...
Build main frame od panel: buttons, etc. choose the first specimen and display data
[ "Build", "main", "frame", "od", "panel", ":", "buttons", "etc", ".", "choose", "the", "first", "specimen", "and", "display", "data" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L497-L961
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.on_save_interpretation_button
def on_save_interpretation_button(self, event): """ save the current interpretation temporarily (not to a file) """ if "specimen_int_uT" not in self.Data[self.s]['pars']: return if 'deleted' in self.Data[self.s]['pars']: self.Data[self.s]['pars'].pop('dele...
python
def on_save_interpretation_button(self, event): """ save the current interpretation temporarily (not to a file) """ if "specimen_int_uT" not in self.Data[self.s]['pars']: return if 'deleted' in self.Data[self.s]['pars']: self.Data[self.s]['pars'].pop('dele...
[ "def", "on_save_interpretation_button", "(", "self", ",", "event", ")", ":", "if", "\"specimen_int_uT\"", "not", "in", "self", ".", "Data", "[", "self", ".", "s", "]", "[", "'pars'", "]", ":", "return", "if", "'deleted'", "in", "self", ".", "Data", "[", ...
save the current interpretation temporarily (not to a file)
[ "save", "the", "current", "interpretation", "temporarily", "(", "not", "to", "a", "file", ")" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L963-L993
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.on_delete_interpretation_button
def on_delete_interpretation_button(self, event): """ delete the current interpretation temporarily (not to a file) """ del self.Data[self.s]['pars'] self.Data[self.s]['pars'] = {} self.Data[self.s]['pars']['deleted'] = True self.Data[self.s]['pars']['lab_dc_fiel...
python
def on_delete_interpretation_button(self, event): """ delete the current interpretation temporarily (not to a file) """ del self.Data[self.s]['pars'] self.Data[self.s]['pars'] = {} self.Data[self.s]['pars']['deleted'] = True self.Data[self.s]['pars']['lab_dc_fiel...
[ "def", "on_delete_interpretation_button", "(", "self", ",", "event", ")", ":", "del", "self", ".", "Data", "[", "self", ".", "s", "]", "[", "'pars'", "]", "self", ".", "Data", "[", "self", ".", "s", "]", "[", "'pars'", "]", "=", "{", "}", "self", ...
delete the current interpretation temporarily (not to a file)
[ "delete", "the", "current", "interpretation", "temporarily", "(", "not", "to", "a", "file", ")" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L995-L1027
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.write_acceptance_criteria_to_boxes
def write_acceptance_criteria_to_boxes(self): """ Update paleointensity statistics in acceptance criteria boxes. (after changing temperature bounds or changing specimen) """ self.ignore_parameters, value = {}, '' for crit_short_name in self.preferences['show_statistics_o...
python
def write_acceptance_criteria_to_boxes(self): """ Update paleointensity statistics in acceptance criteria boxes. (after changing temperature bounds or changing specimen) """ self.ignore_parameters, value = {}, '' for crit_short_name in self.preferences['show_statistics_o...
[ "def", "write_acceptance_criteria_to_boxes", "(", "self", ")", ":", "self", ".", "ignore_parameters", ",", "value", "=", "{", "}", ",", "''", "for", "crit_short_name", "in", "self", ".", "preferences", "[", "'show_statistics_on_gui'", "]", ":", "crit", "=", "\...
Update paleointensity statistics in acceptance criteria boxes. (after changing temperature bounds or changing specimen)
[ "Update", "paleointensity", "statistics", "in", "acceptance", "criteria", "boxes", ".", "(", "after", "changing", "temperature", "bounds", "or", "changing", "specimen", ")" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L1079-L1119
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.Add_text
def Add_text(self, s): """ Add text to measurement data window. """ self.logger.DeleteAllItems() FONT_RATIO = self.GUI_RESOLUTION + (self.GUI_RESOLUTION - 1) * 5 if self.GUI_RESOLUTION > 1.1: font1 = wx.Font(11, wx.SWISS, wx.NORMAL, ...
python
def Add_text(self, s): """ Add text to measurement data window. """ self.logger.DeleteAllItems() FONT_RATIO = self.GUI_RESOLUTION + (self.GUI_RESOLUTION - 1) * 5 if self.GUI_RESOLUTION > 1.1: font1 = wx.Font(11, wx.SWISS, wx.NORMAL, ...
[ "def", "Add_text", "(", "self", ",", "s", ")", ":", "self", ".", "logger", ".", "DeleteAllItems", "(", ")", "FONT_RATIO", "=", "self", ".", "GUI_RESOLUTION", "+", "(", "self", ".", "GUI_RESOLUTION", "-", "1", ")", "*", "5", "if", "self", ".", "GUI_RE...
Add text to measurement data window.
[ "Add", "text", "to", "measurement", "data", "window", "." ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L1123-L1233
PmagPy/PmagPy
programs/thellier_gui.py
Arai_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. @param: index - inde...
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. @param: index - inde...
[ "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. @param: index - index of the step to select in the logger
[ "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/thellier_gui.py#L1246-L1296
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.create_menu
def create_menu(self): """ Create menu bar """ self.menubar = wx.MenuBar() menu_preferences = wx.Menu() m_preferences_apperance = menu_preferences.Append( -1, "&Appearence preferences", "") self.Bind(wx.EVT_MENU, self.on_menu_appearance_preferences, ...
python
def create_menu(self): """ Create menu bar """ self.menubar = wx.MenuBar() menu_preferences = wx.Menu() m_preferences_apperance = menu_preferences.Append( -1, "&Appearence preferences", "") self.Bind(wx.EVT_MENU, self.on_menu_appearance_preferences, ...
[ "def", "create_menu", "(", "self", ")", ":", "self", ".", "menubar", "=", "wx", ".", "MenuBar", "(", ")", "menu_preferences", "=", "wx", ".", "Menu", "(", ")", "m_preferences_apperance", "=", "menu_preferences", ".", "Append", "(", "-", "1", ",", "\"&App...
Create menu bar
[ "Create", "menu", "bar" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L1353-L1559
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.update_selection
def update_selection(self): """ update figures and statistics windows with a new selection of specimen """ # clear all boxes self.clear_boxes() self.draw_figure(self.s) # update temperature list if self.Data[self.s]['T_or_MW'] == "T": self.te...
python
def update_selection(self): """ update figures and statistics windows with a new selection of specimen """ # clear all boxes self.clear_boxes() self.draw_figure(self.s) # update temperature list if self.Data[self.s]['T_or_MW'] == "T": self.te...
[ "def", "update_selection", "(", "self", ")", ":", "# clear all boxes", "self", ".", "clear_boxes", "(", ")", "self", ".", "draw_figure", "(", "self", ".", "s", ")", "# update temperature list", "if", "self", ".", "Data", "[", "self", ".", "s", "]", "[", ...
update figures and statistics windows with a new selection of specimen
[ "update", "figures", "and", "statistics", "windows", "with", "a", "new", "selection", "of", "specimen" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L1564-L1590
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.onSelect_specimen
def onSelect_specimen(self, event): """ update figures and text when a new specimen is selected """ new_s = self.specimens_box.GetValue() if self.select_specimen(new_s): self.update_selection() else: self.specimens_box.SetValue(self.s) ...
python
def onSelect_specimen(self, event): """ update figures and text when a new specimen is selected """ new_s = self.specimens_box.GetValue() if self.select_specimen(new_s): self.update_selection() else: self.specimens_box.SetValue(self.s) ...
[ "def", "onSelect_specimen", "(", "self", ",", "event", ")", ":", "new_s", "=", "self", ".", "specimens_box", ".", "GetValue", "(", ")", "if", "self", ".", "select_specimen", "(", "new_s", ")", ":", "self", ".", "update_selection", "(", ")", "else", ":", ...
update figures and text when a new specimen is selected
[ "update", "figures", "and", "text", "when", "a", "new", "specimen", "is", "selected" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L1615-L1625
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.on_info_click
def on_info_click(self, event): """ Show popup info window when user clicks "?" """ def on_close(event, wind): wind.Close() wind.Destroy() event.Skip() wind = wx.PopupTransientWindow(self, wx.RAISED_BORDER) if self.auto_save.GetValue(): ...
python
def on_info_click(self, event): """ Show popup info window when user clicks "?" """ def on_close(event, wind): wind.Close() wind.Destroy() event.Skip() wind = wx.PopupTransientWindow(self, wx.RAISED_BORDER) if self.auto_save.GetValue(): ...
[ "def", "on_info_click", "(", "self", ",", "event", ")", ":", "def", "on_close", "(", "event", ",", "wind", ")", ":", "wind", ".", "Close", "(", ")", "wind", ".", "Destroy", "(", ")", "event", ".", "Skip", "(", ")", "wind", "=", "wx", ".", "PopupT...
Show popup info window when user clicks "?"
[ "Show", "popup", "info", "window", "when", "user", "clicks", "?" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L1683-L1705
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.on_prev_button
def on_prev_button(self, event): """ update figures and text when a previous button is selected """ if 'saved' not in self.Data[self.s]['pars'] or self.Data[self.s]['pars']['saved'] != True: # check preferences if self.auto_save.GetValue(): self.on...
python
def on_prev_button(self, event): """ update figures and text when a previous button is selected """ if 'saved' not in self.Data[self.s]['pars'] or self.Data[self.s]['pars']['saved'] != True: # check preferences if self.auto_save.GetValue(): self.on...
[ "def", "on_prev_button", "(", "self", ",", "event", ")", ":", "if", "'saved'", "not", "in", "self", ".", "Data", "[", "self", ".", "s", "]", "[", "'pars'", "]", "or", "self", ".", "Data", "[", "self", ".", "s", "]", "[", "'pars'", "]", "[", "'s...
update figures and text when a previous button is selected
[ "update", "figures", "and", "text", "when", "a", "previous", "button", "is", "selected" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L1707-L1733
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.clear_boxes
def clear_boxes(self): """ Clear all boxes """ self.tmin_box.Clear() self.tmin_box.SetItems(self.T_list) self.tmin_box.SetSelection(-1) self.tmax_box.Clear() self.tmax_box.SetItems(self.T_list) self.tmax_box.SetSelection(-1) self.Blab_win...
python
def clear_boxes(self): """ Clear all boxes """ self.tmin_box.Clear() self.tmin_box.SetItems(self.T_list) self.tmin_box.SetSelection(-1) self.tmax_box.Clear() self.tmax_box.SetItems(self.T_list) self.tmax_box.SetSelection(-1) self.Blab_win...
[ "def", "clear_boxes", "(", "self", ")", ":", "self", ".", "tmin_box", ".", "Clear", "(", ")", "self", ".", "tmin_box", ".", "SetItems", "(", "self", ".", "T_list", ")", "self", ".", "tmin_box", ".", "SetSelection", "(", "-", "1", ")", "self", ".", ...
Clear all boxes
[ "Clear", "all", "boxes" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L1737-L1775
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.read_preferences_file
def read_preferences_file(self): """ If json preferences file exists, read it in. """ user_data_dir = find_pmag_dir.find_user_data_dir("thellier_gui") if not user_data_dir: return {} if os.path.exists(user_data_dir): pref_file = os.path.join(user_d...
python
def read_preferences_file(self): """ If json preferences file exists, read it in. """ user_data_dir = find_pmag_dir.find_user_data_dir("thellier_gui") if not user_data_dir: return {} if os.path.exists(user_data_dir): pref_file = os.path.join(user_d...
[ "def", "read_preferences_file", "(", "self", ")", ":", "user_data_dir", "=", "find_pmag_dir", ".", "find_user_data_dir", "(", "\"thellier_gui\"", ")", "if", "not", "user_data_dir", ":", "return", "{", "}", "if", "os", ".", "path", ".", "exists", "(", "user_dat...
If json preferences file exists, read it in.
[ "If", "json", "preferences", "file", "exists", "read", "it", "in", "." ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L2174-L2186
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.write_preferences_file
def write_preferences_file(self): """ Write json preferences file to (platform specific) user data directory, or PmagPy directory if appdirs module is missing. """ user_data_dir = find_pmag_dir.find_user_data_dir("thellier_gui") if not os.path.exists(user_data_dir): ...
python
def write_preferences_file(self): """ Write json preferences file to (platform specific) user data directory, or PmagPy directory if appdirs module is missing. """ user_data_dir = find_pmag_dir.find_user_data_dir("thellier_gui") if not os.path.exists(user_data_dir): ...
[ "def", "write_preferences_file", "(", "self", ")", ":", "user_data_dir", "=", "find_pmag_dir", ".", "find_user_data_dir", "(", "\"thellier_gui\"", ")", "if", "not", "os", ".", "path", ".", "exists", "(", "user_data_dir", ")", ":", "find_pmag_dir", ".", "make_use...
Write json preferences file to (platform specific) user data directory, or PmagPy directory if appdirs module is missing.
[ "Write", "json", "preferences", "file", "to", "(", "platform", "specific", ")", "user", "data", "directory", "or", "PmagPy", "directory", "if", "appdirs", "module", "is", "missing", "." ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L2188-L2199
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.on_menu_exit
def on_menu_exit(self, event): """ Runs whenever Thellier GUI exits """ if self.close_warning: TEXT = "Data is not saved to a file yet!\nTo properly save your data:\n1) Analysis --> Save current interpretations to a redo file.\nor\n1) File --> Save MagIC tables.\n\n Press OK ...
python
def on_menu_exit(self, event): """ Runs whenever Thellier GUI exits """ if self.close_warning: TEXT = "Data is not saved to a file yet!\nTo properly save your data:\n1) Analysis --> Save current interpretations to a redo file.\nor\n1) File --> Save MagIC tables.\n\n Press OK ...
[ "def", "on_menu_exit", "(", "self", ",", "event", ")", ":", "if", "self", ".", "close_warning", ":", "TEXT", "=", "\"Data is not saved to a file yet!\\nTo properly save your data:\\n1) Analysis --> Save current interpretations to a redo file.\\nor\\n1) File --> Save MagIC tables.\\n\\n...
Runs whenever Thellier GUI exits
[ "Runs", "whenever", "Thellier", "GUI", "exits" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L2283-L2309
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.on_menu_previous_interpretation
def on_menu_previous_interpretation(self, event): """ Create and show the Open FileDialog for upload previous interpretation input should be a valid "redo file": [specimen name] [tmin(kelvin)] [tmax(kelvin)] """ save_current_specimen = self.s dlg = wx.FileDialog( ...
python
def on_menu_previous_interpretation(self, event): """ Create and show the Open FileDialog for upload previous interpretation input should be a valid "redo file": [specimen name] [tmin(kelvin)] [tmax(kelvin)] """ save_current_specimen = self.s dlg = wx.FileDialog( ...
[ "def", "on_menu_previous_interpretation", "(", "self", ",", "event", ")", ":", "save_current_specimen", "=", "self", ".", "s", "dlg", "=", "wx", ".", "FileDialog", "(", "self", ",", "message", "=", "\"choose a file in a pmagpy redo format\"", ",", "defaultDir", "=...
Create and show the Open FileDialog for upload previous interpretation input should be a valid "redo file": [specimen name] [tmin(kelvin)] [tmax(kelvin)]
[ "Create", "and", "show", "the", "Open", "FileDialog", "for", "upload", "previous", "interpretation", "input", "should", "be", "a", "valid", "redo", "file", ":", "[", "specimen", "name", "]", "[", "tmin", "(", "kelvin", ")", "]", "[", "tmax", "(", "kelvin...
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L2420-L2444
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.on_menu_criteria_file
def on_menu_criteria_file(self, event): """ read pmag_criteria.txt file and open change criteria dialog """ if self.data_model == 3: dlg = wx.FileDialog( self, message="choose a file in MagIC Data Model 3.0 format", defaultDir=self.WD,...
python
def on_menu_criteria_file(self, event): """ read pmag_criteria.txt file and open change criteria dialog """ if self.data_model == 3: dlg = wx.FileDialog( self, message="choose a file in MagIC Data Model 3.0 format", defaultDir=self.WD,...
[ "def", "on_menu_criteria_file", "(", "self", ",", "event", ")", ":", "if", "self", ".", "data_model", "==", "3", ":", "dlg", "=", "wx", ".", "FileDialog", "(", "self", ",", "message", "=", "\"choose a file in MagIC Data Model 3.0 format\"", ",", "defaultDir", ...
read pmag_criteria.txt file and open change criteria dialog
[ "read", "pmag_criteria", ".", "txt", "file", "and", "open", "change", "criteria", "dialog" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L2617-L2704
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.on_menu_criteria
def on_menu_criteria(self, event): """ Change acceptance criteria and save it to the criteria file (data_model=2: pmag_criteria.txt; data_model=3: criteria.txt) """ dia = thellier_gui_dialogs.Criteria_Dialog( None, self.acceptance_criteria, self.preferences, title='S...
python
def on_menu_criteria(self, event): """ Change acceptance criteria and save it to the criteria file (data_model=2: pmag_criteria.txt; data_model=3: criteria.txt) """ dia = thellier_gui_dialogs.Criteria_Dialog( None, self.acceptance_criteria, self.preferences, title='S...
[ "def", "on_menu_criteria", "(", "self", ",", "event", ")", ":", "dia", "=", "thellier_gui_dialogs", ".", "Criteria_Dialog", "(", "None", ",", "self", ".", "acceptance_criteria", ",", "self", ".", "preferences", ",", "title", "=", "'Set Acceptance Criteria'", ")"...
Change acceptance criteria and save it to the criteria file (data_model=2: pmag_criteria.txt; data_model=3: criteria.txt)
[ "Change", "acceptance", "criteria", "and", "save", "it", "to", "the", "criteria", "file", "(", "data_model", "=", "2", ":", "pmag_criteria", ".", "txt", ";", "data_model", "=", "3", ":", "criteria", ".", "txt", ")" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L2708-L2720
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.On_close_criteria_box
def On_close_criteria_box(self, dia): """ after criteria dialog window is closed. Take the acceptance criteria values and update self.acceptance_criteria """ criteria_list = list(self.acceptance_criteria.keys()) criteria_list.sort() #---------------------...
python
def On_close_criteria_box(self, dia): """ after criteria dialog window is closed. Take the acceptance criteria values and update self.acceptance_criteria """ criteria_list = list(self.acceptance_criteria.keys()) criteria_list.sort() #---------------------...
[ "def", "On_close_criteria_box", "(", "self", ",", "dia", ")", ":", "criteria_list", "=", "list", "(", "self", ".", "acceptance_criteria", ".", "keys", "(", ")", ")", "criteria_list", ".", "sort", "(", ")", "#---------------------------------------", "# check if av...
after criteria dialog window is closed. Take the acceptance criteria values and update self.acceptance_criteria
[ "after", "criteria", "dialog", "window", "is", "closed", ".", "Take", "the", "acceptance", "criteria", "values", "and", "update", "self", ".", "acceptance_criteria" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L2722-L2794
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.recalculate_satistics
def recalculate_satistics(self): ''' update self.Data[specimen]['pars'] for all specimens. ''' gframe = wx.BusyInfo( "Re-calculating statistics for all specimens\n Please wait..", self) for specimen in list(self.Data.keys()): if 'pars' not in list(self.Da...
python
def recalculate_satistics(self): ''' update self.Data[specimen]['pars'] for all specimens. ''' gframe = wx.BusyInfo( "Re-calculating statistics for all specimens\n Please wait..", self) for specimen in list(self.Data.keys()): if 'pars' not in list(self.Da...
[ "def", "recalculate_satistics", "(", "self", ")", ":", "gframe", "=", "wx", ".", "BusyInfo", "(", "\"Re-calculating statistics for all specimens\\n Please wait..\"", ",", "self", ")", "for", "specimen", "in", "list", "(", "self", ".", "Data", ".", "keys", "(", "...
update self.Data[specimen]['pars'] for all specimens.
[ "update", "self", ".", "Data", "[", "specimen", "]", "[", "pars", "]", "for", "all", "specimens", "." ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L2800-L2820
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.read_criteria_file
def read_criteria_file(self, criteria_file): ''' read criteria file. initialize self.acceptance_criteria try to guess if averaging by sample or by site. ''' if self.data_model == 3: self.acceptance_criteria = pmag.initialize_acceptance_criteria( ...
python
def read_criteria_file(self, criteria_file): ''' read criteria file. initialize self.acceptance_criteria try to guess if averaging by sample or by site. ''' if self.data_model == 3: self.acceptance_criteria = pmag.initialize_acceptance_criteria( ...
[ "def", "read_criteria_file", "(", "self", ",", "criteria_file", ")", ":", "if", "self", ".", "data_model", "==", "3", ":", "self", ".", "acceptance_criteria", "=", "pmag", ".", "initialize_acceptance_criteria", "(", "data_model", "=", "self", ".", "data_model", ...
read criteria file. initialize self.acceptance_criteria try to guess if averaging by sample or by site.
[ "read", "criteria", "file", ".", "initialize", "self", ".", "acceptance_criteria", "try", "to", "guess", "if", "averaging", "by", "sample", "or", "by", "site", "." ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L2824-L2884
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.on_menu_save_interpretation
def on_menu_save_interpretation(self, event): ''' save interpretations to a redo file ''' thellier_gui_redo_file = open( os.path.join(self.WD, "thellier_GUI.redo"), 'w') #-------------------------------------------------- # write interpretations to thellier...
python
def on_menu_save_interpretation(self, event): ''' save interpretations to a redo file ''' thellier_gui_redo_file = open( os.path.join(self.WD, "thellier_GUI.redo"), 'w') #-------------------------------------------------- # write interpretations to thellier...
[ "def", "on_menu_save_interpretation", "(", "self", ",", "event", ")", ":", "thellier_gui_redo_file", "=", "open", "(", "os", ".", "path", ".", "join", "(", "self", ".", "WD", ",", "\"thellier_GUI.redo\"", ")", ",", "'w'", ")", "#---------------------------------...
save interpretations to a redo file
[ "save", "interpretations", "to", "a", "redo", "file" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L2886-L2918
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.on_menu_clear_interpretation
def on_menu_clear_interpretation(self, event): ''' clear all current interpretations. ''' # delete all previous interpretation for sp in list(self.Data.keys()): del self.Data[sp]['pars'] self.Data[sp]['pars'] = {} self.Data[sp]['pars']['lab_d...
python
def on_menu_clear_interpretation(self, event): ''' clear all current interpretations. ''' # delete all previous interpretation for sp in list(self.Data.keys()): del self.Data[sp]['pars'] self.Data[sp]['pars'] = {} self.Data[sp]['pars']['lab_d...
[ "def", "on_menu_clear_interpretation", "(", "self", ",", "event", ")", ":", "# delete all previous interpretation", "for", "sp", "in", "list", "(", "self", ".", "Data", ".", "keys", "(", ")", ")", ":", "del", "self", ".", "Data", "[", "sp", "]", "[", "'...
clear all current interpretations.
[ "clear", "all", "current", "interpretations", "." ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L2920-L2937
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.read_redo_file
def read_redo_file(self, redo_file): """ Read previous interpretation from a redo file and update gui with the new interpretation """ self.GUI_log.write( "-I- reading redo file and processing new temperature bounds") self.redo_specimens = {} # first de...
python
def read_redo_file(self, redo_file): """ Read previous interpretation from a redo file and update gui with the new interpretation """ self.GUI_log.write( "-I- reading redo file and processing new temperature bounds") self.redo_specimens = {} # first de...
[ "def", "read_redo_file", "(", "self", ",", "redo_file", ")", ":", "self", ".", "GUI_log", ".", "write", "(", "\"-I- reading redo file and processing new temperature bounds\"", ")", "self", ".", "redo_specimens", "=", "{", "}", "# first delete all previous interpretation",...
Read previous interpretation from a redo file and update gui with the new interpretation
[ "Read", "previous", "interpretation", "from", "a", "redo", "file", "and", "update", "gui", "with", "the", "new", "interpretation" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L3683-L3755
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.on_menu_prepare_magic_results_tables
def on_menu_prepare_magic_results_tables(self, event): """ Menubar --> File --> Save MagIC tables """ # write a redo file try: self.on_menu_save_interpretation(None) except Exception as ex: print('-W-', ex) pass if self.data_mod...
python
def on_menu_prepare_magic_results_tables(self, event): """ Menubar --> File --> Save MagIC tables """ # write a redo file try: self.on_menu_save_interpretation(None) except Exception as ex: print('-W-', ex) pass if self.data_mod...
[ "def", "on_menu_prepare_magic_results_tables", "(", "self", ",", "event", ")", ":", "# write a redo file", "try", ":", "self", ".", "on_menu_save_interpretation", "(", "None", ")", "except", "Exception", "as", "ex", ":", "print", "(", "'-W-'", ",", "ex", ")", ...
Menubar --> File --> Save MagIC tables
[ "Menubar", "--", ">", "File", "--", ">", "Save", "MagIC", "tables" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L3791-L4588
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.read_er_ages_file
def read_er_ages_file(self, path, ignore_lines_n, sort_by_these_names): ''' read er_ages, sort it by site or sample (the header that is not empty) and convert ages to calendar year ''' DATA = {} fin = open(path, 'r') # ignore first lines for i in range(ig...
python
def read_er_ages_file(self, path, ignore_lines_n, sort_by_these_names): ''' read er_ages, sort it by site or sample (the header that is not empty) and convert ages to calendar year ''' DATA = {} fin = open(path, 'r') # ignore first lines for i in range(ig...
[ "def", "read_er_ages_file", "(", "self", ",", "path", ",", "ignore_lines_n", ",", "sort_by_these_names", ")", ":", "DATA", "=", "{", "}", "fin", "=", "open", "(", "path", ",", "'r'", ")", "# ignore first lines", "for", "i", "in", "range", "(", "ignore_line...
read er_ages, sort it by site or sample (the header that is not empty) and convert ages to calendar year
[ "read", "er_ages", "sort", "it", "by", "site", "or", "sample", "(", "the", "header", "that", "is", "not", "empty", ")", "and", "convert", "ages", "to", "calendar", "year" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L4629-L4658
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.calculate_sample_mean
def calculate_sample_mean(self, Data_sample_or_site): ''' Data_sample_or_site is a dictonary holding the samples_or_sites mean Data_sample_or_site ={} Data_sample_or_site[specimen]=B (in units of microT) ''' pars = {} tmp_B = [] for spec in list(Data_samp...
python
def calculate_sample_mean(self, Data_sample_or_site): ''' Data_sample_or_site is a dictonary holding the samples_or_sites mean Data_sample_or_site ={} Data_sample_or_site[specimen]=B (in units of microT) ''' pars = {} tmp_B = [] for spec in list(Data_samp...
[ "def", "calculate_sample_mean", "(", "self", ",", "Data_sample_or_site", ")", ":", "pars", "=", "{", "}", "tmp_B", "=", "[", "]", "for", "spec", "in", "list", "(", "Data_sample_or_site", ".", "keys", "(", ")", ")", ":", "if", "'B'", "in", "list", "(", ...
Data_sample_or_site is a dictonary holding the samples_or_sites mean Data_sample_or_site ={} Data_sample_or_site[specimen]=B (in units of microT)
[ "Data_sample_or_site", "is", "a", "dictonary", "holding", "the", "samples_or_sites", "mean", "Data_sample_or_site", "=", "{}", "Data_sample_or_site", "[", "specimen", "]", "=", "B", "(", "in", "units", "of", "microT", ")" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L4673-L4775
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.convert_ages_to_calendar_year
def convert_ages_to_calendar_year(self, er_ages_rec): ''' convert all age units to calendar year ''' if ("age" not in list(er_ages_rec.keys())) or (cb.is_null(er_ages_rec['age'], False)): return(er_ages_rec) if ("age_unit" not in list(er_ages_rec.keys())) or (cb.is_nu...
python
def convert_ages_to_calendar_year(self, er_ages_rec): ''' convert all age units to calendar year ''' if ("age" not in list(er_ages_rec.keys())) or (cb.is_null(er_ages_rec['age'], False)): return(er_ages_rec) if ("age_unit" not in list(er_ages_rec.keys())) or (cb.is_nu...
[ "def", "convert_ages_to_calendar_year", "(", "self", ",", "er_ages_rec", ")", ":", "if", "(", "\"age\"", "not", "in", "list", "(", "er_ages_rec", ".", "keys", "(", ")", ")", ")", "or", "(", "cb", ".", "is_null", "(", "er_ages_rec", "[", "'age'", "]", "...
convert all age units to calendar year
[ "convert", "all", "age", "units", "to", "calendar", "year" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L4777-L4839
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.get_new_T_PI_parameters
def get_new_T_PI_parameters(self, event): """ calcualte statisics when temperatures are selected """ # remember the last saved interpretation if "saved" in list(self.pars.keys()): if self.pars['saved']: self.last_saved_pars = {} for ke...
python
def get_new_T_PI_parameters(self, event): """ calcualte statisics when temperatures are selected """ # remember the last saved interpretation if "saved" in list(self.pars.keys()): if self.pars['saved']: self.last_saved_pars = {} for ke...
[ "def", "get_new_T_PI_parameters", "(", "self", ",", "event", ")", ":", "# remember the last saved interpretation", "if", "\"saved\"", "in", "list", "(", "self", ".", "pars", ".", "keys", "(", ")", ")", ":", "if", "self", ".", "pars", "[", "'saved'", "]", "...
calcualte statisics when temperatures are selected
[ "calcualte", "statisics", "when", "temperatures", "are", "selected" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L6066-L6102
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.add_thellier_gui_criteria
def add_thellier_gui_criteria(self): '''criteria used only in thellier gui these criteria are not written to pmag_criteria.txt ''' category = "thellier_gui" for crit in ['sample_int_n_outlier_check', 'site_int_n_outlier_check']: self.acceptance_criteria[crit] = {} ...
python
def add_thellier_gui_criteria(self): '''criteria used only in thellier gui these criteria are not written to pmag_criteria.txt ''' category = "thellier_gui" for crit in ['sample_int_n_outlier_check', 'site_int_n_outlier_check']: self.acceptance_criteria[crit] = {} ...
[ "def", "add_thellier_gui_criteria", "(", "self", ")", ":", "category", "=", "\"thellier_gui\"", "for", "crit", "in", "[", "'sample_int_n_outlier_check'", ",", "'site_int_n_outlier_check'", "]", ":", "self", ".", "acceptance_criteria", "[", "crit", "]", "=", "{", "...
criteria used only in thellier gui these criteria are not written to pmag_criteria.txt
[ "criteria", "used", "only", "in", "thellier", "gui", "these", "criteria", "are", "not", "written", "to", "pmag_criteria", ".", "txt" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L6383-L6433
PmagPy/PmagPy
programs/thellier_gui.py
Arai_GUI.sortarai
def sortarai(self, datablock, s, Zdiff): """ sorts data block in to first_Z, first_I, etc. """ first_Z, first_I, zptrm_check, ptrm_check, ptrm_tail = [], [], [], [], [] field, phi, theta = "", "", "" starthere = 0 Treat_I, Treat_Z, Treat_PZ, Treat_PI, Treat_M, Tr...
python
def sortarai(self, datablock, s, Zdiff): """ sorts data block in to first_Z, first_I, etc. """ first_Z, first_I, zptrm_check, ptrm_check, ptrm_tail = [], [], [], [], [] field, phi, theta = "", "", "" starthere = 0 Treat_I, Treat_Z, Treat_PZ, Treat_PI, Treat_M, Tr...
[ "def", "sortarai", "(", "self", ",", "datablock", ",", "s", ",", "Zdiff", ")", ":", "first_Z", ",", "first_I", ",", "zptrm_check", ",", "ptrm_check", ",", "ptrm_tail", "=", "[", "]", ",", "[", "]", ",", "[", "]", ",", "[", "]", ",", "[", "]", "...
sorts data block in to first_Z, first_I, etc.
[ "sorts", "data", "block", "in", "to", "first_Z", "first_I", "etc", "." ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_gui.py#L7913-L8290
PmagPy/PmagPy
programs/cart_dir.py
main
def main(): """ NAME cart_dir.py DESCRIPTION converts cartesian coordinates to geomagnetic elements INPUT (COMMAND LINE ENTRY) x1 x2 x3 if only two columns, assumes magnitude of unity OUTPUT declination inclination magnitude SYNTAX ...
python
def main(): """ NAME cart_dir.py DESCRIPTION converts cartesian coordinates to geomagnetic elements INPUT (COMMAND LINE ENTRY) x1 x2 x3 if only two columns, assumes magnitude of unity OUTPUT declination inclination magnitude SYNTAX ...
[ "def", "main", "(", ")", ":", "ofile", "=", "\"\"", "if", "'-h'", "in", "sys", ".", "argv", ":", "print", "(", "main", ".", "__doc__", ")", "sys", ".", "exit", "(", ")", "if", "'-F'", "in", "sys", ".", "argv", ":", "ind", "=", "sys", ".", "ar...
NAME cart_dir.py DESCRIPTION converts cartesian coordinates to geomagnetic elements INPUT (COMMAND LINE ENTRY) x1 x2 x3 if only two columns, assumes magnitude of unity OUTPUT declination inclination magnitude SYNTAX cart_dir.py [comman...
[ "NAME", "cart_dir", ".", "py", "DESCRIPTION", "converts", "cartesian", "coordinates", "to", "geomagnetic", "elements", "INPUT", "(", "COMMAND", "LINE", "ENTRY", ")", "x1", "x2", "x3", "if", "only", "two", "columns", "assumes", "magnitude", "of", "unity", "OUTP...
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/cart_dir.py#L8-L74
PmagPy/PmagPy
programs/deprecated/susar4_asc_magic.py
main
def main(): """ NAME susar4-asc_magic.py DESCRIPTION converts ascii files generated by SUSAR ver.4.0 to MagIC formated files for use with PmagPy plotting software SYNTAX susar4-asc_magic.py -h [command line options] OPTIONS -h: prints the help message and q...
python
def main(): """ NAME susar4-asc_magic.py DESCRIPTION converts ascii files generated by SUSAR ver.4.0 to MagIC formated files for use with PmagPy plotting software SYNTAX susar4-asc_magic.py -h [command line options] OPTIONS -h: prints the help message and q...
[ "def", "main", "(", ")", ":", "citation", "=", "'This study'", "cont", "=", "0", "samp_con", ",", "Z", "=", "\"1\"", ",", "1", "AniRecSs", ",", "AniRecs", ",", "SpecRecs", ",", "SampRecs", ",", "SiteRecs", ",", "MeasRecs", "=", "[", "]", ",", "[", ...
NAME susar4-asc_magic.py DESCRIPTION converts ascii files generated by SUSAR ver.4.0 to MagIC formated files for use with PmagPy plotting software SYNTAX susar4-asc_magic.py -h [command line options] OPTIONS -h: prints the help message and quits -f FILE: sp...
[ "NAME", "susar4", "-", "asc_magic", ".", "py" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/deprecated/susar4_asc_magic.py#L6-L297
PmagPy/PmagPy
programs/histplot.py
main
def main(): """ NAME histplot.py DESCRIPTION makes histograms for data OPTIONS -h prints help message and quits -f input file name -b binsize -fmt [svg,png,pdf,eps,jpg] specify format for image, default is svg -sav save figure and quit -F output ...
python
def main(): """ NAME histplot.py DESCRIPTION makes histograms for data OPTIONS -h prints help message and quits -f input file name -b binsize -fmt [svg,png,pdf,eps,jpg] specify format for image, default is svg -sav save figure and quit -F output ...
[ "def", "main", "(", ")", ":", "save_plots", "=", "False", "if", "'-sav'", "in", "sys", ".", "argv", ":", "save_plots", "=", "True", "interactive", "=", "False", "if", "'-h'", "in", "sys", ".", "argv", ":", "print", "(", "main", ".", "__doc__", ")", ...
NAME histplot.py DESCRIPTION makes histograms for data OPTIONS -h prints help message and quits -f input file name -b binsize -fmt [svg,png,pdf,eps,jpg] specify format for image, default is svg -sav save figure and quit -F output file name, default is hi...
[ "NAME", "histplot", ".", "py" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/histplot.py#L14-L69
PmagPy/PmagPy
pmagpy/command_line_extractor.py
extract_args
def extract_args(argv): """ take sys.argv that is used to call a command-line script and return a correctly split list of arguments for example, this input: ["eqarea.py", "-f", "infile", "-F", "outfile", "-A"] will return this output: [['f', 'infile'], ['F', 'outfile'], ['A']] """ string = " ".j...
python
def extract_args(argv): """ take sys.argv that is used to call a command-line script and return a correctly split list of arguments for example, this input: ["eqarea.py", "-f", "infile", "-F", "outfile", "-A"] will return this output: [['f', 'infile'], ['F', 'outfile'], ['A']] """ string = " ".j...
[ "def", "extract_args", "(", "argv", ")", ":", "string", "=", "\" \"", ".", "join", "(", "argv", ")", "string", "=", "string", ".", "split", "(", "' -'", ")", "program", "=", "string", "[", "0", "]", "arguments", "=", "[", "s", ".", "split", "(", ...
take sys.argv that is used to call a command-line script and return a correctly split list of arguments for example, this input: ["eqarea.py", "-f", "infile", "-F", "outfile", "-A"] will return this output: [['f', 'infile'], ['F', 'outfile'], ['A']]
[ "take", "sys", ".", "argv", "that", "is", "used", "to", "call", "a", "command", "-", "line", "script", "and", "return", "a", "correctly", "split", "list", "of", "arguments", "for", "example", "this", "input", ":", "[", "eqarea", ".", "py", "-", "f", ...
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/command_line_extractor.py#L38-L48
PmagPy/PmagPy
pmagpy/command_line_extractor.py
check_args
def check_args(arguments, data_frame): """ check arguments against a command_line_dataframe. checks that: all arguments are valid all required arguments are present default values are used where needed """ stripped_args = [a[0] for a in arguments] df = data_frame.df # first make ...
python
def check_args(arguments, data_frame): """ check arguments against a command_line_dataframe. checks that: all arguments are valid all required arguments are present default values are used where needed """ stripped_args = [a[0] for a in arguments] df = data_frame.df # first make ...
[ "def", "check_args", "(", "arguments", ",", "data_frame", ")", ":", "stripped_args", "=", "[", "a", "[", "0", "]", "for", "a", "in", "arguments", "]", "df", "=", "data_frame", ".", "df", "# first make sure all args are valid", "for", "a", "in", "arguments", ...
check arguments against a command_line_dataframe. checks that: all arguments are valid all required arguments are present default values are used where needed
[ "check", "arguments", "against", "a", "command_line_dataframe", ".", "checks", "that", ":", "all", "arguments", "are", "valid", "all", "required", "arguments", "are", "present", "default", "values", "are", "used", "where", "needed" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/command_line_extractor.py#L50-L83
PmagPy/PmagPy
dialogs/drop_down_menus3.py
Menus.InitUI
def InitUI(self): """ Initialize interface for drop down menu """ if self.data_type in ['orient', 'ages']: belongs_to = [] else: parent_table_name = self.parent_type + "s" if parent_table_name in self.contribution.tables: belong...
python
def InitUI(self): """ Initialize interface for drop down menu """ if self.data_type in ['orient', 'ages']: belongs_to = [] else: parent_table_name = self.parent_type + "s" if parent_table_name in self.contribution.tables: belong...
[ "def", "InitUI", "(", "self", ")", ":", "if", "self", ".", "data_type", "in", "[", "'orient'", ",", "'ages'", "]", ":", "belongs_to", "=", "[", "]", "else", ":", "parent_table_name", "=", "self", ".", "parent_type", "+", "\"s\"", "if", "parent_table_name...
Initialize interface for drop down menu
[ "Initialize", "interface", "for", "drop", "down", "menu" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/drop_down_menus3.py#L51-L87
PmagPy/PmagPy
dialogs/drop_down_menus3.py
Menus.add_drop_down
def add_drop_down(self, col_number, col_label): """ Add a correctly formatted drop-down-menu for given col_label, if required or suggested. Otherwise do nothing. Parameters ---------- col_number : int grid position at which to add a drop down menu...
python
def add_drop_down(self, col_number, col_label): """ Add a correctly formatted drop-down-menu for given col_label, if required or suggested. Otherwise do nothing. Parameters ---------- col_number : int grid position at which to add a drop down menu...
[ "def", "add_drop_down", "(", "self", ",", "col_number", ",", "col_label", ")", ":", "if", "col_label", ".", "endswith", "(", "'**'", ")", "or", "col_label", ".", "endswith", "(", "'^^'", ")", ":", "col_label", "=", "col_label", "[", ":", "-", "2", "]",...
Add a correctly formatted drop-down-menu for given col_label, if required or suggested. Otherwise do nothing. Parameters ---------- col_number : int grid position at which to add a drop down menu col_label : str column name
[ "Add", "a", "correctly", "formatted", "drop", "-", "down", "-", "menu", "for", "given", "col_label", "if", "required", "or", "suggested", ".", "Otherwise", "do", "nothing", "." ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/drop_down_menus3.py#L96-L172
PmagPy/PmagPy
dialogs/drop_down_menus3.py
Menus.add_method_drop_down
def add_method_drop_down(self, col_number, col_label): """ Add drop-down-menu options for magic_method_codes columns """ if self.data_type == 'ages': method_list = self.contribution.vocab.age_methods else: method_list = self.contribution.vocab.age_methods....
python
def add_method_drop_down(self, col_number, col_label): """ Add drop-down-menu options for magic_method_codes columns """ if self.data_type == 'ages': method_list = self.contribution.vocab.age_methods else: method_list = self.contribution.vocab.age_methods....
[ "def", "add_method_drop_down", "(", "self", ",", "col_number", ",", "col_label", ")", ":", "if", "self", ".", "data_type", "==", "'ages'", ":", "method_list", "=", "self", ".", "contribution", ".", "vocab", ".", "age_methods", "else", ":", "method_list", "="...
Add drop-down-menu options for magic_method_codes columns
[ "Add", "drop", "-", "down", "-", "menu", "options", "for", "magic_method_codes", "columns" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/drop_down_menus3.py#L174-L183
PmagPy/PmagPy
dialogs/drop_down_menus3.py
Menus.on_left_click
def on_left_click(self, event, grid, choices): """ creates popup menu when user clicks on the column if that column is in the list of choices that get a drop-down menu. allows user to edit the column, but only from available values """ row, col = event.GetRow(), event.Get...
python
def on_left_click(self, event, grid, choices): """ creates popup menu when user clicks on the column if that column is in the list of choices that get a drop-down menu. allows user to edit the column, but only from available values """ row, col = event.GetRow(), event.Get...
[ "def", "on_left_click", "(", "self", ",", "event", ",", "grid", ",", "choices", ")", ":", "row", ",", "col", "=", "event", ".", "GetRow", "(", ")", ",", "event", ".", "GetCol", "(", ")", "if", "col", "==", "0", "and", "self", ".", "grid", ".", ...
creates popup menu when user clicks on the column if that column is in the list of choices that get a drop-down menu. allows user to edit the column, but only from available values
[ "creates", "popup", "menu", "when", "user", "clicks", "on", "the", "column", "if", "that", "column", "is", "in", "the", "list", "of", "choices", "that", "get", "a", "drop", "-", "down", "menu", ".", "allows", "user", "to", "edit", "the", "column", "but...
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/drop_down_menus3.py#L284-L397
PmagPy/PmagPy
programs/di_tilt.py
main
def main(): """ NAME di_tilt.py DESCRIPTION rotates geographic coordinate dec, inc data to stratigraphic coordinates using the dip and dip direction (strike+90, dip if dip to right of strike) INPUT FORMAT declination inclination dip_direction dip SYNTAX di_til...
python
def main(): """ NAME di_tilt.py DESCRIPTION rotates geographic coordinate dec, inc data to stratigraphic coordinates using the dip and dip direction (strike+90, dip if dip to right of strike) INPUT FORMAT declination inclination dip_direction dip SYNTAX di_til...
[ "def", "main", "(", ")", ":", "if", "'-h'", "in", "sys", ".", "argv", ":", "print", "(", "main", ".", "__doc__", ")", "sys", ".", "exit", "(", ")", "if", "'-F'", "in", "sys", ".", "argv", ":", "ind", "=", "sys", ".", "argv", ".", "index", "("...
NAME di_tilt.py DESCRIPTION rotates geographic coordinate dec, inc data to stratigraphic coordinates using the dip and dip direction (strike+90, dip if dip to right of strike) INPUT FORMAT declination inclination dip_direction dip SYNTAX di_tilt.py [-h][-i][-f FILE] [...
[ "NAME", "di_tilt", ".", "py" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/di_tilt.py#L9-L65
PmagPy/PmagPy
programs/convert2unix.py
main
def main(): """ NAME convert2unix.py DESCRIPTION converts mac or dos formatted file to unix file in place SYNTAX convert2unix.py FILE OPTIONS -h prints help and quits """ if '-h' in sys.argv: print(main.__doc__) sys.exit() ...
python
def main(): """ NAME convert2unix.py DESCRIPTION converts mac or dos formatted file to unix file in place SYNTAX convert2unix.py FILE OPTIONS -h prints help and quits """ if '-h' in sys.argv: print(main.__doc__) sys.exit() ...
[ "def", "main", "(", ")", ":", "if", "'-h'", "in", "sys", ".", "argv", ":", "print", "(", "main", ".", "__doc__", ")", "sys", ".", "exit", "(", ")", "file", "=", "sys", ".", "argv", "[", "1", "]", "f", "=", "open", "(", "file", ",", "'r'", "...
NAME convert2unix.py DESCRIPTION converts mac or dos formatted file to unix file in place SYNTAX convert2unix.py FILE OPTIONS -h prints help and quits
[ "NAME", "convert2unix", ".", "py", "DESCRIPTION", "converts", "mac", "or", "dos", "formatted", "file", "to", "unix", "file", "in", "place", "SYNTAX", "convert2unix", ".", "py", "FILE", "OPTIONS", "-", "h", "prints", "help", "and", "quits" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/convert2unix.py#L5-L30
PmagPy/PmagPy
programs/igrf.py
main
def main(): """ NAME igrf.py DESCRIPTION This program calculates igrf field values using the routine of Malin and Barraclough (1981) based on d/igrfs from 1900 to 2010. between 1900 and 1000BCE, it uses CALS3K.4, ARCH3K.1 Prior to 1000BCE, it uses PFM9k or CALS10k-4b Cal...
python
def main(): """ NAME igrf.py DESCRIPTION This program calculates igrf field values using the routine of Malin and Barraclough (1981) based on d/igrfs from 1900 to 2010. between 1900 and 1000BCE, it uses CALS3K.4, ARCH3K.1 Prior to 1000BCE, it uses PFM9k or CALS10k-4b Cal...
[ "def", "main", "(", ")", ":", "plot", ",", "fmt", "=", "0", ",", "'svg'", "mod", ",", "alt", ",", "make_plot", ",", "lat", ",", "lon", "=", "'cals10k'", ",", "0", ",", "0", ",", "0", ",", "0", "if", "'-loc'", "in", "sys", ".", "argv", ":", ...
NAME igrf.py DESCRIPTION This program calculates igrf field values using the routine of Malin and Barraclough (1981) based on d/igrfs from 1900 to 2010. between 1900 and 1000BCE, it uses CALS3K.4, ARCH3K.1 Prior to 1000BCE, it uses PFM9k or CALS10k-4b Calculates reference field ...
[ "NAME", "igrf", ".", "py", "DESCRIPTION", "This", "program", "calculates", "igrf", "field", "values", "using", "the", "routine", "of", "Malin", "and", "Barraclough", "(", "1981", ")", "based", "on", "d", "/", "igrfs", "from", "1900", "to", "2010", ".", "...
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/igrf.py#L15-L190
PmagPy/PmagPy
programs/vgpmap_magic2.py
main
def main(): """ NAME vgpmap_magic.py DESCRIPTION makes a map of vgps and a95/dp,dm for site means in a pmag_results table SYNTAX vgpmap_magic.py [command line options] OPTIONS -h prints help and quits -eye ELAT ELON [specify eyeball location], default is 9...
python
def main(): """ NAME vgpmap_magic.py DESCRIPTION makes a map of vgps and a95/dp,dm for site means in a pmag_results table SYNTAX vgpmap_magic.py [command line options] OPTIONS -h prints help and quits -eye ELAT ELON [specify eyeball location], default is 9...
[ "def", "main", "(", ")", ":", "dir_path", "=", "'.'", "res", ",", "ages", "=", "'c'", ",", "0", "plot", "=", "0", "proj", "=", "'ortho'", "results_file", "=", "'pmag_results.txt'", "ell", ",", "flip", "=", "0", ",", "0", "lat_0", ",", "lon_0", "=",...
NAME vgpmap_magic.py DESCRIPTION makes a map of vgps and a95/dp,dm for site means in a pmag_results table SYNTAX vgpmap_magic.py [command line options] OPTIONS -h prints help and quits -eye ELAT ELON [specify eyeball location], default is 90., 0. -f FILE p...
[ "NAME", "vgpmap_magic", ".", "py" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/vgpmap_magic2.py#L13-L251
PmagPy/PmagPy
programs/gokent.py
main
def main(): """ NAME gokent.py DESCRIPTION calculates Kent parameters from dec inc data INPUT FORMAT takes dec/inc as first two columns in space delimited file SYNTAX gokent.py [options] OPTIONS -h prints help message and quits -i for interactive f...
python
def main(): """ NAME gokent.py DESCRIPTION calculates Kent parameters from dec inc data INPUT FORMAT takes dec/inc as first two columns in space delimited file SYNTAX gokent.py [options] OPTIONS -h prints help message and quits -i for interactive f...
[ "def", "main", "(", ")", ":", "if", "len", "(", "sys", ".", "argv", ")", ">", "0", ":", "if", "'-h'", "in", "sys", ".", "argv", ":", "# check if help is needed", "print", "(", "main", ".", "__doc__", ")", "sys", ".", "exit", "(", ")", "# graceful q...
NAME gokent.py DESCRIPTION calculates Kent parameters from dec inc data INPUT FORMAT takes dec/inc as first two columns in space delimited file SYNTAX gokent.py [options] OPTIONS -h prints help message and quits -i for interactive filename entry -f...
[ "NAME", "gokent", ".", "py" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/gokent.py#L7-L65
PmagPy/PmagPy
pmagpy/pmagplotlib.py
draw_figs
def draw_figs(FIGS): """ Can only be used if matplotlib backend is set to TKAgg Does not play well with wxPython Parameters _________ FIGS : dictionary of figure names as keys and numbers as values """ is_win = True if sys.platform in ['win32', 'win64'] else False if not is_win: ...
python
def draw_figs(FIGS): """ Can only be used if matplotlib backend is set to TKAgg Does not play well with wxPython Parameters _________ FIGS : dictionary of figure names as keys and numbers as values """ is_win = True if sys.platform in ['win32', 'win64'] else False if not is_win: ...
[ "def", "draw_figs", "(", "FIGS", ")", ":", "is_win", "=", "True", "if", "sys", ".", "platform", "in", "[", "'win32'", ",", "'win64'", "]", "else", "False", "if", "not", "is_win", ":", "plt", ".", "ion", "(", ")", "for", "fig", "in", "list", "(", ...
Can only be used if matplotlib backend is set to TKAgg Does not play well with wxPython Parameters _________ FIGS : dictionary of figure names as keys and numbers as values
[ "Can", "only", "be", "used", "if", "matplotlib", "backend", "is", "set", "to", "TKAgg", "Does", "not", "play", "well", "with", "wxPython", "Parameters", "_________", "FIGS", ":", "dictionary", "of", "figure", "names", "as", "keys", "and", "numbers", "as", ...
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/pmagplotlib.py#L63-L83
PmagPy/PmagPy
pmagpy/pmagplotlib.py
delticks
def delticks(fig): """ deletes half the x-axis tick marks Parameters ___________ fig : matplotlib figure number """ locs = fig.xaxis.get_ticklocs() nlocs = np.delete(locs, list(range(0, len(locs), 2))) fig.set_xticks(nlocs)
python
def delticks(fig): """ deletes half the x-axis tick marks Parameters ___________ fig : matplotlib figure number """ locs = fig.xaxis.get_ticklocs() nlocs = np.delete(locs, list(range(0, len(locs), 2))) fig.set_xticks(nlocs)
[ "def", "delticks", "(", "fig", ")", ":", "locs", "=", "fig", ".", "xaxis", ".", "get_ticklocs", "(", ")", "nlocs", "=", "np", ".", "delete", "(", "locs", ",", "list", "(", "range", "(", "0", ",", "len", "(", "locs", ")", ",", "2", ")", ")", "...
deletes half the x-axis tick marks Parameters ___________ fig : matplotlib figure number
[ "deletes", "half", "the", "x", "-", "axis", "tick", "marks", "Parameters", "___________", "fig", ":", "matplotlib", "figure", "number" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/pmagplotlib.py#L105-L115
PmagPy/PmagPy
pmagpy/pmagplotlib.py
plot_init
def plot_init(fignum, w, h): """ initializes plot number fignum with width w and height h Parameters __________ fignum : matplotlib figure number w : width h : height """ global fig_x_pos, fig_y_pos, plt_num dpi = 80 if isServer: dpi = 240 # plt.ion() plt_num ...
python
def plot_init(fignum, w, h): """ initializes plot number fignum with width w and height h Parameters __________ fignum : matplotlib figure number w : width h : height """ global fig_x_pos, fig_y_pos, plt_num dpi = 80 if isServer: dpi = 240 # plt.ion() plt_num ...
[ "def", "plot_init", "(", "fignum", ",", "w", ",", "h", ")", ":", "global", "fig_x_pos", ",", "fig_y_pos", ",", "plt_num", "dpi", "=", "80", "if", "isServer", ":", "dpi", "=", "240", "# plt.ion()", "plt_num", "+=", "1", "fig", "=", "plt", ".", "figure...
initializes plot number fignum with width w and height h Parameters __________ fignum : matplotlib figure number w : width h : height
[ "initializes", "plot", "number", "fignum", "with", "width", "w", "and", "height", "h", "Parameters", "__________", "fignum", ":", "matplotlib", "figure", "number", "w", ":", "width", "h", ":", "height" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/pmagplotlib.py#L123-L152
PmagPy/PmagPy
pmagpy/pmagplotlib.py
plot3d_init
def plot3d_init(fignum): """ initializes 3D plot """ from mpl_toolkits.mplot3d import Axes3D fig = plt.figure(fignum) ax = fig.add_subplot(111, projection='3d') return ax
python
def plot3d_init(fignum): """ initializes 3D plot """ from mpl_toolkits.mplot3d import Axes3D fig = plt.figure(fignum) ax = fig.add_subplot(111, projection='3d') return ax
[ "def", "plot3d_init", "(", "fignum", ")", ":", "from", "mpl_toolkits", ".", "mplot3d", "import", "Axes3D", "fig", "=", "plt", ".", "figure", "(", "fignum", ")", "ax", "=", "fig", ".", "add_subplot", "(", "111", ",", "projection", "=", "'3d'", ")", "ret...
initializes 3D plot
[ "initializes", "3D", "plot" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/pmagplotlib.py#L155-L162
PmagPy/PmagPy
pmagpy/pmagplotlib.py
gaussfunc
def gaussfunc(y, ybar, sigma): """ cumulative normal distribution function of the variable y with mean ybar,standard deviation sigma uses expression 7.1.26 from Abramowitz & Stegun accuracy better than 1.5e-7 absolute Parameters _________ y : input variable ybar : mean sigma : st...
python
def gaussfunc(y, ybar, sigma): """ cumulative normal distribution function of the variable y with mean ybar,standard deviation sigma uses expression 7.1.26 from Abramowitz & Stegun accuracy better than 1.5e-7 absolute Parameters _________ y : input variable ybar : mean sigma : st...
[ "def", "gaussfunc", "(", "y", ",", "ybar", ",", "sigma", ")", ":", "x", "=", "old_div", "(", "(", "y", "-", "ybar", ")", ",", "(", "np", ".", "sqrt", "(", "2.", ")", "*", "sigma", ")", ")", "t", "=", "old_div", "(", "1.0", ",", "(", "1.0", ...
cumulative normal distribution function of the variable y with mean ybar,standard deviation sigma uses expression 7.1.26 from Abramowitz & Stegun accuracy better than 1.5e-7 absolute Parameters _________ y : input variable ybar : mean sigma : standard deviation
[ "cumulative", "normal", "distribution", "function", "of", "the", "variable", "y", "with", "mean", "ybar", "standard", "deviation", "sigma", "uses", "expression", "7", ".", "1", ".", "26", "from", "Abramowitz", "&", "Stegun", "accuracy", "better", "than", "1", ...
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/pmagplotlib.py#L176-L195
PmagPy/PmagPy
pmagpy/pmagplotlib.py
k_s
def k_s(X): """ Kolmorgorov-Smirnov statistic. Finds the probability that the data are distributed as func - used method of Numerical Recipes (Press et al., 1986) """ xbar, sigma = pmag.gausspars(X) d, f = 0, 0. for i in range(1, len(X) + 1): b = old_div(float(i), float(len(X))) ...
python
def k_s(X): """ Kolmorgorov-Smirnov statistic. Finds the probability that the data are distributed as func - used method of Numerical Recipes (Press et al., 1986) """ xbar, sigma = pmag.gausspars(X) d, f = 0, 0. for i in range(1, len(X) + 1): b = old_div(float(i), float(len(X))) ...
[ "def", "k_s", "(", "X", ")", ":", "xbar", ",", "sigma", "=", "pmag", ".", "gausspars", "(", "X", ")", "d", ",", "f", "=", "0", ",", "0.", "for", "i", "in", "range", "(", "1", ",", "len", "(", "X", ")", "+", "1", ")", ":", "b", "=", "old...
Kolmorgorov-Smirnov statistic. Finds the probability that the data are distributed as func - used method of Numerical Recipes (Press et al., 1986)
[ "Kolmorgorov", "-", "Smirnov", "statistic", ".", "Finds", "the", "probability", "that", "the", "data", "are", "distributed", "as", "func", "-", "used", "method", "of", "Numerical", "Recipes", "(", "Press", "et", "al", ".", "1986", ")" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/pmagplotlib.py#L198-L216
PmagPy/PmagPy
pmagpy/pmagplotlib.py
qsnorm
def qsnorm(p): """ rational approximation for x where q(x)=d, q being the cumulative normal distribution function. taken from Abramowitz & Stegun p. 933 |error(x)| < 4.5*10**-4 """ d = p if d < 0. or d > 1.: print('d not in (1,1) ') sys.exit() x = 0. if (d - 0.5) > 0:...
python
def qsnorm(p): """ rational approximation for x where q(x)=d, q being the cumulative normal distribution function. taken from Abramowitz & Stegun p. 933 |error(x)| < 4.5*10**-4 """ d = p if d < 0. or d > 1.: print('d not in (1,1) ') sys.exit() x = 0. if (d - 0.5) > 0:...
[ "def", "qsnorm", "(", "p", ")", ":", "d", "=", "p", "if", "d", "<", "0.", "or", "d", ">", "1.", ":", "print", "(", "'d not in (1,1) '", ")", "sys", ".", "exit", "(", ")", "x", "=", "0.", "if", "(", "d", "-", "0.5", ")", ">", "0", ":", "d"...
rational approximation for x where q(x)=d, q being the cumulative normal distribution function. taken from Abramowitz & Stegun p. 933 |error(x)| < 4.5*10**-4
[ "rational", "approximation", "for", "x", "where", "q", "(", "x", ")", "=", "d", "q", "being", "the", "cumulative", "normal", "distribution", "function", ".", "taken", "from", "Abramowitz", "&", "Stegun", "p", ".", "933", "|error", "(", "x", ")", "|", "...
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/pmagplotlib.py#L219-L239
PmagPy/PmagPy
pmagpy/pmagplotlib.py
plot_xy
def plot_xy(fignum, X, Y, **kwargs): """ deprecated, used in curie """ plt.figure(num=fignum) # if 'poly' in kwargs.keys(): # coeffs=np.polyfit(X,Y,kwargs['poly']) # polynomial=np.poly1d(coeffs) # xs=np.arange(np.min(X),np.max(X)) # ys=polynomial(xs) # plt...
python
def plot_xy(fignum, X, Y, **kwargs): """ deprecated, used in curie """ plt.figure(num=fignum) # if 'poly' in kwargs.keys(): # coeffs=np.polyfit(X,Y,kwargs['poly']) # polynomial=np.poly1d(coeffs) # xs=np.arange(np.min(X),np.max(X)) # ys=polynomial(xs) # plt...
[ "def", "plot_xy", "(", "fignum", ",", "X", ",", "Y", ",", "*", "*", "kwargs", ")", ":", "plt", ".", "figure", "(", "num", "=", "fignum", ")", "# if 'poly' in kwargs.keys():", "# coeffs=np.polyfit(X,Y,kwargs['poly'])", "# polynomial=np.poly1d(coeff...
deprecated, used in curie
[ "deprecated", "used", "in", "curie" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/pmagplotlib.py#L247-L292
PmagPy/PmagPy
pmagpy/pmagplotlib.py
plot_site
def plot_site(fignum, SiteRec, data, key): """ deprecated (used in ipmag) """ print('Site mean data: ') print(' dec inc n_lines n_planes kappa R alpha_95 comp coord') print(SiteRec['site_dec'], SiteRec['site_inc'], SiteRec['site_n_lines'], SiteRec['site_n_planes'], SiteRec['site_k'], ...
python
def plot_site(fignum, SiteRec, data, key): """ deprecated (used in ipmag) """ print('Site mean data: ') print(' dec inc n_lines n_planes kappa R alpha_95 comp coord') print(SiteRec['site_dec'], SiteRec['site_inc'], SiteRec['site_n_lines'], SiteRec['site_n_planes'], SiteRec['site_k'], ...
[ "def", "plot_site", "(", "fignum", ",", "SiteRec", ",", "data", ",", "key", ")", ":", "print", "(", "'Site mean data: '", ")", "print", "(", "' dec inc n_lines n_planes kappa R alpha_95 comp coord'", ")", "print", "(", "SiteRec", "[", "'site_dec'", "]", ",", ...
deprecated (used in ipmag)
[ "deprecated", "(", "used", "in", "ipmag", ")" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/pmagplotlib.py#L295-L316
PmagPy/PmagPy
pmagpy/pmagplotlib.py
plot_qq_norm
def plot_qq_norm(fignum, Y, title): """ makes a Quantile-Quantile plot for data Parameters _________ fignum : matplotlib figure number Y : list or array of data title : title string for plot Returns ___________ d,dc : the values for D and Dc (the critical value) if d>dc, ...
python
def plot_qq_norm(fignum, Y, title): """ makes a Quantile-Quantile plot for data Parameters _________ fignum : matplotlib figure number Y : list or array of data title : title string for plot Returns ___________ d,dc : the values for D and Dc (the critical value) if d>dc, ...
[ "def", "plot_qq_norm", "(", "fignum", ",", "Y", ",", "title", ")", ":", "plt", ".", "figure", "(", "num", "=", "fignum", ")", "if", "type", "(", "Y", ")", "==", "list", ":", "Y", "=", "np", ".", "array", "(", "Y", ")", "Y", "=", "np", ".", ...
makes a Quantile-Quantile plot for data Parameters _________ fignum : matplotlib figure number Y : list or array of data title : title string for plot Returns ___________ d,dc : the values for D and Dc (the critical value) if d>dc, likely to be normally distributed (95\% confiden...
[ "makes", "a", "Quantile", "-", "Quantile", "plot", "for", "data", "Parameters", "_________", "fignum", ":", "matplotlib", "figure", "number", "Y", ":", "list", "or", "array", "of", "data", "title", ":", "title", "string", "for", "plot" ]
train
https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/pmagplotlib.py#L319-L359