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 | pmagpy/ipmag.py | combine_magic | def combine_magic(filenames, outfile='measurements.txt', data_model=3, magic_table='measurements',
dir_path=".", input_dir_path=""):
"""
Takes a list of magic-formatted files, concatenates them, and creates a
single file. Returns output filename if the operation was successful.
Parame... | python | def combine_magic(filenames, outfile='measurements.txt', data_model=3, magic_table='measurements',
dir_path=".", input_dir_path=""):
"""
Takes a list of magic-formatted files, concatenates them, and creates a
single file. Returns output filename if the operation was successful.
Parame... | [
"def",
"combine_magic",
"(",
"filenames",
",",
"outfile",
"=",
"'measurements.txt'",
",",
"data_model",
"=",
"3",
",",
"magic_table",
"=",
"'measurements'",
",",
"dir_path",
"=",
"\".\"",
",",
"input_dir_path",
"=",
"\"\"",
")",
":",
"input_dir_path",
",",
"ou... | Takes a list of magic-formatted files, concatenates them, and creates a
single file. Returns output filename if the operation was successful.
Parameters
-----------
filenames : list of MagIC formatted files
outfile : name of output file [e.g., measurements.txt]
data_model : data model number (2... | [
"Takes",
"a",
"list",
"of",
"magic",
"-",
"formatted",
"files",
"concatenates",
"them",
"and",
"creates",
"a",
"single",
"file",
".",
"Returns",
"output",
"filename",
"if",
"the",
"operation",
"was",
"successful",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L2643-L2733 |
PmagPy/PmagPy | pmagpy/ipmag.py | ani_depthplot2 | def ani_depthplot2(ani_file='rmag_anisotropy.txt', meas_file='magic_measurements.txt', samp_file='er_samples.txt', age_file=None, sum_file=None, fmt='svg', dmin=-1, dmax=-1, depth_scale='sample_core_depth', dir_path='.'):
"""
returns matplotlib figure with anisotropy data plotted against depth
available dep... | python | def ani_depthplot2(ani_file='rmag_anisotropy.txt', meas_file='magic_measurements.txt', samp_file='er_samples.txt', age_file=None, sum_file=None, fmt='svg', dmin=-1, dmax=-1, depth_scale='sample_core_depth', dir_path='.'):
"""
returns matplotlib figure with anisotropy data plotted against depth
available dep... | [
"def",
"ani_depthplot2",
"(",
"ani_file",
"=",
"'rmag_anisotropy.txt'",
",",
"meas_file",
"=",
"'magic_measurements.txt'",
",",
"samp_file",
"=",
"'er_samples.txt'",
",",
"age_file",
"=",
"None",
",",
"sum_file",
"=",
"None",
",",
"fmt",
"=",
"'svg'",
",",
"dmin... | returns matplotlib figure with anisotropy data plotted against depth
available depth scales: 'sample_composite_depth', 'sample_core_depth', or 'age' (you must provide an age file to use this option) | [
"returns",
"matplotlib",
"figure",
"with",
"anisotropy",
"data",
"plotted",
"against",
"depth",
"available",
"depth",
"scales",
":",
"sample_composite_depth",
"sample_core_depth",
"or",
"age",
"(",
"you",
"must",
"provide",
"an",
"age",
"file",
"to",
"use",
"this"... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L2736-L2977 |
PmagPy/PmagPy | pmagpy/ipmag.py | ani_depthplot | def ani_depthplot(spec_file='specimens.txt', samp_file='samples.txt',
meas_file='measurements.txt', site_file='sites.txt',
age_file="", sum_file="", fmt='svg', dmin=-1, dmax=-1,
depth_scale='core_depth', dir_path='.', contribution=None):
"""
returns matplotl... | python | def ani_depthplot(spec_file='specimens.txt', samp_file='samples.txt',
meas_file='measurements.txt', site_file='sites.txt',
age_file="", sum_file="", fmt='svg', dmin=-1, dmax=-1,
depth_scale='core_depth', dir_path='.', contribution=None):
"""
returns matplotl... | [
"def",
"ani_depthplot",
"(",
"spec_file",
"=",
"'specimens.txt'",
",",
"samp_file",
"=",
"'samples.txt'",
",",
"meas_file",
"=",
"'measurements.txt'",
",",
"site_file",
"=",
"'sites.txt'",
",",
"age_file",
"=",
"\"\"",
",",
"sum_file",
"=",
"\"\"",
",",
"fmt",
... | returns matplotlib figure with anisotropy data plotted against depth
available depth scales: 'composite_depth', 'core_depth' or 'age' (you must provide an age file to use this option).
You must provide valid specimens and sites files, and either a samples or an ages file.
You may additionally provide measur... | [
"returns",
"matplotlib",
"figure",
"with",
"anisotropy",
"data",
"plotted",
"against",
"depth",
"available",
"depth",
"scales",
":",
"composite_depth",
"core_depth",
"or",
"age",
"(",
"you",
"must",
"provide",
"an",
"age",
"file",
"to",
"use",
"this",
"option",
... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L2980-L3293 |
PmagPy/PmagPy | pmagpy/ipmag.py | core_depthplot | def core_depthplot(input_dir_path='.', meas_file='measurements.txt', spc_file='',
samp_file='samples.txt', age_file='', sum_file='', wt_file='',
depth_scale='core_depth', dmin=-1, dmax=-1, sym='bo',
size=5, spc_sym='ro', spc_size=5, meth='', step=0, fmt='svg',
... | python | def core_depthplot(input_dir_path='.', meas_file='measurements.txt', spc_file='',
samp_file='samples.txt', age_file='', sum_file='', wt_file='',
depth_scale='core_depth', dmin=-1, dmax=-1, sym='bo',
size=5, spc_sym='ro', spc_size=5, meth='', step=0, fmt='svg',
... | [
"def",
"core_depthplot",
"(",
"input_dir_path",
"=",
"'.'",
",",
"meas_file",
"=",
"'measurements.txt'",
",",
"spc_file",
"=",
"''",
",",
"samp_file",
"=",
"'samples.txt'",
",",
"age_file",
"=",
"''",
",",
"sum_file",
"=",
"''",
",",
"wt_file",
"=",
"''",
... | depth scale can be 'core_depth' or 'composite_depth' (for data model=3)
if age file is provided, depth_scale will be set to 'age' by default.
You must provide at least a measurements,specimens and sample file to plot.
Parameters
----------
input_dir_path : str, default "."
file input direct... | [
"depth",
"scale",
"can",
"be",
"core_depth",
"or",
"composite_depth",
"(",
"for",
"data",
"model",
"=",
"3",
")",
"if",
"age",
"file",
"is",
"provided",
"depth_scale",
"will",
"be",
"set",
"to",
"age",
"by",
"default",
".",
"You",
"must",
"provide",
"at"... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L3295-L4056 |
PmagPy/PmagPy | pmagpy/ipmag.py | download_magic | def download_magic(infile, dir_path='.', input_dir_path='',
overwrite=False, print_progress=True,
data_model=3., separate_locs=False):
"""
takes the name of a text file downloaded from the MagIC database and
unpacks it into magic-formatted files. by default, download_ma... | python | def download_magic(infile, dir_path='.', input_dir_path='',
overwrite=False, print_progress=True,
data_model=3., separate_locs=False):
"""
takes the name of a text file downloaded from the MagIC database and
unpacks it into magic-formatted files. by default, download_ma... | [
"def",
"download_magic",
"(",
"infile",
",",
"dir_path",
"=",
"'.'",
",",
"input_dir_path",
"=",
"''",
",",
"overwrite",
"=",
"False",
",",
"print_progress",
"=",
"True",
",",
"data_model",
"=",
"3.",
",",
"separate_locs",
"=",
"False",
")",
":",
"if",
"... | takes the name of a text file downloaded from the MagIC database and
unpacks it into magic-formatted files. by default, download_magic assumes
that you are doing everything in your current directory. if not, you may
provide optional arguments dir_path (where you want the results to go) and
input_dir_pat... | [
"takes",
"the",
"name",
"of",
"a",
"text",
"file",
"downloaded",
"from",
"the",
"MagIC",
"database",
"and",
"unpacks",
"it",
"into",
"magic",
"-",
"formatted",
"files",
".",
"by",
"default",
"download_magic",
"assumes",
"that",
"you",
"are",
"doing",
"everyt... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L4059-L4245 |
PmagPy/PmagPy | pmagpy/ipmag.py | upload_magic2 | def upload_magic2(concat=0, dir_path='.', data_model=None):
"""
Finds all magic files in a given directory, and compiles them into an
upload.txt file which can be uploaded into the MagIC database. Returns a
tuple of either: (False, error_message, errors) if there was a problem
creating/validating th... | python | def upload_magic2(concat=0, dir_path='.', data_model=None):
"""
Finds all magic files in a given directory, and compiles them into an
upload.txt file which can be uploaded into the MagIC database. Returns a
tuple of either: (False, error_message, errors) if there was a problem
creating/validating th... | [
"def",
"upload_magic2",
"(",
"concat",
"=",
"0",
",",
"dir_path",
"=",
"'.'",
",",
"data_model",
"=",
"None",
")",
":",
"SpecDone",
"=",
"[",
"]",
"locations",
"=",
"[",
"]",
"concat",
"=",
"int",
"(",
"concat",
")",
"files_list",
"=",
"[",
"\"er_exp... | Finds all magic files in a given directory, and compiles them into an
upload.txt file which can be uploaded into the MagIC database. Returns a
tuple of either: (False, error_message, errors) if there was a problem
creating/validating the upload file or: (filename, '', None) if the upload
was fully succe... | [
"Finds",
"all",
"magic",
"files",
"in",
"a",
"given",
"directory",
"and",
"compiles",
"them",
"into",
"an",
"upload",
".",
"txt",
"file",
"which",
"can",
"be",
"uploaded",
"into",
"the",
"MagIC",
"database",
".",
"Returns",
"a",
"tuple",
"of",
"either",
... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L4248-L4445 |
PmagPy/PmagPy | pmagpy/ipmag.py | upload_magic | def upload_magic(concat=False, dir_path='.', dmodel=None, vocab="", contribution=None,
input_dir_path=""):
"""
Finds all magic files in a given directory, and compiles them into an
upload.txt file which can be uploaded into the MagIC database.
Parameters
----------
concat : bool... | python | def upload_magic(concat=False, dir_path='.', dmodel=None, vocab="", contribution=None,
input_dir_path=""):
"""
Finds all magic files in a given directory, and compiles them into an
upload.txt file which can be uploaded into the MagIC database.
Parameters
----------
concat : bool... | [
"def",
"upload_magic",
"(",
"concat",
"=",
"False",
",",
"dir_path",
"=",
"'.'",
",",
"dmodel",
"=",
"None",
",",
"vocab",
"=",
"\"\"",
",",
"contribution",
"=",
"None",
",",
"input_dir_path",
"=",
"\"\"",
")",
":",
"input_dir_path",
",",
"dir_path",
"="... | Finds all magic files in a given directory, and compiles them into an
upload.txt file which can be uploaded into the MagIC database.
Parameters
----------
concat : boolean where True means do concatenate to upload.txt file in dir_path,
False means write a new file (default is False)
dir_path... | [
"Finds",
"all",
"magic",
"files",
"in",
"a",
"given",
"directory",
"and",
"compiles",
"them",
"into",
"an",
"upload",
".",
"txt",
"file",
"which",
"can",
"be",
"uploaded",
"into",
"the",
"MagIC",
"database",
".",
"Parameters",
"----------",
"concat",
":",
... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L4453-L4673 |
PmagPy/PmagPy | pmagpy/ipmag.py | specimens_results_magic | def specimens_results_magic(infile='pmag_specimens.txt', measfile='magic_measurements.txt', sampfile='er_samples.txt', sitefile='er_sites.txt', agefile='er_ages.txt', specout='er_specimens.txt', sampout='pmag_samples.txt', siteout='pmag_sites.txt', resout='pmag_results.txt', critout='pmag_criteria.txt', instout='magic_... | python | def specimens_results_magic(infile='pmag_specimens.txt', measfile='magic_measurements.txt', sampfile='er_samples.txt', sitefile='er_sites.txt', agefile='er_ages.txt', specout='er_specimens.txt', sampout='pmag_samples.txt', siteout='pmag_sites.txt', resout='pmag_results.txt', critout='pmag_criteria.txt', instout='magic_... | [
"def",
"specimens_results_magic",
"(",
"infile",
"=",
"'pmag_specimens.txt'",
",",
"measfile",
"=",
"'magic_measurements.txt'",
",",
"sampfile",
"=",
"'er_samples.txt'",
",",
"sitefile",
"=",
"'er_sites.txt'",
",",
"agefile",
"=",
"'er_ages.txt'",
",",
"specout",
"=",... | Writes magic_instruments, er_specimens, pmag_samples, pmag_sites, pmag_criteria, and pmag_results. The data used to write this is obtained by reading a pmag_speciemns, a magic_measurements, a er_samples, a er_sites, a er_ages.
@param -> infile: path from the WD to the pmag speciemns table
@param -> measfile: pa... | [
"Writes",
"magic_instruments",
"er_specimens",
"pmag_samples",
"pmag_sites",
"pmag_criteria",
"and",
"pmag_results",
".",
"The",
"data",
"used",
"to",
"write",
"this",
"is",
"obtained",
"by",
"reading",
"a",
"pmag_speciemns",
"a",
"magic_measurements",
"a",
"er_sample... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L4676-L5466 |
PmagPy/PmagPy | pmagpy/ipmag.py | orientation_magic | def orientation_magic(or_con=1, dec_correction_con=1, dec_correction=0, bed_correction=True,
samp_con='1', hours_from_gmt=0, method_codes='', average_bedding=False,
orient_file='orient.txt', samp_file='samples.txt', site_file='sites.txt',
output_dir_path... | python | def orientation_magic(or_con=1, dec_correction_con=1, dec_correction=0, bed_correction=True,
samp_con='1', hours_from_gmt=0, method_codes='', average_bedding=False,
orient_file='orient.txt', samp_file='samples.txt', site_file='sites.txt',
output_dir_path... | [
"def",
"orientation_magic",
"(",
"or_con",
"=",
"1",
",",
"dec_correction_con",
"=",
"1",
",",
"dec_correction",
"=",
"0",
",",
"bed_correction",
"=",
"True",
",",
"samp_con",
"=",
"'1'",
",",
"hours_from_gmt",
"=",
"0",
",",
"method_codes",
"=",
"''",
","... | use this function to convert tab delimited field notebook information to MagIC formatted tables (er_samples and er_sites)
INPUT FORMAT
Input files must be tab delimited and have in the first line:
tab location_name
Note: The "location_name" will facilitate searching in the MagIC database. Data fro... | [
"use",
"this",
"function",
"to",
"convert",
"tab",
"delimited",
"field",
"notebook",
"information",
"to",
"MagIC",
"formatted",
"tables",
"(",
"er_samples",
"and",
"er_sites",
")"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L5469-L6152 |
PmagPy/PmagPy | pmagpy/ipmag.py | azdip_magic | def azdip_magic(orient_file='orient.txt', samp_file="samples.txt", samp_con="1", Z=1, method_codes='FS-FD', location_name='unknown', append=False, output_dir='.', input_dir='.', data_model=3):
"""
takes space delimited AzDip file and converts to MagIC formatted tables
Parameters
__________
orie... | python | def azdip_magic(orient_file='orient.txt', samp_file="samples.txt", samp_con="1", Z=1, method_codes='FS-FD', location_name='unknown', append=False, output_dir='.', input_dir='.', data_model=3):
"""
takes space delimited AzDip file and converts to MagIC formatted tables
Parameters
__________
orie... | [
"def",
"azdip_magic",
"(",
"orient_file",
"=",
"'orient.txt'",
",",
"samp_file",
"=",
"\"samples.txt\"",
",",
"samp_con",
"=",
"\"1\"",
",",
"Z",
"=",
"1",
",",
"method_codes",
"=",
"'FS-FD'",
",",
"location_name",
"=",
"'unknown'",
",",
"append",
"=",
"Fals... | takes space delimited AzDip file and converts to MagIC formatted tables
Parameters
__________
orient_file : name of azdip formatted input file
samp_file : name of samples.txt formatted output file
samp_con : integer of sample orientation convention
[1] XXXXY: where XXXX is ... | [
"takes",
"space",
"delimited",
"AzDip",
"file",
"and",
"converts",
"to",
"MagIC",
"formatted",
"tables"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L6155-L6301 |
PmagPy/PmagPy | pmagpy/ipmag.py | dayplot_magic | def dayplot_magic(path_to_file='.', hyst_file="specimens.txt", rem_file='',
save=True, save_folder='.', fmt='svg', data_model=3,
interactive=False, contribution=None):
"""
Makes 'day plots' (Day et al. 1977) and squareness/coercivity plots
(Neel, 1955; plots after Tauxe e... | python | def dayplot_magic(path_to_file='.', hyst_file="specimens.txt", rem_file='',
save=True, save_folder='.', fmt='svg', data_model=3,
interactive=False, contribution=None):
"""
Makes 'day plots' (Day et al. 1977) and squareness/coercivity plots
(Neel, 1955; plots after Tauxe e... | [
"def",
"dayplot_magic",
"(",
"path_to_file",
"=",
"'.'",
",",
"hyst_file",
"=",
"\"specimens.txt\"",
",",
"rem_file",
"=",
"''",
",",
"save",
"=",
"True",
",",
"save_folder",
"=",
"'.'",
",",
"fmt",
"=",
"'svg'",
",",
"data_model",
"=",
"3",
",",
"intera... | Makes 'day plots' (Day et al. 1977) and squareness/coercivity plots
(Neel, 1955; plots after Tauxe et al., 2002); plots 'linear mixing'
curve from Dunlop and Carter-Stiglitz (2006).
Optional Parameters (defaults are used if not specified)
----------
path_to_file : path to directory that contains fi... | [
"Makes",
"day",
"plots",
"(",
"Day",
"et",
"al",
".",
"1977",
")",
"and",
"squareness",
"/",
"coercivity",
"plots",
"(",
"Neel",
"1955",
";",
"plots",
"after",
"Tauxe",
"et",
"al",
".",
"2002",
")",
";",
"plots",
"linear",
"mixing",
"curve",
"from",
... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L6547-L6710 |
PmagPy/PmagPy | pmagpy/ipmag.py | curie | def curie(path_to_file='.', file_name='', magic=False,
window_length=3, save=False, save_folder='.', fmt='svg', t_begin="", t_end=""):
"""
Plots and interprets curie temperature data.
***
The 1st derivative is calculated from smoothed M-T curve (convolution
with trianfular window with widt... | python | def curie(path_to_file='.', file_name='', magic=False,
window_length=3, save=False, save_folder='.', fmt='svg', t_begin="", t_end=""):
"""
Plots and interprets curie temperature data.
***
The 1st derivative is calculated from smoothed M-T curve (convolution
with trianfular window with widt... | [
"def",
"curie",
"(",
"path_to_file",
"=",
"'.'",
",",
"file_name",
"=",
"''",
",",
"magic",
"=",
"False",
",",
"window_length",
"=",
"3",
",",
"save",
"=",
"False",
",",
"save_folder",
"=",
"'.'",
",",
"fmt",
"=",
"'svg'",
",",
"t_begin",
"=",
"\"\""... | Plots and interprets curie temperature data.
***
The 1st derivative is calculated from smoothed M-T curve (convolution
with trianfular window with width= <-w> degrees)
***
The 2nd derivative is calculated from smoothed 1st derivative curve
(using the same sliding window width)
***
The es... | [
"Plots",
"and",
"interprets",
"curie",
"temperature",
"data",
".",
"***",
"The",
"1st",
"derivative",
"is",
"calculated",
"from",
"smoothed",
"M",
"-",
"T",
"curve",
"(",
"convolution",
"with",
"trianfular",
"window",
"with",
"width",
"=",
"<",
"-",
"w",
"... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L6790-L6968 |
PmagPy/PmagPy | pmagpy/ipmag.py | chi_magic2 | def chi_magic2(path_to_file='.', file_name='magic_measurements.txt',
save=False, save_folder='.', fmt='svg'):
"""
Generates plots that compare susceptibility to temperature at different
frequencies.
Optional Parameters (defaults are used if not specified)
----------
path_to_file :... | python | def chi_magic2(path_to_file='.', file_name='magic_measurements.txt',
save=False, save_folder='.', fmt='svg'):
"""
Generates plots that compare susceptibility to temperature at different
frequencies.
Optional Parameters (defaults are used if not specified)
----------
path_to_file :... | [
"def",
"chi_magic2",
"(",
"path_to_file",
"=",
"'.'",
",",
"file_name",
"=",
"'magic_measurements.txt'",
",",
"save",
"=",
"False",
",",
"save_folder",
"=",
"'.'",
",",
"fmt",
"=",
"'svg'",
")",
":",
"cont",
",",
"FTinit",
",",
"BTinit",
",",
"k",
"=",
... | Generates plots that compare susceptibility to temperature at different
frequencies.
Optional Parameters (defaults are used if not specified)
----------
path_to_file : path to directory that contains file (default is current directory, '.')
file_name : name of file to be opened (default is 'magic_m... | [
"Generates",
"plots",
"that",
"compare",
"susceptibility",
"to",
"temperature",
"at",
"different",
"frequencies",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L6971-L7094 |
PmagPy/PmagPy | pmagpy/ipmag.py | pmag_results_extract | def pmag_results_extract(res_file="pmag_results.txt", crit_file="", spec_file="",
age_file="", latex=False, grade=False, WD="."):
"""
Generate tab delimited output file(s) with result data.
Save output files and return True if successful.
Possible output files: Directions, Inten... | python | def pmag_results_extract(res_file="pmag_results.txt", crit_file="", spec_file="",
age_file="", latex=False, grade=False, WD="."):
"""
Generate tab delimited output file(s) with result data.
Save output files and return True if successful.
Possible output files: Directions, Inten... | [
"def",
"pmag_results_extract",
"(",
"res_file",
"=",
"\"pmag_results.txt\"",
",",
"crit_file",
"=",
"\"\"",
",",
"spec_file",
"=",
"\"\"",
",",
"age_file",
"=",
"\"\"",
",",
"latex",
"=",
"False",
",",
"grade",
"=",
"False",
",",
"WD",
"=",
"\".\"",
")",
... | Generate tab delimited output file(s) with result data.
Save output files and return True if successful.
Possible output files: Directions, Intensities, SiteNfo, Criteria,
Specimens
Optional Parameters (defaults are used if not specified)
----------
res_file : name of pma... | [
"Generate",
"tab",
"delimited",
"output",
"file",
"(",
"s",
")",
"with",
"result",
"data",
".",
"Save",
"output",
"files",
"and",
"return",
"True",
"if",
"successful",
".",
"Possible",
"output",
"files",
":",
"Directions",
"Intensities",
"SiteNfo",
"Criteria",... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L7097-L7456 |
PmagPy/PmagPy | pmagpy/ipmag.py | demag_magic | def demag_magic(path_to_file='.', file_name='magic_measurements.txt',
save=False, save_folder='.', fmt='svg', plot_by='loc',
treat=None, XLP="", individual=None, average_measurements=False,
single_plot=False):
'''
Takes demagnetization data (from magic_measurement... | python | def demag_magic(path_to_file='.', file_name='magic_measurements.txt',
save=False, save_folder='.', fmt='svg', plot_by='loc',
treat=None, XLP="", individual=None, average_measurements=False,
single_plot=False):
'''
Takes demagnetization data (from magic_measurement... | [
"def",
"demag_magic",
"(",
"path_to_file",
"=",
"'.'",
",",
"file_name",
"=",
"'magic_measurements.txt'",
",",
"save",
"=",
"False",
",",
"save_folder",
"=",
"'.'",
",",
"fmt",
"=",
"'svg'",
",",
"plot_by",
"=",
"'loc'",
",",
"treat",
"=",
"None",
",",
"... | Takes demagnetization data (from magic_measurements file) and outputs
intensity plots (with optional save).
Parameters
-----------
path_to_file : path to directory that contains files (default is current directory, '.')
file_name : name of measurements file (default is 'magic_measurements.txt')
... | [
"Takes",
"demagnetization",
"data",
"(",
"from",
"magic_measurements",
"file",
")",
"and",
"outputs",
"intensity",
"plots",
"(",
"with",
"optional",
"save",
")",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L7459-L7627 |
PmagPy/PmagPy | pmagpy/ipmag.py | iplot_hys | def iplot_hys(fignum, B, M, s):
"""
function to plot hysteresis data
This function has been adapted from pmagplotlib.iplot_hys for specific use
within a Jupyter notebook.
Parameters
-----------
fignum : reference number for matplotlib figure being created
B : list of B (flux density) v... | python | def iplot_hys(fignum, B, M, s):
"""
function to plot hysteresis data
This function has been adapted from pmagplotlib.iplot_hys for specific use
within a Jupyter notebook.
Parameters
-----------
fignum : reference number for matplotlib figure being created
B : list of B (flux density) v... | [
"def",
"iplot_hys",
"(",
"fignum",
",",
"B",
",",
"M",
",",
"s",
")",
":",
"if",
"fignum",
"!=",
"0",
":",
"plt",
".",
"figure",
"(",
"num",
"=",
"fignum",
")",
"plt",
".",
"clf",
"(",
")",
"hpars",
"=",
"{",
"}",
"# close up loop",
"Npts",
"="... | function to plot hysteresis data
This function has been adapted from pmagplotlib.iplot_hys for specific use
within a Jupyter notebook.
Parameters
-----------
fignum : reference number for matplotlib figure being created
B : list of B (flux density) values of hysteresis experiment
M : list ... | [
"function",
"to",
"plot",
"hysteresis",
"data"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L7630-L7733 |
PmagPy/PmagPy | pmagpy/ipmag.py | hysteresis_magic2 | def hysteresis_magic2(path_to_file='.', hyst_file="rmag_hysteresis.txt",
save=False, save_folder='.',
fmt="svg", plots=True):
"""
Calculates hysteresis parameters, saves them in rmag_hysteresis format file.
If selected, this function also plots hysteresis loops, d... | python | def hysteresis_magic2(path_to_file='.', hyst_file="rmag_hysteresis.txt",
save=False, save_folder='.',
fmt="svg", plots=True):
"""
Calculates hysteresis parameters, saves them in rmag_hysteresis format file.
If selected, this function also plots hysteresis loops, d... | [
"def",
"hysteresis_magic2",
"(",
"path_to_file",
"=",
"'.'",
",",
"hyst_file",
"=",
"\"rmag_hysteresis.txt\"",
",",
"save",
"=",
"False",
",",
"save_folder",
"=",
"'.'",
",",
"fmt",
"=",
"\"svg\"",
",",
"plots",
"=",
"True",
")",
":",
"user",
",",
"meas_fi... | Calculates hysteresis parameters, saves them in rmag_hysteresis format file.
If selected, this function also plots hysteresis loops, delta M curves,
d (Delta M)/dB curves, and IRM backfield curves.
Parameters (defaults are used if not specified)
----------
path_to_file : path to directory that cont... | [
"Calculates",
"hysteresis",
"parameters",
"saves",
"them",
"in",
"rmag_hysteresis",
"format",
"file",
".",
"If",
"selected",
"this",
"function",
"also",
"plots",
"hysteresis",
"loops",
"delta",
"M",
"curves",
"d",
"(",
"Delta",
"M",
")",
"/",
"dB",
"curves",
... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L7736-L7926 |
PmagPy/PmagPy | pmagpy/ipmag.py | find_ei | def find_ei(data, nb=1000, save=False, save_folder='.', fmt='svg',
site_correction=False, return_new_dirs=False):
"""
Applies series of assumed flattening factor and "unsquishes" inclinations assuming tangent function.
Finds flattening factor that gives elongation/inclination pair consistent wit... | python | def find_ei(data, nb=1000, save=False, save_folder='.', fmt='svg',
site_correction=False, return_new_dirs=False):
"""
Applies series of assumed flattening factor and "unsquishes" inclinations assuming tangent function.
Finds flattening factor that gives elongation/inclination pair consistent wit... | [
"def",
"find_ei",
"(",
"data",
",",
"nb",
"=",
"1000",
",",
"save",
"=",
"False",
",",
"save_folder",
"=",
"'.'",
",",
"fmt",
"=",
"'svg'",
",",
"site_correction",
"=",
"False",
",",
"return_new_dirs",
"=",
"False",
")",
":",
"print",
"(",
"\"Bootstrap... | Applies series of assumed flattening factor and "unsquishes" inclinations assuming tangent function.
Finds flattening factor that gives elongation/inclination pair consistent with TK03;
or, if correcting by site instead of for study-level secular variation,
finds flattening factor that minimizes elongation ... | [
"Applies",
"series",
"of",
"assumed",
"flattening",
"factor",
"and",
"unsquishes",
"inclinations",
"assuming",
"tangent",
"function",
".",
"Finds",
"flattening",
"factor",
"that",
"gives",
"elongation",
"/",
"inclination",
"pair",
"consistent",
"with",
"TK03",
";",
... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L7929-L8062 |
PmagPy/PmagPy | pmagpy/ipmag.py | plate_rate_mc | def plate_rate_mc(pole1_plon, pole1_plat, pole1_kappa, pole1_N, pole1_age, pole1_age_error,
pole2_plon, pole2_plat, pole2_kappa, pole2_N, pole2_age, pole2_age_error,
ref_loc_lon, ref_loc_lat, samplesize=10000, random_seed=None, plot=True,
savefig=True, save_director... | python | def plate_rate_mc(pole1_plon, pole1_plat, pole1_kappa, pole1_N, pole1_age, pole1_age_error,
pole2_plon, pole2_plat, pole2_kappa, pole2_N, pole2_age, pole2_age_error,
ref_loc_lon, ref_loc_lat, samplesize=10000, random_seed=None, plot=True,
savefig=True, save_director... | [
"def",
"plate_rate_mc",
"(",
"pole1_plon",
",",
"pole1_plat",
",",
"pole1_kappa",
",",
"pole1_N",
",",
"pole1_age",
",",
"pole1_age_error",
",",
"pole2_plon",
",",
"pole2_plat",
",",
"pole2_kappa",
",",
"pole2_N",
",",
"pole2_age",
",",
"pole2_age_error",
",",
"... | Determine the latitudinal motion implied by a pair of poles and utilize
the Monte Carlo sampling method of Swanson-Hysell (2014) to determine the
associated uncertainty.
Parameters:
------------
plon : longitude of pole
plat : latitude of pole
kappa : Fisher precision parameter for VPGs in ... | [
"Determine",
"the",
"latitudinal",
"motion",
"implied",
"by",
"a",
"pair",
"of",
"poles",
"and",
"utilize",
"the",
"Monte",
"Carlo",
"sampling",
"method",
"of",
"Swanson",
"-",
"Hysell",
"(",
"2014",
")",
"to",
"determine",
"the",
"associated",
"uncertainty",
... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L8065-L8245 |
PmagPy/PmagPy | pmagpy/ipmag.py | zeq | def zeq(path_to_file='.', file='', data="", units='U', calculation_type="DE-BFL",
save=False, save_folder='.', fmt='svg', begin_pca="", end_pca="", angle=0):
"""
NAME
zeq.py
DESCRIPTION
plots demagnetization data for a single specimen:
- The solid (open) symbols in the Zijde... | python | def zeq(path_to_file='.', file='', data="", units='U', calculation_type="DE-BFL",
save=False, save_folder='.', fmt='svg', begin_pca="", end_pca="", angle=0):
"""
NAME
zeq.py
DESCRIPTION
plots demagnetization data for a single specimen:
- The solid (open) symbols in the Zijde... | [
"def",
"zeq",
"(",
"path_to_file",
"=",
"'.'",
",",
"file",
"=",
"''",
",",
"data",
"=",
"\"\"",
",",
"units",
"=",
"'U'",
",",
"calculation_type",
"=",
"\"DE-BFL\"",
",",
"save",
"=",
"False",
",",
"save_folder",
"=",
"'.'",
",",
"fmt",
"=",
"'svg'"... | NAME
zeq.py
DESCRIPTION
plots demagnetization data for a single specimen:
- The solid (open) symbols in the Zijderveld diagram are X,Y (X,Z) pairs. The demagnetization diagram plots the
fractional remanence remaining after each step. The green line is the fraction of the total re... | [
"NAME",
"zeq",
".",
"py"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L8248-L8353 |
PmagPy/PmagPy | pmagpy/ipmag.py | aniso_magic_nb | def aniso_magic_nb(infile='specimens.txt', samp_file='samples.txt', site_file='sites.txt', verbose=True,
ipar=False, ihext=True, ivec=False, isite=False, iloc=False, iboot=False, vec=0,
Dir=[], PDir=[], crd="s", num_bootstraps=1000, dir_path=".", fignum=1,
save_p... | python | def aniso_magic_nb(infile='specimens.txt', samp_file='samples.txt', site_file='sites.txt', verbose=True,
ipar=False, ihext=True, ivec=False, isite=False, iloc=False, iboot=False, vec=0,
Dir=[], PDir=[], crd="s", num_bootstraps=1000, dir_path=".", fignum=1,
save_p... | [
"def",
"aniso_magic_nb",
"(",
"infile",
"=",
"'specimens.txt'",
",",
"samp_file",
"=",
"'samples.txt'",
",",
"site_file",
"=",
"'sites.txt'",
",",
"verbose",
"=",
"True",
",",
"ipar",
"=",
"False",
",",
"ihext",
"=",
"True",
",",
"ivec",
"=",
"False",
",",... | Makes plots of anisotropy eigenvectors, eigenvalues and confidence bounds
All directions are on the lower hemisphere.
Parameters
__________
infile : specimens formatted file with aniso_s data
samp_file : samples formatted file with sample => site relationship
site_file : sites forma... | [
"Makes",
"plots",
"of",
"anisotropy",
"eigenvectors",
"eigenvalues",
"and",
"confidence",
"bounds",
"All",
"directions",
"are",
"on",
"the",
"lower",
"hemisphere",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L8995-L9164 |
PmagPy/PmagPy | pmagpy/ipmag.py | plot_dmag | def plot_dmag(data="", title="", fignum=1, norm=1,dmag_key='treat_ac_field',intensity='',
quality=False):
"""
plots demagenetization data versus step for all specimens in pandas dataframe datablock
Parameters
______________
data : Pandas dataframe with MagIC data model 3 columns:
... | python | def plot_dmag(data="", title="", fignum=1, norm=1,dmag_key='treat_ac_field',intensity='',
quality=False):
"""
plots demagenetization data versus step for all specimens in pandas dataframe datablock
Parameters
______________
data : Pandas dataframe with MagIC data model 3 columns:
... | [
"def",
"plot_dmag",
"(",
"data",
"=",
"\"\"",
",",
"title",
"=",
"\"\"",
",",
"fignum",
"=",
"1",
",",
"norm",
"=",
"1",
",",
"dmag_key",
"=",
"'treat_ac_field'",
",",
"intensity",
"=",
"''",
",",
"quality",
"=",
"False",
")",
":",
"plt",
".",
"fig... | plots demagenetization data versus step for all specimens in pandas dataframe datablock
Parameters
______________
data : Pandas dataframe with MagIC data model 3 columns:
fignum : figure number
specimen : specimen name
dmag_key : one of these: ['treat_temp','treat_ac_field','treat_m... | [
"plots",
"demagenetization",
"data",
"versus",
"step",
"for",
"all",
"specimens",
"in",
"pandas",
"dataframe",
"datablock"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L9167-L9215 |
PmagPy/PmagPy | pmagpy/ipmag.py | eigs_s | def eigs_s(infile="", dir_path='.'):
"""
Converts eigenparamters format data to s format
Parameters
___________________
Input:
file : input file name with eigenvalues (tau) and eigenvectors (V) with format:
tau_1 V1_dec V1_inc tau_2 V2_dec V2_inc tau_3 V3_dec V3_inc
Output
... | python | def eigs_s(infile="", dir_path='.'):
"""
Converts eigenparamters format data to s format
Parameters
___________________
Input:
file : input file name with eigenvalues (tau) and eigenvectors (V) with format:
tau_1 V1_dec V1_inc tau_2 V2_dec V2_inc tau_3 V3_dec V3_inc
Output
... | [
"def",
"eigs_s",
"(",
"infile",
"=",
"\"\"",
",",
"dir_path",
"=",
"'.'",
")",
":",
"file",
"=",
"os",
".",
"path",
".",
"join",
"(",
"dir_path",
",",
"infile",
")",
"eigs_data",
"=",
"np",
".",
"loadtxt",
"(",
"file",
")",
"Ss",
"=",
"[",
"]",
... | Converts eigenparamters format data to s format
Parameters
___________________
Input:
file : input file name with eigenvalues (tau) and eigenvectors (V) with format:
tau_1 V1_dec V1_inc tau_2 V2_dec V2_inc tau_3 V3_dec V3_inc
Output
the six tensor elements as a nested arra... | [
"Converts",
"eigenparamters",
"format",
"data",
"to",
"s",
"format"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L9218-L9242 |
PmagPy/PmagPy | pmagpy/ipmag.py | plot_gc | def plot_gc(poles, color='g', fignum=1):
"""
plots a great circle on an equal area projection
Parameters
____________________
Input
fignum : number of matplotlib object
poles : nested list of [Dec,Inc] pairs of poles
color : color of lower hemisphere dots for great circle - must... | python | def plot_gc(poles, color='g', fignum=1):
"""
plots a great circle on an equal area projection
Parameters
____________________
Input
fignum : number of matplotlib object
poles : nested list of [Dec,Inc] pairs of poles
color : color of lower hemisphere dots for great circle - must... | [
"def",
"plot_gc",
"(",
"poles",
",",
"color",
"=",
"'g'",
",",
"fignum",
"=",
"1",
")",
":",
"for",
"pole",
"in",
"poles",
":",
"pmagplotlib",
".",
"plot_circ",
"(",
"fignum",
",",
"pole",
",",
"90.",
",",
"color",
")"
] | plots a great circle on an equal area projection
Parameters
____________________
Input
fignum : number of matplotlib object
poles : nested list of [Dec,Inc] pairs of poles
color : color of lower hemisphere dots for great circle - must be in form: 'g','r','y','k',etc.
uppe... | [
"plots",
"a",
"great",
"circle",
"on",
"an",
"equal",
"area",
"projection",
"Parameters",
"____________________",
"Input",
"fignum",
":",
"number",
"of",
"matplotlib",
"object",
"poles",
":",
"nested",
"list",
"of",
"[",
"Dec",
"Inc",
"]",
"pairs",
"of",
"po... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L9245-L9257 |
PmagPy/PmagPy | pmagpy/ipmag.py | aarm_magic | def aarm_magic(infile, dir_path=".", input_dir_path="",
spec_file='specimens.txt', samp_file="samples.txt", data_model_num=3,
coord='s'):
"""
Converts AARM data to best-fit tensor (6 elements plus sigma)
Parameters
----------
infile : str
input measurement fil... | python | def aarm_magic(infile, dir_path=".", input_dir_path="",
spec_file='specimens.txt', samp_file="samples.txt", data_model_num=3,
coord='s'):
"""
Converts AARM data to best-fit tensor (6 elements plus sigma)
Parameters
----------
infile : str
input measurement fil... | [
"def",
"aarm_magic",
"(",
"infile",
",",
"dir_path",
"=",
"\".\"",
",",
"input_dir_path",
"=",
"\"\"",
",",
"spec_file",
"=",
"'specimens.txt'",
",",
"samp_file",
"=",
"\"samples.txt\"",
",",
"data_model_num",
"=",
"3",
",",
"coord",
"=",
"'s'",
")",
":",
... | Converts AARM data to best-fit tensor (6 elements plus sigma)
Parameters
----------
infile : str
input measurement file
dir_path : str
output directory, default "."
input_dir_path : str
input file directory IF different from dir_path, default ""
spec_file : str
... | [
"Converts",
"AARM",
"data",
"to",
"best",
"-",
"fit",
"tensor",
"(",
"6",
"elements",
"plus",
"sigma",
")"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L9387-L9833 |
PmagPy/PmagPy | pmagpy/ipmag.py | atrm_magic | def atrm_magic(meas_file, dir_path=".", input_dir_path="",
input_spec_file='specimens.txt', output_spec_file='specimens.txt',
data_model_num=3):
"""
Converts ATRM data to best-fit tensor (6 elements plus sigma)
Parameters
----------
meas_file : str
input measu... | python | def atrm_magic(meas_file, dir_path=".", input_dir_path="",
input_spec_file='specimens.txt', output_spec_file='specimens.txt',
data_model_num=3):
"""
Converts ATRM data to best-fit tensor (6 elements plus sigma)
Parameters
----------
meas_file : str
input measu... | [
"def",
"atrm_magic",
"(",
"meas_file",
",",
"dir_path",
"=",
"\".\"",
",",
"input_dir_path",
"=",
"\"\"",
",",
"input_spec_file",
"=",
"'specimens.txt'",
",",
"output_spec_file",
"=",
"'specimens.txt'",
",",
"data_model_num",
"=",
"3",
")",
":",
"# fix up file nam... | Converts ATRM data to best-fit tensor (6 elements plus sigma)
Parameters
----------
meas_file : str
input measurement file
dir_path : str
output directory, default "."
input_dir_path : str
input file directory IF different from dir_path, default ""
input_spec_file : str... | [
"Converts",
"ATRM",
"data",
"to",
"best",
"-",
"fit",
"tensor",
"(",
"6",
"elements",
"plus",
"sigma",
")"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L9836-L10213 |
PmagPy/PmagPy | pmagpy/ipmag.py | zeq_magic | def zeq_magic(meas_file='measurements.txt', spec_file='',crd='s',input_dir_path='.', angle=0,
n_plots=5, save_plots=True, fmt="svg", interactive=False, specimen="",
samp_file='samples.txt', contribution=None,fignum=1):
"""
zeq_magic makes zijderveld and equal area plots for magic for... | python | def zeq_magic(meas_file='measurements.txt', spec_file='',crd='s',input_dir_path='.', angle=0,
n_plots=5, save_plots=True, fmt="svg", interactive=False, specimen="",
samp_file='samples.txt', contribution=None,fignum=1):
"""
zeq_magic makes zijderveld and equal area plots for magic for... | [
"def",
"zeq_magic",
"(",
"meas_file",
"=",
"'measurements.txt'",
",",
"spec_file",
"=",
"''",
",",
"crd",
"=",
"'s'",
",",
"input_dir_path",
"=",
"'.'",
",",
"angle",
"=",
"0",
",",
"n_plots",
"=",
"5",
",",
"save_plots",
"=",
"True",
",",
"fmt",
"=",
... | zeq_magic makes zijderveld and equal area plots for magic formatted measurements files.
Parameters
----------
meas_file : str
input measurement file
spec_file : str
input specimen interpretation file
samp_file : str
input sample orientations file
crd : str
coordin... | [
"zeq_magic",
"makes",
"zijderveld",
"and",
"equal",
"area",
"plots",
"for",
"magic",
"formatted",
"measurements",
"files",
".",
"Parameters",
"----------",
"meas_file",
":",
"str",
"input",
"measurement",
"file",
"spec_file",
":",
"str",
"input",
"specimen",
"inte... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L10216-L10540 |
PmagPy/PmagPy | pmagpy/ipmag.py | transform_to_geographic | def transform_to_geographic(this_spec_meas_df, samp_df, samp, coord="0"):
"""
Transform decs/incs to geographic coordinates.
Calls pmag.dogeo_V for the heavy lifting
Parameters
----------
this_spec_meas_df : pandas dataframe of measurements for a single specimen
samp_df : pandas dataframe o... | python | def transform_to_geographic(this_spec_meas_df, samp_df, samp, coord="0"):
"""
Transform decs/incs to geographic coordinates.
Calls pmag.dogeo_V for the heavy lifting
Parameters
----------
this_spec_meas_df : pandas dataframe of measurements for a single specimen
samp_df : pandas dataframe o... | [
"def",
"transform_to_geographic",
"(",
"this_spec_meas_df",
",",
"samp_df",
",",
"samp",
",",
"coord",
"=",
"\"0\"",
")",
":",
"# we could return the type of coordinates ACTUALLY used",
"# transform geographic",
"decs",
"=",
"this_spec_meas_df",
"[",
"'dir_dec'",
"]",
"."... | Transform decs/incs to geographic coordinates.
Calls pmag.dogeo_V for the heavy lifting
Parameters
----------
this_spec_meas_df : pandas dataframe of measurements for a single specimen
samp_df : pandas dataframe of samples
samp : samp name
Returns
---------
this_spec_meas_df : meas... | [
"Transform",
"decs",
"/",
"incs",
"to",
"geographic",
"coordinates",
".",
"Calls",
"pmag",
".",
"dogeo_V",
"for",
"the",
"heavy",
"lifting"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L10542-L10581 |
PmagPy/PmagPy | pmagpy/ipmag.py | thellier_magic | def thellier_magic(meas_file="measurements.txt", dir_path=".", input_dir_path="",
spec="", n_specs=5, save_plots=True, fmt="svg", interactive=False,
contribution=None):
"""
thellier_magic plots arai and other useful plots for Thellier-type experimental data
Parameter... | python | def thellier_magic(meas_file="measurements.txt", dir_path=".", input_dir_path="",
spec="", n_specs=5, save_plots=True, fmt="svg", interactive=False,
contribution=None):
"""
thellier_magic plots arai and other useful plots for Thellier-type experimental data
Parameter... | [
"def",
"thellier_magic",
"(",
"meas_file",
"=",
"\"measurements.txt\"",
",",
"dir_path",
"=",
"\".\"",
",",
"input_dir_path",
"=",
"\"\"",
",",
"spec",
"=",
"\"\"",
",",
"n_specs",
"=",
"5",
",",
"save_plots",
"=",
"True",
",",
"fmt",
"=",
"\"svg\"",
",",
... | thellier_magic plots arai and other useful plots for Thellier-type experimental data
Parameters
----------
meas_file : str
input measurement file, default "measurements.txt"
dir_path : str
output directory, default "."
Note: if using Windows, all figures will be saved to workin... | [
"thellier_magic",
"plots",
"arai",
"and",
"other",
"useful",
"plots",
"for",
"Thellier",
"-",
"type",
"experimental",
"data"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L10585-L10770 |
PmagPy/PmagPy | pmagpy/ipmag.py | hysteresis_magic | def hysteresis_magic(output_dir_path=".", input_dir_path="", spec_file="specimens.txt",
meas_file="measurements.txt", fmt="svg",
save_plots=True, make_plots=True, pltspec="", n_specs=5, interactive=False):
"""
Calculate hysteresis parameters and plot hysteresis data.
... | python | def hysteresis_magic(output_dir_path=".", input_dir_path="", spec_file="specimens.txt",
meas_file="measurements.txt", fmt="svg",
save_plots=True, make_plots=True, pltspec="", n_specs=5, interactive=False):
"""
Calculate hysteresis parameters and plot hysteresis data.
... | [
"def",
"hysteresis_magic",
"(",
"output_dir_path",
"=",
"\".\"",
",",
"input_dir_path",
"=",
"\"\"",
",",
"spec_file",
"=",
"\"specimens.txt\"",
",",
"meas_file",
"=",
"\"measurements.txt\"",
",",
"fmt",
"=",
"\"svg\"",
",",
"save_plots",
"=",
"True",
",",
"make... | Calculate hysteresis parameters and plot hysteresis data.
Plotting may be called interactively with save_plots==False,
or be suppressed entirely with make_plots==False.
Parameters
----------
output_dir_path : str, default "."
Note: if using Windows, all figures will be saved to working dire... | [
"Calculate",
"hysteresis",
"parameters",
"and",
"plot",
"hysteresis",
"data",
".",
"Plotting",
"may",
"be",
"called",
"interactively",
"with",
"save_plots",
"==",
"False",
"or",
"be",
"suppressed",
"entirely",
"with",
"make_plots",
"==",
"False",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L10773-L11118 |
PmagPy/PmagPy | pmagpy/ipmag.py | sites_extract | def sites_extract(site_file='sites.txt', directions_file='directions.xls',
intensity_file='intensity.xls', info_file='site_info.xls',
output_dir_path='.', input_dir_path='', latex=False):
"""
Extracts directional and/or intensity data from a MagIC 3.0 format sites.txt file.
... | python | def sites_extract(site_file='sites.txt', directions_file='directions.xls',
intensity_file='intensity.xls', info_file='site_info.xls',
output_dir_path='.', input_dir_path='', latex=False):
"""
Extracts directional and/or intensity data from a MagIC 3.0 format sites.txt file.
... | [
"def",
"sites_extract",
"(",
"site_file",
"=",
"'sites.txt'",
",",
"directions_file",
"=",
"'directions.xls'",
",",
"intensity_file",
"=",
"'intensity.xls'",
",",
"info_file",
"=",
"'site_info.xls'",
",",
"output_dir_path",
"=",
"'.'",
",",
"input_dir_path",
"=",
"'... | Extracts directional and/or intensity data from a MagIC 3.0 format sites.txt file.
Default output format is an Excel file.
Optional latex format longtable file which can be uploaded to Overleaf or
typeset with latex on your own computer.
Parameters
___________
site_file : str
input fil... | [
"Extracts",
"directional",
"and",
"/",
"or",
"intensity",
"data",
"from",
"a",
"MagIC",
"3",
".",
"0",
"format",
"sites",
".",
"txt",
"file",
".",
"Default",
"output",
"format",
"is",
"an",
"Excel",
"file",
".",
"Optional",
"latex",
"format",
"longtable",
... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L11121-L11240 |
PmagPy/PmagPy | pmagpy/ipmag.py | specimens_extract | def specimens_extract(spec_file='specimens.txt', output_file='specimens.xls', landscape=False,
longtable=False, output_dir_path='.', input_dir_path='', latex=False):
"""
Extracts specimen results from a MagIC 3.0 format specimens.txt file.
Default output format is an Excel file.
t... | python | def specimens_extract(spec_file='specimens.txt', output_file='specimens.xls', landscape=False,
longtable=False, output_dir_path='.', input_dir_path='', latex=False):
"""
Extracts specimen results from a MagIC 3.0 format specimens.txt file.
Default output format is an Excel file.
t... | [
"def",
"specimens_extract",
"(",
"spec_file",
"=",
"'specimens.txt'",
",",
"output_file",
"=",
"'specimens.xls'",
",",
"landscape",
"=",
"False",
",",
"longtable",
"=",
"False",
",",
"output_dir_path",
"=",
"'.'",
",",
"input_dir_path",
"=",
"''",
",",
"latex",
... | Extracts specimen results from a MagIC 3.0 format specimens.txt file.
Default output format is an Excel file.
typeset with latex on your own computer.
Parameters
___________
spec_file : str, default "specimens.txt"
input file name
output_file : str, default "specimens.xls"
ou... | [
"Extracts",
"specimen",
"results",
"from",
"a",
"MagIC",
"3",
".",
"0",
"format",
"specimens",
".",
"txt",
"file",
".",
"Default",
"output",
"format",
"is",
"an",
"Excel",
"file",
".",
"typeset",
"with",
"latex",
"on",
"your",
"own",
"computer",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L11243-L11310 |
PmagPy/PmagPy | pmagpy/ipmag.py | criteria_extract | def criteria_extract(crit_file='criteria.txt', output_file='criteria.xls',
output_dir_path='.', input_dir_path='', latex=False):
"""
Extracts criteria from a MagIC 3.0 format criteria.txt file.
Default output format is an Excel file.
typeset with latex on your own computer.
Pa... | python | def criteria_extract(crit_file='criteria.txt', output_file='criteria.xls',
output_dir_path='.', input_dir_path='', latex=False):
"""
Extracts criteria from a MagIC 3.0 format criteria.txt file.
Default output format is an Excel file.
typeset with latex on your own computer.
Pa... | [
"def",
"criteria_extract",
"(",
"crit_file",
"=",
"'criteria.txt'",
",",
"output_file",
"=",
"'criteria.xls'",
",",
"output_dir_path",
"=",
"'.'",
",",
"input_dir_path",
"=",
"''",
",",
"latex",
"=",
"False",
")",
":",
"input_dir_path",
",",
"output_dir_path",
"... | Extracts criteria from a MagIC 3.0 format criteria.txt file.
Default output format is an Excel file.
typeset with latex on your own computer.
Parameters
___________
crit_file : str, default "criteria.txt"
input file name
output_file : str, default "criteria.xls"
output file n... | [
"Extracts",
"criteria",
"from",
"a",
"MagIC",
"3",
".",
"0",
"format",
"criteria",
".",
"txt",
"file",
".",
"Default",
"output",
"format",
"is",
"an",
"Excel",
"file",
".",
"typeset",
"with",
"latex",
"on",
"your",
"own",
"computer",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L11313-L11381 |
PmagPy/PmagPy | pmagpy/ipmag.py | eqarea_magic | def eqarea_magic(in_file='sites.txt', dir_path=".", input_dir_path="",
spec_file="specimens.txt", samp_file="samples.txt",
site_file="sites.txt", loc_file="locations.txt",
plot_by="all", crd="g", ignore_tilt=False,
save_plots=True, fmt="svg", contour=False, color_map="coo... | python | def eqarea_magic(in_file='sites.txt', dir_path=".", input_dir_path="",
spec_file="specimens.txt", samp_file="samples.txt",
site_file="sites.txt", loc_file="locations.txt",
plot_by="all", crd="g", ignore_tilt=False,
save_plots=True, fmt="svg", contour=False, color_map="coo... | [
"def",
"eqarea_magic",
"(",
"in_file",
"=",
"'sites.txt'",
",",
"dir_path",
"=",
"\".\"",
",",
"input_dir_path",
"=",
"\"\"",
",",
"spec_file",
"=",
"\"specimens.txt\"",
",",
"samp_file",
"=",
"\"samples.txt\"",
",",
"site_file",
"=",
"\"sites.txt\"",
",",
"loc_... | makes equal area projections from declination/inclination data
Parameters
----------
in_file : str, default "sites.txt"
dir_path : str
output directory, default "."
input_dir_path : str
input file directory (if different from dir_path), default ""
spec_file : str
input s... | [
"makes",
"equal",
"area",
"projections",
"from",
"declination",
"/",
"inclination",
"data"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L11384-L11861 |
PmagPy/PmagPy | pmagpy/ipmag.py | polemap_magic | def polemap_magic(loc_file="locations.txt", dir_path=".", interactive=False, crd="",
sym='ro', symsize=40, rsym='g^', rsymsize=40,
fmt="pdf", res="c", proj="ortho",
flip=False, anti=False, fancy=False,
ell=False, ages=False, lat_0=90., lon_0=0., sa... | python | def polemap_magic(loc_file="locations.txt", dir_path=".", interactive=False, crd="",
sym='ro', symsize=40, rsym='g^', rsymsize=40,
fmt="pdf", res="c", proj="ortho",
flip=False, anti=False, fancy=False,
ell=False, ages=False, lat_0=90., lon_0=0., sa... | [
"def",
"polemap_magic",
"(",
"loc_file",
"=",
"\"locations.txt\"",
",",
"dir_path",
"=",
"\".\"",
",",
"interactive",
"=",
"False",
",",
"crd",
"=",
"\"\"",
",",
"sym",
"=",
"'ro'",
",",
"symsize",
"=",
"40",
",",
"rsym",
"=",
"'g^'",
",",
"rsymsize",
... | Use a MagIC format locations table to plot poles.
Parameters
----------
loc_file : str, default "locations.txt"
dir_path : str, default "."
directory name to find loc_file in (if not included in loc_file)
interactive : bool, default False
if True, interactively plot and display
... | [
"Use",
"a",
"MagIC",
"format",
"locations",
"table",
"to",
"plot",
"poles",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L11864-L12180 |
PmagPy/PmagPy | pmagpy/ipmag.py | chi_magic | def chi_magic(infile="measurements.txt", dir_path=".", experiments="",
fmt="svg", save_plots=True, interactive=False, contribution=None):
"""
Parameters
----------
infile : str, default "measurements.txt"
measurement infile
dir_path : str, default "."
input directory
... | python | def chi_magic(infile="measurements.txt", dir_path=".", experiments="",
fmt="svg", save_plots=True, interactive=False, contribution=None):
"""
Parameters
----------
infile : str, default "measurements.txt"
measurement infile
dir_path : str, default "."
input directory
... | [
"def",
"chi_magic",
"(",
"infile",
"=",
"\"measurements.txt\"",
",",
"dir_path",
"=",
"\".\"",
",",
"experiments",
"=",
"\"\"",
",",
"fmt",
"=",
"\"svg\"",
",",
"save_plots",
"=",
"True",
",",
"interactive",
"=",
"False",
",",
"contribution",
"=",
"None",
... | Parameters
----------
infile : str, default "measurements.txt"
measurement infile
dir_path : str, default "."
input directory
experiments : str, default ""
experiment name to plot
fmt : str, default "svg"
format for figures, ["svg", "jpg", "pdf", "png"]
save_plots... | [
"Parameters",
"----------",
"infile",
":",
"str",
"default",
"measurements",
".",
"txt",
"measurement",
"infile",
"dir_path",
":",
"str",
"default",
".",
"input",
"directory",
"experiments",
":",
"str",
"default",
"experiment",
"name",
"to",
"plot",
"fmt",
":",
... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L12183-L12291 |
PmagPy/PmagPy | pmagpy/ipmag.py | quick_hyst | def quick_hyst(dir_path=".", meas_file="measurements.txt", save_plots=True,
interactive=False, fmt="png", specimen="", verbose=True, n_plots=10,
contribution=None):
"""
makes specimen plots of hysteresis data
Parameters
----------
dir_path : str, default "."
in... | python | def quick_hyst(dir_path=".", meas_file="measurements.txt", save_plots=True,
interactive=False, fmt="png", specimen="", verbose=True, n_plots=10,
contribution=None):
"""
makes specimen plots of hysteresis data
Parameters
----------
dir_path : str, default "."
in... | [
"def",
"quick_hyst",
"(",
"dir_path",
"=",
"\".\"",
",",
"meas_file",
"=",
"\"measurements.txt\"",
",",
"save_plots",
"=",
"True",
",",
"interactive",
"=",
"False",
",",
"fmt",
"=",
"\"png\"",
",",
"specimen",
"=",
"\"\"",
",",
"verbose",
"=",
"True",
",",... | makes specimen plots of hysteresis data
Parameters
----------
dir_path : str, default "."
input directory
meas_file : str, default "measurements.txt"
name of MagIC measurement file
save_plots : bool, default True
save figures
interactive : bool, default False
if ... | [
"makes",
"specimen",
"plots",
"of",
"hysteresis",
"data"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L12294-L12527 |
PmagPy/PmagPy | pmagpy/ipmag.py | vgpmap_magic | def vgpmap_magic(dir_path=".", results_file="sites.txt", crd="",
sym='ro', size=8, rsym="g^", rsize=8,
fmt="pdf", res="c", proj="ortho",
flip=False, anti=False, fancy=False,
ell=False, ages=False, lat_0=0, lon_0=0,
save_plots=True, int... | python | def vgpmap_magic(dir_path=".", results_file="sites.txt", crd="",
sym='ro', size=8, rsym="g^", rsize=8,
fmt="pdf", res="c", proj="ortho",
flip=False, anti=False, fancy=False,
ell=False, ages=False, lat_0=0, lon_0=0,
save_plots=True, int... | [
"def",
"vgpmap_magic",
"(",
"dir_path",
"=",
"\".\"",
",",
"results_file",
"=",
"\"sites.txt\"",
",",
"crd",
"=",
"\"\"",
",",
"sym",
"=",
"'ro'",
",",
"size",
"=",
"8",
",",
"rsym",
"=",
"\"g^\"",
",",
"rsize",
"=",
"8",
",",
"fmt",
"=",
"\"pdf\"",
... | makes a map of vgps and a95/dp,dm for site means in a sites table
Parameters
----------
dir_path : str, default "."
input directory path
results_file : str, default "sites.txt"
name of MagIC format sites file
crd : str, default ""
coordinate system [g, t] (geographic, tilt_co... | [
"makes",
"a",
"map",
"of",
"vgps",
"and",
"a95",
"/",
"dp",
"dm",
"for",
"site",
"means",
"in",
"a",
"sites",
"table"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L12530-L12756 |
PmagPy/PmagPy | pmagpy/ipmag.py | histplot | def histplot(infile="", data=(), outfile="",
xlab='x', binsize=False, norm=1,
fmt='svg', save_plots=True, interactive=False):
"""
makes histograms for data
Parameters
----------
infile : str, default ""
input file name
format: single variable
data : lis... | python | def histplot(infile="", data=(), outfile="",
xlab='x', binsize=False, norm=1,
fmt='svg', save_plots=True, interactive=False):
"""
makes histograms for data
Parameters
----------
infile : str, default ""
input file name
format: single variable
data : lis... | [
"def",
"histplot",
"(",
"infile",
"=",
"\"\"",
",",
"data",
"=",
"(",
")",
",",
"outfile",
"=",
"\"\"",
",",
"xlab",
"=",
"'x'",
",",
"binsize",
"=",
"False",
",",
"norm",
"=",
"1",
",",
"fmt",
"=",
"'svg'",
",",
"save_plots",
"=",
"True",
",",
... | makes histograms for data
Parameters
----------
infile : str, default ""
input file name
format: single variable
data : list-like, default ()
list/array of values to plot if infile is not provided
outfile : str, default ""
name for plot, if not provided defaults to h... | [
"makes",
"histograms",
"for",
"data"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L12759-L12855 |
PmagPy/PmagPy | pmagpy/ipmag.py | Site.parse_fits | def parse_fits(self, fit_name):
'''USE PARSE_ALL_FITS unless otherwise necessary
Isolate fits by the name of the fit; we also set 'specimen_tilt_correction' to zero in order
to only include data in geographic coordinates - THIS NEEDS TO BE GENERALIZED
'''
fits = self.fits.loc[sel... | python | def parse_fits(self, fit_name):
'''USE PARSE_ALL_FITS unless otherwise necessary
Isolate fits by the name of the fit; we also set 'specimen_tilt_correction' to zero in order
to only include data in geographic coordinates - THIS NEEDS TO BE GENERALIZED
'''
fits = self.fits.loc[sel... | [
"def",
"parse_fits",
"(",
"self",
",",
"fit_name",
")",
":",
"fits",
"=",
"self",
".",
"fits",
".",
"loc",
"[",
"self",
".",
"fits",
".",
"specimen_comp_name",
"==",
"fit_name",
"]",
".",
"loc",
"[",
"self",
".",
"fits",
".",
"specimen_tilt_correction",
... | USE PARSE_ALL_FITS unless otherwise necessary
Isolate fits by the name of the fit; we also set 'specimen_tilt_correction' to zero in order
to only include data in geographic coordinates - THIS NEEDS TO BE GENERALIZED | [
"USE",
"PARSE_ALL_FITS",
"unless",
"otherwise",
"necessary",
"Isolate",
"fits",
"by",
"the",
"name",
"of",
"the",
"fit",
";",
"we",
"also",
"set",
"specimen_tilt_correction",
"to",
"zero",
"in",
"order",
"to",
"only",
"include",
"data",
"in",
"geographic",
"co... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/ipmag.py#L6411-L6424 |
PmagPy/PmagPy | programs/deprecated/measurements_normalize.py | main | def main():
"""
NAME
measurements_normalize.py
DESCRIPTION
takes magic_measurements file and normalized moment by sample_weight and sample_volume in the er_specimens table
SYNTAX
measurements_normalize.py [command line options]
OPTIONS
-f FILE: specify input fi... | python | def main():
"""
NAME
measurements_normalize.py
DESCRIPTION
takes magic_measurements file and normalized moment by sample_weight and sample_volume in the er_specimens table
SYNTAX
measurements_normalize.py [command line options]
OPTIONS
-f FILE: specify input fi... | [
"def",
"main",
"(",
")",
":",
"#",
"# initialize variables",
"#",
"#",
"#",
"dir_path",
"=",
"'.'",
"if",
"\"-WD\"",
"in",
"sys",
".",
"argv",
":",
"ind",
"=",
"sys",
".",
"argv",
".",
"index",
"(",
"\"-WD\"",
")",
"dir_path",
"=",
"sys",
".",
"arg... | NAME
measurements_normalize.py
DESCRIPTION
takes magic_measurements file and normalized moment by sample_weight and sample_volume in the er_specimens table
SYNTAX
measurements_normalize.py [command line options]
OPTIONS
-f FILE: specify input file, default is: magic_me... | [
"NAME",
"measurements_normalize",
".",
"py",
"DESCRIPTION",
"takes",
"magic_measurements",
"file",
"and",
"normalized",
"moment",
"by",
"sample_weight",
"and",
"sample_volume",
"in",
"the",
"er_specimens",
"table",
"SYNTAX",
"measurements_normalize",
".",
"py",
"[",
"... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/deprecated/measurements_normalize.py#L9-L66 |
PmagPy/PmagPy | dialogs/pmag_gui_menu3.py | MagICMenu.on_quit | def on_quit(self, event, wind=None):
"""
shut down application if in the main frame.
otherwise, destroy the top window (wind) and restore
the main frame.
"""
if wind:
wind.Destroy()
if not self.parent.IsShown():
self.on_show_mainframe(None)... | python | def on_quit(self, event, wind=None):
"""
shut down application if in the main frame.
otherwise, destroy the top window (wind) and restore
the main frame.
"""
if wind:
wind.Destroy()
if not self.parent.IsShown():
self.on_show_mainframe(None)... | [
"def",
"on_quit",
"(",
"self",
",",
"event",
",",
"wind",
"=",
"None",
")",
":",
"if",
"wind",
":",
"wind",
".",
"Destroy",
"(",
")",
"if",
"not",
"self",
".",
"parent",
".",
"IsShown",
"(",
")",
":",
"self",
".",
"on_show_mainframe",
"(",
"None",
... | shut down application if in the main frame.
otherwise, destroy the top window (wind) and restore
the main frame. | [
"shut",
"down",
"application",
"if",
"in",
"the",
"main",
"frame",
".",
"otherwise",
"destroy",
"the",
"top",
"window",
"(",
"wind",
")",
"and",
"restore",
"the",
"main",
"frame",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_gui_menu3.py#L146-L159 |
PmagPy/PmagPy | dialogs/pmag_gui_menu3.py | MagICMenu.on_show_mainframe | def on_show_mainframe(self, event):
"""
Show mainframe window
"""
self.parent.Enable()
self.parent.Show()
self.parent.Raise() | python | def on_show_mainframe(self, event):
"""
Show mainframe window
"""
self.parent.Enable()
self.parent.Show()
self.parent.Raise() | [
"def",
"on_show_mainframe",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"parent",
".",
"Enable",
"(",
")",
"self",
".",
"parent",
".",
"Show",
"(",
")",
"self",
".",
"parent",
".",
"Raise",
"(",
")"
] | Show mainframe window | [
"Show",
"mainframe",
"window"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_gui_menu3.py#L162-L168 |
PmagPy/PmagPy | dialogs/pmag_gui_menu3.py | MagICMenu.on_clear | def on_clear(self, event):
"""
initialize window to allow user to empty the working directory
"""
dia = pmag_menu_dialogs.ClearWD(self.parent, self.parent.WD)
clear = dia.do_clear()
if clear:
# clear directory, but use previously acquired data_model
... | python | def on_clear(self, event):
"""
initialize window to allow user to empty the working directory
"""
dia = pmag_menu_dialogs.ClearWD(self.parent, self.parent.WD)
clear = dia.do_clear()
if clear:
# clear directory, but use previously acquired data_model
... | [
"def",
"on_clear",
"(",
"self",
",",
"event",
")",
":",
"dia",
"=",
"pmag_menu_dialogs",
".",
"ClearWD",
"(",
"self",
".",
"parent",
",",
"self",
".",
"parent",
".",
"WD",
")",
"clear",
"=",
"dia",
".",
"do_clear",
"(",
")",
"if",
"clear",
":",
"# ... | initialize window to allow user to empty the working directory | [
"initialize",
"window",
"to",
"allow",
"user",
"to",
"empty",
"the",
"working",
"directory"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_gui_menu3.py#L171-L183 |
PmagPy/PmagPy | programs/deprecated/plotxy_magic.py | main | def main():
"""
NAME
plotxy_magic.py
DESCRIPTION
Makes simple X,Y plots
INPUT FORMAT
Any MagIC formatted file
SYNTAX
plotxy_magic.py [command line options]
OPTIONS
-h prints this help message
-f FILE to set file name on command rec
-c co... | python | def main():
"""
NAME
plotxy_magic.py
DESCRIPTION
Makes simple X,Y plots
INPUT FORMAT
Any MagIC formatted file
SYNTAX
plotxy_magic.py [command line options]
OPTIONS
-h prints this help message
-f FILE to set file name on command rec
-c co... | [
"def",
"main",
"(",
")",
":",
"col1",
",",
"col2",
"=",
"0",
",",
"1",
"sym",
",",
"size",
"=",
"'ro'",
",",
"20",
"xlab",
",",
"ylab",
"=",
"''",
",",
"''",
"lines",
"=",
"0",
"if",
"'-h'",
"in",
"sys",
".",
"argv",
":",
"print",
"(",
"mai... | NAME
plotxy_magic.py
DESCRIPTION
Makes simple X,Y plots
INPUT FORMAT
Any MagIC formatted file
SYNTAX
plotxy_magic.py [command line options]
OPTIONS
-h prints this help message
-f FILE to set file name on command rec
-c col1 col2 specify columns ... | [
"NAME",
"plotxy_magic",
".",
"py"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/deprecated/plotxy_magic.py#L11-L117 |
PmagPy/PmagPy | programs/lowrie.py | main | def main():
"""
NAME
lowrie.py
DESCRIPTION
plots intensity decay curves for Lowrie experiments
SYNTAX
lowrie -h [command line options]
INPUT
takes SIO formatted input files
OPTIONS
-h prints help message and quits
-f FILE: specify input file
... | python | def main():
"""
NAME
lowrie.py
DESCRIPTION
plots intensity decay curves for Lowrie experiments
SYNTAX
lowrie -h [command line options]
INPUT
takes SIO formatted input files
OPTIONS
-h prints help message and quits
-f FILE: specify input file
... | [
"def",
"main",
"(",
")",
":",
"fmt",
",",
"plot",
"=",
"'svg'",
",",
"0",
"FIG",
"=",
"{",
"}",
"# plot dictionary",
"FIG",
"[",
"'lowrie'",
"]",
"=",
"1",
"# demag is figure 1",
"pmagplotlib",
".",
"plot_init",
"(",
"FIG",
"[",
"'lowrie'",
"]",
",",
... | NAME
lowrie.py
DESCRIPTION
plots intensity decay curves for Lowrie experiments
SYNTAX
lowrie -h [command line options]
INPUT
takes SIO formatted input files
OPTIONS
-h prints help message and quits
-f FILE: specify input file
-N do not normalize ... | [
"NAME",
"lowrie",
".",
"py"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/lowrie.py#L17-L122 |
PmagPy/PmagPy | programs/apwp.py | main | def main():
"""
NAME
apwp.py
DESCRIPTION
returns predicted paleolatitudes, directions and pole latitude/longitude
from apparent polar wander paths of Besse and Courtillot (2002).
SYNTAX
apwp.py [command line options][< filename]
OPTIONS
-h prints help messa... | python | def main():
"""
NAME
apwp.py
DESCRIPTION
returns predicted paleolatitudes, directions and pole latitude/longitude
from apparent polar wander paths of Besse and Courtillot (2002).
SYNTAX
apwp.py [command line options][< filename]
OPTIONS
-h prints help messa... | [
"def",
"main",
"(",
")",
":",
"infile",
",",
"outfile",
",",
"data",
",",
"indata",
"=",
"\"\"",
",",
"\"\"",
",",
"[",
"]",
",",
"[",
"]",
"if",
"'-h'",
"in",
"sys",
".",
"argv",
":",
"print",
"(",
"main",
".",
"__doc__",
")",
"sys",
".",
"e... | NAME
apwp.py
DESCRIPTION
returns predicted paleolatitudes, directions and pole latitude/longitude
from apparent polar wander paths of Besse and Courtillot (2002).
SYNTAX
apwp.py [command line options][< filename]
OPTIONS
-h prints help message and quits
-i ... | [
"NAME",
"apwp",
".",
"py"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/apwp.py#L13-L117 |
PmagPy/PmagPy | SPD/lib/lib_directional_statistics.py | tauV | def tauV(T):
"""
gets the eigenvalues (tau) and eigenvectors (V) from matrix T
"""
t,V,tr=[],[],0.
ind1,ind2,ind3=0,1,2
evalues,evectmps=numpy.linalg.eig(T)
evectors=numpy.transpose(evectmps) # to make compatible with Numeric convention
for tau in evalues:
tr += tau # tr ... | python | def tauV(T):
"""
gets the eigenvalues (tau) and eigenvectors (V) from matrix T
"""
t,V,tr=[],[],0.
ind1,ind2,ind3=0,1,2
evalues,evectmps=numpy.linalg.eig(T)
evectors=numpy.transpose(evectmps) # to make compatible with Numeric convention
for tau in evalues:
tr += tau # tr ... | [
"def",
"tauV",
"(",
"T",
")",
":",
"t",
",",
"V",
",",
"tr",
"=",
"[",
"]",
",",
"[",
"]",
",",
"0.",
"ind1",
",",
"ind2",
",",
"ind3",
"=",
"0",
",",
"1",
",",
"2",
"evalues",
",",
"evectmps",
"=",
"numpy",
".",
"linalg",
".",
"eig",
"("... | gets the eigenvalues (tau) and eigenvectors (V) from matrix T | [
"gets",
"the",
"eigenvalues",
"(",
"tau",
")",
"and",
"eigenvectors",
"(",
"V",
")",
"from",
"matrix",
"T"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/lib/lib_directional_statistics.py#L48-L79 |
PmagPy/PmagPy | SPD/lib/lib_directional_statistics.py | get_PD_direction | def get_PD_direction(X1_prime, X2_prime, X3_prime, PD):
"""takes arrays of X1_prime, X2_prime, X3_prime, and the PD.
checks that the PD vector direction is correct"""
n = len(X1_prime) - 1
X1 = X1_prime[0] - X1_prime[n]
X2 = X2_prime[0] - X2_prime[n]
X3 = X3_prime[0] - X3_prime[n]
R= numpy... | python | def get_PD_direction(X1_prime, X2_prime, X3_prime, PD):
"""takes arrays of X1_prime, X2_prime, X3_prime, and the PD.
checks that the PD vector direction is correct"""
n = len(X1_prime) - 1
X1 = X1_prime[0] - X1_prime[n]
X2 = X2_prime[0] - X2_prime[n]
X3 = X3_prime[0] - X3_prime[n]
R= numpy... | [
"def",
"get_PD_direction",
"(",
"X1_prime",
",",
"X2_prime",
",",
"X3_prime",
",",
"PD",
")",
":",
"n",
"=",
"len",
"(",
"X1_prime",
")",
"-",
"1",
"X1",
"=",
"X1_prime",
"[",
"0",
"]",
"-",
"X1_prime",
"[",
"n",
"]",
"X2",
"=",
"X2_prime",
"[",
... | takes arrays of X1_prime, X2_prime, X3_prime, and the PD.
checks that the PD vector direction is correct | [
"takes",
"arrays",
"of",
"X1_prime",
"X2_prime",
"X3_prime",
"and",
"the",
"PD",
".",
"checks",
"that",
"the",
"PD",
"vector",
"direction",
"is",
"correct"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/lib/lib_directional_statistics.py#L81-L101 |
PmagPy/PmagPy | SPD/lib/lib_directional_statistics.py | get_MAD | def get_MAD(tau):
"""
input: eigenvalues of PCA matrix
output: Maximum Angular Deviation
"""
# tau is ordered so that tau[0] > tau[1] > tau[2]
for t in tau:
if isinstance(t, complex):
return -999
MAD = math.degrees(numpy.arctan(numpy.sqrt(old_div((tau[1] + tau[2]), tau[0]... | python | def get_MAD(tau):
"""
input: eigenvalues of PCA matrix
output: Maximum Angular Deviation
"""
# tau is ordered so that tau[0] > tau[1] > tau[2]
for t in tau:
if isinstance(t, complex):
return -999
MAD = math.degrees(numpy.arctan(numpy.sqrt(old_div((tau[1] + tau[2]), tau[0]... | [
"def",
"get_MAD",
"(",
"tau",
")",
":",
"# tau is ordered so that tau[0] > tau[1] > tau[2]",
"for",
"t",
"in",
"tau",
":",
"if",
"isinstance",
"(",
"t",
",",
"complex",
")",
":",
"return",
"-",
"999",
"MAD",
"=",
"math",
".",
"degrees",
"(",
"numpy",
".",
... | input: eigenvalues of PCA matrix
output: Maximum Angular Deviation | [
"input",
":",
"eigenvalues",
"of",
"PCA",
"matrix",
"output",
":",
"Maximum",
"Angular",
"Deviation"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/lib/lib_directional_statistics.py#L140-L150 |
PmagPy/PmagPy | SPD/lib/lib_directional_statistics.py | dir2cart | def dir2cart(d): # from pmag.py
"""converts list or array of vector directions, in degrees, to array of cartesian coordinates, in x,y,z form """
ints = numpy.ones(len(d)).transpose() # get an array of ones to plug into dec,inc pairs
d = numpy.array(d)
rad = old_div(numpy.pi, 180.)
if le... | python | def dir2cart(d): # from pmag.py
"""converts list or array of vector directions, in degrees, to array of cartesian coordinates, in x,y,z form """
ints = numpy.ones(len(d)).transpose() # get an array of ones to plug into dec,inc pairs
d = numpy.array(d)
rad = old_div(numpy.pi, 180.)
if le... | [
"def",
"dir2cart",
"(",
"d",
")",
":",
"# from pmag.py",
"ints",
"=",
"numpy",
".",
"ones",
"(",
"len",
"(",
"d",
")",
")",
".",
"transpose",
"(",
")",
"# get an array of ones to plug into dec,inc pairs ",
"d",
"=",
"numpy",
".",
"array",
"(",
"d... | converts list or array of vector directions, in degrees, to array of cartesian coordinates, in x,y,z form | [
"converts",
"list",
"or",
"array",
"of",
"vector",
"directions",
"in",
"degrees",
"to",
"array",
"of",
"cartesian",
"coordinates",
"in",
"x",
"y",
"z",
"form"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/lib/lib_directional_statistics.py#L152-L170 |
PmagPy/PmagPy | SPD/lib/lib_directional_statistics.py | pmag_angle | def pmag_angle(D1,D2): # use this
"""
finds the angle between lists of two directions D1,D2
"""
D1 = numpy.array(D1)
if len(D1.shape) > 1:
D1 = D1[:,0:2] # strip off intensity
else: D1 = D1[:2]
D2 = numpy.array(D2)
if len(D2.shape) > 1:
D2 = D2[:,0:2] # strip o... | python | def pmag_angle(D1,D2): # use this
"""
finds the angle between lists of two directions D1,D2
"""
D1 = numpy.array(D1)
if len(D1.shape) > 1:
D1 = D1[:,0:2] # strip off intensity
else: D1 = D1[:2]
D2 = numpy.array(D2)
if len(D2.shape) > 1:
D2 = D2[:,0:2] # strip o... | [
"def",
"pmag_angle",
"(",
"D1",
",",
"D2",
")",
":",
"# use this ",
"D1",
"=",
"numpy",
".",
"array",
"(",
"D1",
")",
"if",
"len",
"(",
"D1",
".",
"shape",
")",
">",
"1",
":",
"D1",
"=",
"D1",
"[",
":",
",",
"0",
":",
"2",
"]",
"# strip off i... | finds the angle between lists of two directions D1,D2 | [
"finds",
"the",
"angle",
"between",
"lists",
"of",
"two",
"directions",
"D1",
"D2"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/lib/lib_directional_statistics.py#L172-L191 |
PmagPy/PmagPy | SPD/lib/lib_directional_statistics.py | new_get_angle_diff | def new_get_angle_diff(v1,v2):
"""returns angular difference in degrees between two vectors. may be more precise in certain cases. see SPD"""
v1 = numpy.array(v1)
v2 = numpy.array(v2)
angle = numpy.arctan2(numpy.linalg.norm(numpy.cross(v1, v2)), numpy.dot(v1, v2))
return math.degrees(angle) | python | def new_get_angle_diff(v1,v2):
"""returns angular difference in degrees between two vectors. may be more precise in certain cases. see SPD"""
v1 = numpy.array(v1)
v2 = numpy.array(v2)
angle = numpy.arctan2(numpy.linalg.norm(numpy.cross(v1, v2)), numpy.dot(v1, v2))
return math.degrees(angle) | [
"def",
"new_get_angle_diff",
"(",
"v1",
",",
"v2",
")",
":",
"v1",
"=",
"numpy",
".",
"array",
"(",
"v1",
")",
"v2",
"=",
"numpy",
".",
"array",
"(",
"v2",
")",
"angle",
"=",
"numpy",
".",
"arctan2",
"(",
"numpy",
".",
"linalg",
".",
"norm",
"(",... | returns angular difference in degrees between two vectors. may be more precise in certain cases. see SPD | [
"returns",
"angular",
"difference",
"in",
"degrees",
"between",
"two",
"vectors",
".",
"may",
"be",
"more",
"precise",
"in",
"certain",
"cases",
".",
"see",
"SPD"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/lib/lib_directional_statistics.py#L193-L198 |
PmagPy/PmagPy | SPD/lib/lib_directional_statistics.py | get_angle_difference | def get_angle_difference(v1, v2):
"""returns angular difference in degrees between two vectors. takes in cartesian coordinates."""
v1 = numpy.array(v1)
v2 = numpy.array(v2)
angle=numpy.arccos(old_div((numpy.dot(v1, v2) ), (numpy.sqrt(math.fsum(v1**2)) * numpy.sqrt(math.fsum(v2**2)))))
return ma... | python | def get_angle_difference(v1, v2):
"""returns angular difference in degrees between two vectors. takes in cartesian coordinates."""
v1 = numpy.array(v1)
v2 = numpy.array(v2)
angle=numpy.arccos(old_div((numpy.dot(v1, v2) ), (numpy.sqrt(math.fsum(v1**2)) * numpy.sqrt(math.fsum(v2**2)))))
return ma... | [
"def",
"get_angle_difference",
"(",
"v1",
",",
"v2",
")",
":",
"v1",
"=",
"numpy",
".",
"array",
"(",
"v1",
")",
"v2",
"=",
"numpy",
".",
"array",
"(",
"v2",
")",
"angle",
"=",
"numpy",
".",
"arccos",
"(",
"old_div",
"(",
"(",
"numpy",
".",
"dot"... | returns angular difference in degrees between two vectors. takes in cartesian coordinates. | [
"returns",
"angular",
"difference",
"in",
"degrees",
"between",
"two",
"vectors",
".",
"takes",
"in",
"cartesian",
"coordinates",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/lib/lib_directional_statistics.py#L201-L206 |
PmagPy/PmagPy | SPD/lib/lib_directional_statistics.py | get_ptrms_angle | def get_ptrms_angle(ptrms_best_fit_vector, B_lab_vector):
"""
gives angle between principal direction of the ptrm data and the b_lab vector. this is NOT in SPD, but taken from Ron Shaar's old thellier_gui.py code. see PmagPy on github
"""
ptrms_angle = math.degrees(math.acos(old_div(numpy.dot(ptrms_be... | python | def get_ptrms_angle(ptrms_best_fit_vector, B_lab_vector):
"""
gives angle between principal direction of the ptrm data and the b_lab vector. this is NOT in SPD, but taken from Ron Shaar's old thellier_gui.py code. see PmagPy on github
"""
ptrms_angle = math.degrees(math.acos(old_div(numpy.dot(ptrms_be... | [
"def",
"get_ptrms_angle",
"(",
"ptrms_best_fit_vector",
",",
"B_lab_vector",
")",
":",
"ptrms_angle",
"=",
"math",
".",
"degrees",
"(",
"math",
".",
"acos",
"(",
"old_div",
"(",
"numpy",
".",
"dot",
"(",
"ptrms_best_fit_vector",
",",
"B_lab_vector",
")",
",",
... | gives angle between principal direction of the ptrm data and the b_lab vector. this is NOT in SPD, but taken from Ron Shaar's old thellier_gui.py code. see PmagPy on github | [
"gives",
"angle",
"between",
"principal",
"direction",
"of",
"the",
"ptrm",
"data",
"and",
"the",
"b_lab",
"vector",
".",
"this",
"is",
"NOT",
"in",
"SPD",
"but",
"taken",
"from",
"Ron",
"Shaar",
"s",
"old",
"thellier_gui",
".",
"py",
"code",
".",
"see",... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/lib/lib_directional_statistics.py#L236-L241 |
PmagPy/PmagPy | programs/remove_bad_chars.py | main | def main():
"""
Take out dos problem characters from any file
"""
filename = pmag.get_named_arg('-f')
if not filename:
return
with open(filename, 'rb+') as f:
content = f.read()
f.seek(0)
f.write(content.replace(b'\r', b''))
f.truncate() | python | def main():
"""
Take out dos problem characters from any file
"""
filename = pmag.get_named_arg('-f')
if not filename:
return
with open(filename, 'rb+') as f:
content = f.read()
f.seek(0)
f.write(content.replace(b'\r', b''))
f.truncate() | [
"def",
"main",
"(",
")",
":",
"filename",
"=",
"pmag",
".",
"get_named_arg",
"(",
"'-f'",
")",
"if",
"not",
"filename",
":",
"return",
"with",
"open",
"(",
"filename",
",",
"'rb+'",
")",
"as",
"f",
":",
"content",
"=",
"f",
".",
"read",
"(",
")",
... | Take out dos problem characters from any file | [
"Take",
"out",
"dos",
"problem",
"characters",
"from",
"any",
"file"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/remove_bad_chars.py#L5-L16 |
PmagPy/PmagPy | dialogs/pmag_menu_dialogs.py | add_thellier_gui_criteria | def add_thellier_gui_criteria(acceptance_criteria):
'''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']:
acceptance_criteria[crit]={}
acceptance_cri... | python | def add_thellier_gui_criteria(acceptance_criteria):
'''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']:
acceptance_criteria[crit]={}
acceptance_cri... | [
"def",
"add_thellier_gui_criteria",
"(",
"acceptance_criteria",
")",
":",
"category",
"=",
"\"thellier_gui\"",
"for",
"crit",
"in",
"[",
"'sample_int_n_outlier_check'",
",",
"'site_int_n_outlier_check'",
"]",
":",
"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/dialogs/pmag_menu_dialogs.py#L1435-L1479 |
PmagPy/PmagPy | dialogs/pmag_menu_dialogs.py | Core_depthplot.on_okButton | def on_okButton(self, event):
"""
meas_file # -f magic_measurements_file
samp_file #-fsa er_samples_file
age_file # -fa er_ages_file
depth_scale # -ds scale
dmin, dmax # -d 1 50 # depth to plot
timescale, amin, amax (also sets pTS, pcol, width) = # -ts scale min... | python | def on_okButton(self, event):
"""
meas_file # -f magic_measurements_file
samp_file #-fsa er_samples_file
age_file # -fa er_ages_file
depth_scale # -ds scale
dmin, dmax # -d 1 50 # depth to plot
timescale, amin, amax (also sets pTS, pcol, width) = # -ts scale min... | [
"def",
"on_okButton",
"(",
"self",
",",
"event",
")",
":",
"def",
"check_input_dir_path",
"(",
"input_dir_path",
",",
"new_dir_path",
")",
":",
"if",
"input_dir_path",
"and",
"input_dir_path",
"!=",
"new_dir_path",
":",
"pw",
".",
"simple_warning",
"(",
"\"Pleas... | meas_file # -f magic_measurements_file
samp_file #-fsa er_samples_file
age_file # -fa er_ages_file
depth_scale # -ds scale
dmin, dmax # -d 1 50 # depth to plot
timescale, amin, amax (also sets pTS, pcol, width) = # -ts scale min max
sym, size # -sym symbol size
... | [
"meas_file",
"#",
"-",
"f",
"magic_measurements_file",
"samp_file",
"#",
"-",
"fsa",
"er_samples_file",
"age_file",
"#",
"-",
"fa",
"er_ages_file",
"depth_scale",
"#",
"-",
"ds",
"scale",
"dmin",
"dmax",
"#",
"-",
"d",
"1",
"50",
"#",
"depth",
"to",
"plot"... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_menu_dialogs.py#L1877-L2093 |
PmagPy/PmagPy | programs/deprecated/odp_srm_magic.py | main | def main():
"""
NAME
odp_srm_magic.py
DESCRIPTION
converts ODP measurement format files to magic_measurements format files
SYNTAX
odp_srm_magic.py [command line options]
OPTIONS
-h: prints the help message and quits.
-F FILE: specify output measurements fi... | python | def main():
"""
NAME
odp_srm_magic.py
DESCRIPTION
converts ODP measurement format files to magic_measurements format files
SYNTAX
odp_srm_magic.py [command line options]
OPTIONS
-h: prints the help message and quits.
-F FILE: specify output measurements fi... | [
"def",
"main",
"(",
")",
":",
"#",
"#",
"version_num",
"=",
"pmag",
".",
"get_version",
"(",
")",
"meas_file",
"=",
"'magic_measurements.txt'",
"samp_file",
"=",
"'er_samples.txt'",
"ErSpecs",
",",
"ErSamps",
",",
"ErSites",
",",
"ErLocs",
",",
"ErCits",
"="... | NAME
odp_srm_magic.py
DESCRIPTION
converts ODP measurement format files to magic_measurements format files
SYNTAX
odp_srm_magic.py [command line options]
OPTIONS
-h: prints the help message and quits.
-F FILE: specify output measurements file, default is magic_mea... | [
"NAME",
"odp_srm_magic",
".",
"py"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/deprecated/odp_srm_magic.py#L8-L192 |
PmagPy/PmagPy | programs/conversion_scripts/kly4s_magic.py | main | def main():
"""
NAME
kly4s_magic.py
DESCRIPTION
converts files generated by SIO kly4S labview program to MagIC formated
files for use with PmagPy plotting software
SYNTAX
kly4s_magic.py -h [command line options]
OPTIONS
-h: prints the help message and quits... | python | def main():
"""
NAME
kly4s_magic.py
DESCRIPTION
converts files generated by SIO kly4S labview program to MagIC formated
files for use with PmagPy plotting software
SYNTAX
kly4s_magic.py -h [command line options]
OPTIONS
-h: prints the help message and quits... | [
"def",
"main",
"(",
")",
":",
"args",
"=",
"sys",
".",
"argv",
"if",
"'-h'",
"in",
"args",
":",
"print",
"(",
"main",
".",
"__doc__",
")",
"sys",
".",
"exit",
"(",
")",
"dataframe",
"=",
"extractor",
".",
"command_line_dataframe",
"(",
"[",
"[",
"'... | NAME
kly4s_magic.py
DESCRIPTION
converts files generated by SIO kly4S labview program to MagIC formated
files for use with PmagPy plotting software
SYNTAX
kly4s_magic.py -h [command line options]
OPTIONS
-h: prints the help message and quits
-f FILE: specif... | [
"NAME",
"kly4s_magic",
".",
"py"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/conversion_scripts/kly4s_magic.py#L6-L89 |
PmagPy/PmagPy | programs/plotxy.py | main | def main():
"""
NAME
plotXY.py
DESCRIPTION
Makes simple X,Y plots
INPUT FORMAT
X,Y data in columns
SYNTAX
plotxy.py [command line options]
OPTIONS
-h prints this help message
-f FILE to set file name on command line
-c col1 col2 specify c... | python | def main():
"""
NAME
plotXY.py
DESCRIPTION
Makes simple X,Y plots
INPUT FORMAT
X,Y data in columns
SYNTAX
plotxy.py [command line options]
OPTIONS
-h prints this help message
-f FILE to set file name on command line
-c col1 col2 specify c... | [
"def",
"main",
"(",
")",
":",
"fmt",
",",
"plot",
"=",
"'svg'",
",",
"0",
"col1",
",",
"col2",
"=",
"0",
",",
"1",
"sym",
",",
"size",
"=",
"'ro'",
",",
"50",
"xlab",
",",
"ylab",
"=",
"''",
",",
"''",
"lines",
"=",
"0",
"if",
"'-h'",
"in",... | NAME
plotXY.py
DESCRIPTION
Makes simple X,Y plots
INPUT FORMAT
X,Y data in columns
SYNTAX
plotxy.py [command line options]
OPTIONS
-h prints this help message
-f FILE to set file name on command line
-c col1 col2 specify columns to plot
-... | [
"NAME",
"plotXY",
".",
"py"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/plotxy.py#L14-L135 |
PmagPy/PmagPy | programs/sort_specimens.py | main | def main():
"""
NAME
sort_specimens.py
DESCRIPTION
Reads in a pmag_specimen formatted file and separates it into different components (A,B...etc.)
SYNTAX
sort_specimens.py [-h] [command line options]
INPUT
takes pmag_specimens.txt formatted input file
OPTIONS... | python | def main():
"""
NAME
sort_specimens.py
DESCRIPTION
Reads in a pmag_specimen formatted file and separates it into different components (A,B...etc.)
SYNTAX
sort_specimens.py [-h] [command line options]
INPUT
takes pmag_specimens.txt formatted input file
OPTIONS... | [
"def",
"main",
"(",
")",
":",
"dir_path",
"=",
"'.'",
"inspec",
"=",
"\"pmag_specimens.txt\"",
"if",
"'-WD'",
"in",
"sys",
".",
"argv",
":",
"ind",
"=",
"sys",
".",
"argv",
".",
"index",
"(",
"'-WD'",
")",
"dir_path",
"=",
"sys",
".",
"argv",
"[",
... | NAME
sort_specimens.py
DESCRIPTION
Reads in a pmag_specimen formatted file and separates it into different components (A,B...etc.)
SYNTAX
sort_specimens.py [-h] [command line options]
INPUT
takes pmag_specimens.txt formatted input file
OPTIONS
-h: prints help... | [
"NAME",
"sort_specimens",
".",
"py"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/sort_specimens.py#L6-L67 |
PmagPy/PmagPy | programs/conversion_scripts/livdb_magic.py | convert_livdb_files_to_MagIC.create_menu | def create_menu(self):
""" Create menu
"""
self.menubar = wx.MenuBar()
menu_about = wx.Menu()
menu_help = menu_about.Append(-1, "&Some notes", "")
self.Bind(wx.EVT_MENU, self.on_menu_help, menu_help)
self.menubar.Append(menu_about, "& Instructions")
sel... | python | def create_menu(self):
""" Create menu
"""
self.menubar = wx.MenuBar()
menu_about = wx.Menu()
menu_help = menu_about.Append(-1, "&Some notes", "")
self.Bind(wx.EVT_MENU, self.on_menu_help, menu_help)
self.menubar.Append(menu_about, "& Instructions")
sel... | [
"def",
"create_menu",
"(",
"self",
")",
":",
"self",
".",
"menubar",
"=",
"wx",
".",
"MenuBar",
"(",
")",
"menu_about",
"=",
"wx",
".",
"Menu",
"(",
")",
"menu_help",
"=",
"menu_about",
".",
"Append",
"(",
"-",
"1",
",",
"\"&Some notes\"",
",",
"\"\"... | Create menu | [
"Create",
"menu"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/conversion_scripts/livdb_magic.py#L48-L59 |
PmagPy/PmagPy | dialogs/pmag_er_magic_dialogs.py | ErMagicCheckFrame3.InitSpecCheck | def InitSpecCheck(self):
"""
make an interactive grid in which users can edit specimen names
as well as which sample a specimen belongs to
"""
#wait = wx.BusyInfo("Please wait, working...")
#wx.SafeYield()
self.contribution.propagate_lithology_cols()
spec_... | python | def InitSpecCheck(self):
"""
make an interactive grid in which users can edit specimen names
as well as which sample a specimen belongs to
"""
#wait = wx.BusyInfo("Please wait, working...")
#wx.SafeYield()
self.contribution.propagate_lithology_cols()
spec_... | [
"def",
"InitSpecCheck",
"(",
"self",
")",
":",
"#wait = wx.BusyInfo(\"Please wait, working...\")",
"#wx.SafeYield()",
"self",
".",
"contribution",
".",
"propagate_lithology_cols",
"(",
")",
"spec_df",
"=",
"self",
".",
"contribution",
".",
"tables",
"[",
"'specimens'",
... | make an interactive grid in which users can edit specimen names
as well as which sample a specimen belongs to | [
"make",
"an",
"interactive",
"grid",
"in",
"which",
"users",
"can",
"edit",
"specimen",
"names",
"as",
"well",
"as",
"which",
"sample",
"a",
"specimen",
"belongs",
"to"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_er_magic_dialogs.py#L36-L65 |
PmagPy/PmagPy | dialogs/pmag_er_magic_dialogs.py | ErMagicCheckFrame3.InitSiteCheck | def InitSiteCheck(self):
"""
make an interactive grid in which users can edit site names
as well as which location a site belongs to
"""
# propagate average lat/lon info from samples table if
# available in samples and missing in sites
self.contribution.propagate_... | python | def InitSiteCheck(self):
"""
make an interactive grid in which users can edit site names
as well as which location a site belongs to
"""
# propagate average lat/lon info from samples table if
# available in samples and missing in sites
self.contribution.propagate_... | [
"def",
"InitSiteCheck",
"(",
"self",
")",
":",
"# propagate average lat/lon info from samples table if",
"# available in samples and missing in sites",
"self",
".",
"contribution",
".",
"propagate_average_up",
"(",
"cols",
"=",
"[",
"'lat'",
",",
"'lon'",
",",
"'height'",
... | make an interactive grid in which users can edit site names
as well as which location a site belongs to | [
"make",
"an",
"interactive",
"grid",
"in",
"which",
"users",
"can",
"edit",
"site",
"names",
"as",
"well",
"as",
"which",
"location",
"a",
"site",
"belongs",
"to"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_er_magic_dialogs.py#L103-L138 |
PmagPy/PmagPy | dialogs/pmag_er_magic_dialogs.py | ErMagicCheckFrame3.InitLocCheck | def InitLocCheck(self):
"""
make an interactive grid in which users can edit locations
"""
# if there is a location without a name, name it 'unknown'
self.contribution.rename_item('locations', 'nan', 'unknown')
# propagate lat/lon values from sites table
self.cont... | python | def InitLocCheck(self):
"""
make an interactive grid in which users can edit locations
"""
# if there is a location without a name, name it 'unknown'
self.contribution.rename_item('locations', 'nan', 'unknown')
# propagate lat/lon values from sites table
self.cont... | [
"def",
"InitLocCheck",
"(",
"self",
")",
":",
"# if there is a location without a name, name it 'unknown'",
"self",
".",
"contribution",
".",
"rename_item",
"(",
"'locations'",
",",
"'nan'",
",",
"'unknown'",
")",
"# propagate lat/lon values from sites table",
"self",
".",
... | make an interactive grid in which users can edit locations | [
"make",
"an",
"interactive",
"grid",
"in",
"which",
"users",
"can",
"edit",
"locations"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_er_magic_dialogs.py#L141-L178 |
PmagPy/PmagPy | dialogs/pmag_er_magic_dialogs.py | ErMagicCheckFrame3.InitAgeCheck | def InitAgeCheck(self):
"""make an interactive grid in which users can edit ages"""
age_df = self.contribution.tables['ages'].df
self.panel = wx.Panel(self, style=wx.SIMPLE_BORDER)
self.grid_frame = grid_frame3.GridFrame(self.contribution, self.WD,
... | python | def InitAgeCheck(self):
"""make an interactive grid in which users can edit ages"""
age_df = self.contribution.tables['ages'].df
self.panel = wx.Panel(self, style=wx.SIMPLE_BORDER)
self.grid_frame = grid_frame3.GridFrame(self.contribution, self.WD,
... | [
"def",
"InitAgeCheck",
"(",
"self",
")",
":",
"age_df",
"=",
"self",
".",
"contribution",
".",
"tables",
"[",
"'ages'",
"]",
".",
"df",
"self",
".",
"panel",
"=",
"wx",
".",
"Panel",
"(",
"self",
",",
"style",
"=",
"wx",
".",
"SIMPLE_BORDER",
")",
... | make an interactive grid in which users can edit ages | [
"make",
"an",
"interactive",
"grid",
"in",
"which",
"users",
"can",
"edit",
"ages"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_er_magic_dialogs.py#L181-L203 |
PmagPy/PmagPy | dialogs/pmag_er_magic_dialogs.py | ErMagicCheckFrame3.onContinue | def onContinue(self, event, grid, next_dia=None):#, age_data_type='site'):
"""
Save grid data in the data object
"""
# deselect column, including remove 'EDIT ALL' label
if self.grid_frame.drop_down_menu:
self.grid_frame.drop_down_menu.clean_up()
# remove '**... | python | def onContinue(self, event, grid, next_dia=None):#, age_data_type='site'):
"""
Save grid data in the data object
"""
# deselect column, including remove 'EDIT ALL' label
if self.grid_frame.drop_down_menu:
self.grid_frame.drop_down_menu.clean_up()
# remove '**... | [
"def",
"onContinue",
"(",
"self",
",",
"event",
",",
"grid",
",",
"next_dia",
"=",
"None",
")",
":",
"#, age_data_type='site'):",
"# deselect column, including remove 'EDIT ALL' label",
"if",
"self",
".",
"grid_frame",
".",
"drop_down_menu",
":",
"self",
".",
"grid_... | Save grid data in the data object | [
"Save",
"grid",
"data",
"in",
"the",
"data",
"object"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_er_magic_dialogs.py#L209-L252 |
PmagPy/PmagPy | dialogs/pmag_er_magic_dialogs.py | ErMagicCheckFrame3.validate | def validate(self, grid):
"""
Using the MagIC data model, generate validation errors on a MagicGrid.
Parameters
----------
grid : dialogs.magic_grid3.MagicGrid
The MagicGrid to be validated
Returns
---------
warnings: dict
... | python | def validate(self, grid):
"""
Using the MagIC data model, generate validation errors on a MagicGrid.
Parameters
----------
grid : dialogs.magic_grid3.MagicGrid
The MagicGrid to be validated
Returns
---------
warnings: dict
... | [
"def",
"validate",
"(",
"self",
",",
"grid",
")",
":",
"grid_name",
"=",
"str",
"(",
"grid",
".",
"GetName",
"(",
")",
")",
"dmodel",
"=",
"self",
".",
"contribution",
".",
"dmodel",
"reqd_headers",
"=",
"dmodel",
".",
"get_reqd_headers",
"(",
"grid_name... | Using the MagIC data model, generate validation errors on a MagicGrid.
Parameters
----------
grid : dialogs.magic_grid3.MagicGrid
The MagicGrid to be validated
Returns
---------
warnings: dict
Empty dict if no warnings, otherwise a dict ... | [
"Using",
"the",
"MagIC",
"data",
"model",
"generate",
"validation",
"errors",
"on",
"a",
"MagicGrid",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_er_magic_dialogs.py#L265-L296 |
PmagPy/PmagPy | dialogs/pmag_er_magic_dialogs.py | ErMagicCheckFrame3.on_saveButton | def on_saveButton(self, event, grid):
"""saves any editing of the grid but does not continue to the next window"""
wait = wx.BusyInfo("Please wait, working...")
wx.SafeYield()
if self.grid_frame.drop_down_menu: # unhighlight selected columns, etc.
self.grid_frame.drop_down_... | python | def on_saveButton(self, event, grid):
"""saves any editing of the grid but does not continue to the next window"""
wait = wx.BusyInfo("Please wait, working...")
wx.SafeYield()
if self.grid_frame.drop_down_menu: # unhighlight selected columns, etc.
self.grid_frame.drop_down_... | [
"def",
"on_saveButton",
"(",
"self",
",",
"event",
",",
"grid",
")",
":",
"wait",
"=",
"wx",
".",
"BusyInfo",
"(",
"\"Please wait, working...\"",
")",
"wx",
".",
"SafeYield",
"(",
")",
"if",
"self",
".",
"grid_frame",
".",
"drop_down_menu",
":",
"# unhighl... | saves any editing of the grid but does not continue to the next window | [
"saves",
"any",
"editing",
"of",
"the",
"grid",
"but",
"does",
"not",
"continue",
"to",
"the",
"next",
"window"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_er_magic_dialogs.py#L299-L322 |
PmagPy/PmagPy | dialogs/pmag_er_magic_dialogs.py | ErMagicCheckFrame.InitSpecCheck | def InitSpecCheck(self):
"""make an interactive grid in which users can edit specimen names
as well as which sample a specimen belongs to"""
self.panel = wx.Panel(self, style=wx.SIMPLE_BORDER)
#import wx.lib.scrolledpanel as libpanel # does not work well
#self.panel = libpanel.S... | python | def InitSpecCheck(self):
"""make an interactive grid in which users can edit specimen names
as well as which sample a specimen belongs to"""
self.panel = wx.Panel(self, style=wx.SIMPLE_BORDER)
#import wx.lib.scrolledpanel as libpanel # does not work well
#self.panel = libpanel.S... | [
"def",
"InitSpecCheck",
"(",
"self",
")",
":",
"self",
".",
"panel",
"=",
"wx",
".",
"Panel",
"(",
"self",
",",
"style",
"=",
"wx",
".",
"SIMPLE_BORDER",
")",
"#import wx.lib.scrolledpanel as libpanel # does not work well",
"#self.panel = libpanel.ScrolledPanel(self, st... | make an interactive grid in which users can edit specimen names
as well as which sample a specimen belongs to | [
"make",
"an",
"interactive",
"grid",
"in",
"which",
"users",
"can",
"edit",
"specimen",
"names",
"as",
"well",
"as",
"which",
"sample",
"a",
"specimen",
"belongs",
"to"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_er_magic_dialogs.py#L380-L457 |
PmagPy/PmagPy | dialogs/pmag_er_magic_dialogs.py | ErMagicCheckFrame.InitSampCheck | def InitSampCheck(self):
"""make an interactive grid in which users can edit sample names
as well as which site a sample belongs to"""
self.sample_window += 1
self.panel = wx.Panel(self, style=wx.SIMPLE_BORDER)
if self.sample_window == 1:
text = """Step 2:
Check that... | python | def InitSampCheck(self):
"""make an interactive grid in which users can edit sample names
as well as which site a sample belongs to"""
self.sample_window += 1
self.panel = wx.Panel(self, style=wx.SIMPLE_BORDER)
if self.sample_window == 1:
text = """Step 2:
Check that... | [
"def",
"InitSampCheck",
"(",
"self",
")",
":",
"self",
".",
"sample_window",
"+=",
"1",
"self",
".",
"panel",
"=",
"wx",
".",
"Panel",
"(",
"self",
",",
"style",
"=",
"wx",
".",
"SIMPLE_BORDER",
")",
"if",
"self",
".",
"sample_window",
"==",
"1",
":"... | make an interactive grid in which users can edit sample names
as well as which site a sample belongs to | [
"make",
"an",
"interactive",
"grid",
"in",
"which",
"users",
"can",
"edit",
"sample",
"names",
"as",
"well",
"as",
"which",
"site",
"a",
"sample",
"belongs",
"to"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_er_magic_dialogs.py#L460-L568 |
PmagPy/PmagPy | dialogs/pmag_er_magic_dialogs.py | ErMagicCheckFrame.InitSiteCheck | def InitSiteCheck(self):
"""make an interactive grid in which users can edit site names
as well as which location a site belongs to"""
self.panel = wx.Panel(self, style=wx.SIMPLE_BORDER)
text = """Step 3:
Check that all sites are correctly named, and that they belong to the correct loca... | python | def InitSiteCheck(self):
"""make an interactive grid in which users can edit site names
as well as which location a site belongs to"""
self.panel = wx.Panel(self, style=wx.SIMPLE_BORDER)
text = """Step 3:
Check that all sites are correctly named, and that they belong to the correct loca... | [
"def",
"InitSiteCheck",
"(",
"self",
")",
":",
"self",
".",
"panel",
"=",
"wx",
".",
"Panel",
"(",
"self",
",",
"style",
"=",
"wx",
".",
"SIMPLE_BORDER",
")",
"text",
"=",
"\"\"\"Step 3:\nCheck that all sites are correctly named, and that they belong to the correct lo... | make an interactive grid in which users can edit site names
as well as which location a site belongs to | [
"make",
"an",
"interactive",
"grid",
"in",
"which",
"users",
"can",
"edit",
"site",
"names",
"as",
"well",
"as",
"which",
"location",
"a",
"site",
"belongs",
"to"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_er_magic_dialogs.py#L577-L681 |
PmagPy/PmagPy | dialogs/pmag_er_magic_dialogs.py | ErMagicCheckFrame.InitLocCheck | def InitLocCheck(self):
"""make an interactive grid in which users can edit specimen names
as well as which sample a specimen belongs to"""
self.panel = wx.Panel(self, style=wx.SIMPLE_BORDER)
text = """Step 5:
Check that locations are correctly named.
Fill in any blank cells using contr... | python | def InitLocCheck(self):
"""make an interactive grid in which users can edit specimen names
as well as which sample a specimen belongs to"""
self.panel = wx.Panel(self, style=wx.SIMPLE_BORDER)
text = """Step 5:
Check that locations are correctly named.
Fill in any blank cells using contr... | [
"def",
"InitLocCheck",
"(",
"self",
")",
":",
"self",
".",
"panel",
"=",
"wx",
".",
"Panel",
"(",
"self",
",",
"style",
"=",
"wx",
".",
"SIMPLE_BORDER",
")",
"text",
"=",
"\"\"\"Step 5:\nCheck that locations are correctly named.\nFill in any blank cells using controll... | make an interactive grid in which users can edit specimen names
as well as which sample a specimen belongs to | [
"make",
"an",
"interactive",
"grid",
"in",
"which",
"users",
"can",
"edit",
"specimen",
"names",
"as",
"well",
"as",
"which",
"sample",
"a",
"specimen",
"belongs",
"to"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_er_magic_dialogs.py#L684-L781 |
PmagPy/PmagPy | dialogs/pmag_er_magic_dialogs.py | ErMagicCheckFrame.InitAgeCheck | def InitAgeCheck(self):
"""make an interactive grid in which users can edit ages"""
self.panel = wx.Panel(self, style=wx.SIMPLE_BORDER)
text = """Step 6:
Fill in or correct any cells with information about ages.
The column for magic_method_codes can take multiple values in the form of a colon-d... | python | def InitAgeCheck(self):
"""make an interactive grid in which users can edit ages"""
self.panel = wx.Panel(self, style=wx.SIMPLE_BORDER)
text = """Step 6:
Fill in or correct any cells with information about ages.
The column for magic_method_codes can take multiple values in the form of a colon-d... | [
"def",
"InitAgeCheck",
"(",
"self",
")",
":",
"self",
".",
"panel",
"=",
"wx",
".",
"Panel",
"(",
"self",
",",
"style",
"=",
"wx",
".",
"SIMPLE_BORDER",
")",
"text",
"=",
"\"\"\"Step 6:\nFill in or correct any cells with information about ages.\nThe column for magic_m... | make an interactive grid in which users can edit ages | [
"make",
"an",
"interactive",
"grid",
"in",
"which",
"users",
"can",
"edit",
"ages"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_er_magic_dialogs.py#L784-L863 |
PmagPy/PmagPy | dialogs/pmag_er_magic_dialogs.py | ErMagicCheckFrame.onMouseOver | def onMouseOver(self, event, grid):
"""
Displays a tooltip over any cell in a certain column
"""
x, y = grid.CalcUnscrolledPosition(event.GetX(), event.GetY())
coords = grid.XYToCell(x, y)
col = coords[1]
row = coords[0]
# creates tooltip message for cell... | python | def onMouseOver(self, event, grid):
"""
Displays a tooltip over any cell in a certain column
"""
x, y = grid.CalcUnscrolledPosition(event.GetX(), event.GetY())
coords = grid.XYToCell(x, y)
col = coords[1]
row = coords[0]
# creates tooltip message for cell... | [
"def",
"onMouseOver",
"(",
"self",
",",
"event",
",",
"grid",
")",
":",
"x",
",",
"y",
"=",
"grid",
".",
"CalcUnscrolledPosition",
"(",
"event",
".",
"GetX",
"(",
")",
",",
"event",
".",
"GetY",
"(",
")",
")",
"coords",
"=",
"grid",
".",
"XYToCell"... | Displays a tooltip over any cell in a certain column | [
"Displays",
"a",
"tooltip",
"over",
"any",
"cell",
"in",
"a",
"certain",
"column"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_er_magic_dialogs.py#L891-L906 |
PmagPy/PmagPy | dialogs/pmag_er_magic_dialogs.py | ErMagicCheckFrame.on_helpButton | def on_helpButton(self, event, page=None):
"""shows html help page"""
# for use on the command line:
path = find_pmag_dir.get_pmag_dir()
# for use with pyinstaller
#path = self.main_frame.resource_dir
help_page = os.path.join(path, 'dialogs', 'help_files', page)
#... | python | def on_helpButton(self, event, page=None):
"""shows html help page"""
# for use on the command line:
path = find_pmag_dir.get_pmag_dir()
# for use with pyinstaller
#path = self.main_frame.resource_dir
help_page = os.path.join(path, 'dialogs', 'help_files', page)
#... | [
"def",
"on_helpButton",
"(",
"self",
",",
"event",
",",
"page",
"=",
"None",
")",
":",
"# for use on the command line:",
"path",
"=",
"find_pmag_dir",
".",
"get_pmag_dir",
"(",
")",
"# for use with pyinstaller",
"#path = self.main_frame.resource_dir",
"help_page",
"=",
... | shows html help page | [
"shows",
"html",
"help",
"page"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_er_magic_dialogs.py#L981-L993 |
PmagPy/PmagPy | dialogs/pmag_er_magic_dialogs.py | ErMagicCheckFrame.on_continueButton | def on_continueButton(self, event, grid, next_dia=None):
"""
pulls up next dialog, if there is one.
gets any updated information from the current grid and runs ErMagicBuilder
"""
#wait = wx.BusyInfo("Please wait, working...")
# unhighlight selected columns, etc.
i... | python | def on_continueButton(self, event, grid, next_dia=None):
"""
pulls up next dialog, if there is one.
gets any updated information from the current grid and runs ErMagicBuilder
"""
#wait = wx.BusyInfo("Please wait, working...")
# unhighlight selected columns, etc.
i... | [
"def",
"on_continueButton",
"(",
"self",
",",
"event",
",",
"grid",
",",
"next_dia",
"=",
"None",
")",
":",
"#wait = wx.BusyInfo(\"Please wait, working...\")",
"# unhighlight selected columns, etc.",
"if",
"self",
".",
"drop_down_menu",
":",
"self",
".",
"drop_down_menu... | pulls up next dialog, if there is one.
gets any updated information from the current grid and runs ErMagicBuilder | [
"pulls",
"up",
"next",
"dialog",
"if",
"there",
"is",
"one",
".",
"gets",
"any",
"updated",
"information",
"from",
"the",
"current",
"grid",
"and",
"runs",
"ErMagicBuilder"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_er_magic_dialogs.py#L995-L1049 |
PmagPy/PmagPy | dialogs/pmag_er_magic_dialogs.py | ErMagicCheckFrame.onDeleteRow | def onDeleteRow(self, event, data_type):
"""
On button click, remove relevant object from both the data model and the grid.
"""
ancestry = self.er_magic_data.ancestry
child_type = ancestry[ancestry.index(data_type) - 1]
names = [self.grid.GetCellValue(row, 0) for row in s... | python | def onDeleteRow(self, event, data_type):
"""
On button click, remove relevant object from both the data model and the grid.
"""
ancestry = self.er_magic_data.ancestry
child_type = ancestry[ancestry.index(data_type) - 1]
names = [self.grid.GetCellValue(row, 0) for row in s... | [
"def",
"onDeleteRow",
"(",
"self",
",",
"event",
",",
"data_type",
")",
":",
"ancestry",
"=",
"self",
".",
"er_magic_data",
".",
"ancestry",
"child_type",
"=",
"ancestry",
"[",
"ancestry",
".",
"index",
"(",
"data_type",
")",
"-",
"1",
"]",
"names",
"=",... | On button click, remove relevant object from both the data model and the grid. | [
"On",
"button",
"click",
"remove",
"relevant",
"object",
"from",
"both",
"the",
"data",
"model",
"and",
"the",
"grid",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_er_magic_dialogs.py#L1100-L1128 |
PmagPy/PmagPy | dialogs/pmag_er_magic_dialogs.py | ErMagicCheckFrame.onLeftClickLabel | def onLeftClickLabel(self, event):
"""
When user clicks on a grid label, determine if it is a row label or a col label.
Pass along the event to the appropriate function.
(It will either highlight a column for editing all values, or highlight a row for deletion).
"""
if ev... | python | def onLeftClickLabel(self, event):
"""
When user clicks on a grid label, determine if it is a row label or a col label.
Pass along the event to the appropriate function.
(It will either highlight a column for editing all values, or highlight a row for deletion).
"""
if ev... | [
"def",
"onLeftClickLabel",
"(",
"self",
",",
"event",
")",
":",
"if",
"event",
".",
"Col",
"==",
"-",
"1",
"and",
"event",
".",
"Row",
"==",
"-",
"1",
":",
"pass",
"elif",
"event",
".",
"Col",
"<",
"0",
":",
"self",
".",
"onSelectRow",
"(",
"even... | When user clicks on a grid label, determine if it is a row label or a col label.
Pass along the event to the appropriate function.
(It will either highlight a column for editing all values, or highlight a row for deletion). | [
"When",
"user",
"clicks",
"on",
"a",
"grid",
"label",
"determine",
"if",
"it",
"is",
"a",
"row",
"label",
"or",
"a",
"col",
"label",
".",
"Pass",
"along",
"the",
"event",
"to",
"the",
"appropriate",
"function",
".",
"(",
"It",
"will",
"either",
"highli... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_er_magic_dialogs.py#L1131-L1142 |
PmagPy/PmagPy | dialogs/pmag_er_magic_dialogs.py | ErMagicCheckFrame.onSelectRow | def onSelectRow(self, event):
"""
Highlight or unhighlight a row for possible deletion.
"""
grid = self.grid
row = event.Row
default = (255, 255, 255, 255)
highlight = (191, 216, 216, 255)
cell_color = grid.GetCellBackgroundColour(row, 0)
attr = wx... | python | def onSelectRow(self, event):
"""
Highlight or unhighlight a row for possible deletion.
"""
grid = self.grid
row = event.Row
default = (255, 255, 255, 255)
highlight = (191, 216, 216, 255)
cell_color = grid.GetCellBackgroundColour(row, 0)
attr = wx... | [
"def",
"onSelectRow",
"(",
"self",
",",
"event",
")",
":",
"grid",
"=",
"self",
".",
"grid",
"row",
"=",
"event",
".",
"Row",
"default",
"=",
"(",
"255",
",",
"255",
",",
"255",
",",
"255",
")",
"highlight",
"=",
"(",
"191",
",",
"216",
",",
"2... | Highlight or unhighlight a row for possible deletion. | [
"Highlight",
"or",
"unhighlight",
"a",
"row",
"for",
"possible",
"deletion",
"."
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_er_magic_dialogs.py#L1145-L1169 |
PmagPy/PmagPy | dialogs/pmag_er_magic_dialogs.py | ErMagicCheckFrame.update_grid | def update_grid(self, grid):
"""
takes in wxPython grid and ErMagic data object to be updated
"""
data_methods = {'specimen': self.er_magic_data.change_specimen,
'sample': self.er_magic_data.change_sample,
'site': self.er_magic_data.change_... | python | def update_grid(self, grid):
"""
takes in wxPython grid and ErMagic data object to be updated
"""
data_methods = {'specimen': self.er_magic_data.change_specimen,
'sample': self.er_magic_data.change_sample,
'site': self.er_magic_data.change_... | [
"def",
"update_grid",
"(",
"self",
",",
"grid",
")",
":",
"data_methods",
"=",
"{",
"'specimen'",
":",
"self",
".",
"er_magic_data",
".",
"change_specimen",
",",
"'sample'",
":",
"self",
".",
"er_magic_data",
".",
"change_sample",
",",
"'site'",
":",
"self",... | takes in wxPython grid and ErMagic data object to be updated | [
"takes",
"in",
"wxPython",
"grid",
"and",
"ErMagic",
"data",
"object",
"to",
"be",
"updated"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_er_magic_dialogs.py#L1172-L1202 |
PmagPy/PmagPy | dialogs/pmag_er_magic_dialogs.py | ErMagicCheckFrame.onSave | def onSave(self, grid):#, age_data_type='site'):
"""
Save grid data in the data object
"""
# deselect column, including remove 'EDIT ALL' label
if self.drop_down_menu:
self.drop_down_menu.clean_up()
# save all changes to er_magic data object
self.grid... | python | def onSave(self, grid):#, age_data_type='site'):
"""
Save grid data in the data object
"""
# deselect column, including remove 'EDIT ALL' label
if self.drop_down_menu:
self.drop_down_menu.clean_up()
# save all changes to er_magic data object
self.grid... | [
"def",
"onSave",
"(",
"self",
",",
"grid",
")",
":",
"#, age_data_type='site'):",
"# deselect column, including remove 'EDIT ALL' label",
"if",
"self",
".",
"drop_down_menu",
":",
"self",
".",
"drop_down_menu",
".",
"clean_up",
"(",
")",
"# save all changes to er_magic da... | Save grid data in the data object | [
"Save",
"grid",
"data",
"in",
"the",
"data",
"object"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/pmag_er_magic_dialogs.py#L1205-L1221 |
PmagPy/PmagPy | programs/deprecated/update_measurements.py | main | def main():
"""
NAME
update_measurements.py
DESCRIPTION
update the magic_measurements table with new orientation info
SYNTAX
update_measurements.py [command line options]
OPTIONS
-h prints help message and quits
-f MFILE, specify magic_measurements file; ... | python | def main():
"""
NAME
update_measurements.py
DESCRIPTION
update the magic_measurements table with new orientation info
SYNTAX
update_measurements.py [command line options]
OPTIONS
-h prints help message and quits
-f MFILE, specify magic_measurements file; ... | [
"def",
"main",
"(",
")",
":",
"dir_path",
"=",
"'.'",
"meas_file",
"=",
"'magic_measurements.txt'",
"samp_file",
"=",
"\"er_samples.txt\"",
"out_file",
"=",
"'magic_measurements.txt'",
"if",
"'-h'",
"in",
"sys",
".",
"argv",
":",
"print",
"(",
"main",
".",
"__... | NAME
update_measurements.py
DESCRIPTION
update the magic_measurements table with new orientation info
SYNTAX
update_measurements.py [command line options]
OPTIONS
-h prints help message and quits
-f MFILE, specify magic_measurements file; default is magic_measure... | [
"NAME",
"update_measurements",
".",
"py"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/deprecated/update_measurements.py#L7-L78 |
PmagPy/PmagPy | programs/conversion_scripts2/ldeo_magic2.py | main | def main(command_line=True, **kwargs):
"""
NAME
ldeo_magic.py
DESCRIPTION
converts LDEO format files to magic_measurements format files
SYNTAX
ldeo_magic.py [command line options]
OPTIONS
-h: prints the help message and quits.
-usr USER: identify user, ... | python | def main(command_line=True, **kwargs):
"""
NAME
ldeo_magic.py
DESCRIPTION
converts LDEO format files to magic_measurements format files
SYNTAX
ldeo_magic.py [command line options]
OPTIONS
-h: prints the help message and quits.
-usr USER: identify user, ... | [
"def",
"main",
"(",
"command_line",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"# initialize some stuff",
"noave",
"=",
"0",
"codelist",
"=",
"''",
"methcode",
",",
"inst",
"=",
"\"LP-NO\"",
",",
"\"\"",
"phi",
",",
"theta",
",",
"peakfield",
",",
... | NAME
ldeo_magic.py
DESCRIPTION
converts LDEO format files to magic_measurements format files
SYNTAX
ldeo_magic.py [command line options]
OPTIONS
-h: prints the help message and quits.
-usr USER: identify user, default is ""
-f FILE: specify .ldeo format... | [
"NAME",
"ldeo_magic",
".",
"py",
"DESCRIPTION",
"converts",
"LDEO",
"format",
"files",
"to",
"magic_measurements",
"format",
"files"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/conversion_scripts2/ldeo_magic2.py#L7-L382 |
PmagPy/PmagPy | programs/deprecated/odp_dsc_magic.py | main | def main():
"""
NAME
odp_dcs_magic.py
DESCRIPTION
converts ODP discrete sample format files to magic_measurements format files
SYNTAX
odp_dsc_magic.py [command line options]
OPTIONS
-h: prints the help message and quits.
-F FILE: specify output measurement... | python | def main():
"""
NAME
odp_dcs_magic.py
DESCRIPTION
converts ODP discrete sample format files to magic_measurements format files
SYNTAX
odp_dsc_magic.py [command line options]
OPTIONS
-h: prints the help message and quits.
-F FILE: specify output measurement... | [
"def",
"main",
"(",
")",
":",
"#",
"#",
"version_num",
"=",
"pmag",
".",
"get_version",
"(",
")",
"meas_file",
"=",
"'magic_measurements.txt'",
"spec_file",
"=",
"'er_specimens.txt'",
"samp_file",
"=",
"'er_samples.txt'",
"site_file",
"=",
"'er_sites.txt'",
"ErSpe... | NAME
odp_dcs_magic.py
DESCRIPTION
converts ODP discrete sample format files to magic_measurements format files
SYNTAX
odp_dsc_magic.py [command line options]
OPTIONS
-h: prints the help message and quits.
-F FILE: specify output measurements file, default is magic... | [
"NAME",
"odp_dcs_magic",
".",
"py"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/deprecated/odp_dsc_magic.py#L10-L247 |
PmagPy/PmagPy | programs/angle.py | main | def main():
"""
NAME
angle.py
DESCRIPTION
calculates angle between two input directions D1,D2
INPUT (COMMAND LINE ENTRY)
D1_dec D1_inc D1_dec D2_inc
OUTPUT
angle
SYNTAX
angle.py [-h][-i] [command line options] [< filename]
OPTIONS
-h pr... | python | def main():
"""
NAME
angle.py
DESCRIPTION
calculates angle between two input directions D1,D2
INPUT (COMMAND LINE ENTRY)
D1_dec D1_inc D1_dec D2_inc
OUTPUT
angle
SYNTAX
angle.py [-h][-i] [command line options] [< filename]
OPTIONS
-h pr... | [
"def",
"main",
"(",
")",
":",
"out",
"=",
"\"\"",
"if",
"'-h'",
"in",
"sys",
".",
"argv",
":",
"print",
"(",
"main",
".",
"__doc__",
")",
"sys",
".",
"exit",
"(",
")",
"if",
"'-F'",
"in",
"sys",
".",
"argv",
":",
"ind",
"=",
"sys",
".",
"argv... | NAME
angle.py
DESCRIPTION
calculates angle between two input directions D1,D2
INPUT (COMMAND LINE ENTRY)
D1_dec D1_inc D1_dec D2_inc
OUTPUT
angle
SYNTAX
angle.py [-h][-i] [command line options] [< filename]
OPTIONS
-h prints help and quits
... | [
"NAME",
"angle",
".",
"py"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/angle.py#L11-L79 |
PmagPy/PmagPy | programs/fishrot.py | main | def main():
"""
NAME
fishrot.py
DESCRIPTION
generates set of Fisher distributed data from specified distribution
SYNTAX
fishrot.py [-h][-i][command line options]
OPTIONS
-h prints help message and quits
-i for interactive entry
-k kappa specify ka... | python | def main():
"""
NAME
fishrot.py
DESCRIPTION
generates set of Fisher distributed data from specified distribution
SYNTAX
fishrot.py [-h][-i][command line options]
OPTIONS
-h prints help message and quits
-i for interactive entry
-k kappa specify ka... | [
"def",
"main",
"(",
")",
":",
"N",
",",
"kappa",
",",
"D",
",",
"I",
"=",
"100",
",",
"20.",
",",
"0.",
",",
"90.",
"if",
"len",
"(",
"sys",
".",
"argv",
")",
"!=",
"0",
"and",
"'-h'",
"in",
"sys",
".",
"argv",
":",
"print",
"(",
"main",
... | NAME
fishrot.py
DESCRIPTION
generates set of Fisher distributed data from specified distribution
SYNTAX
fishrot.py [-h][-i][command line options]
OPTIONS
-h prints help message and quits
-i for interactive entry
-k kappa specify kappa, default is 20
... | [
"NAME",
"fishrot",
".",
"py"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/fishrot.py#L8-L63 |
PmagPy/PmagPy | programs/squish.py | main | def main():
"""
NAME
squish.py
DESCRIPTION
takes dec/inc data and "squishes" with specified flattening factor, flt
using formula tan(Io)=flt*tan(If)
INPUT
declination inclination
OUTPUT
"squished" declincation inclination
SYNTAX
... | python | def main():
"""
NAME
squish.py
DESCRIPTION
takes dec/inc data and "squishes" with specified flattening factor, flt
using formula tan(Io)=flt*tan(If)
INPUT
declination inclination
OUTPUT
"squished" declincation inclination
SYNTAX
... | [
"def",
"main",
"(",
")",
":",
"ofile",
"=",
"\"\"",
"if",
"'-h'",
"in",
"sys",
".",
"argv",
":",
"print",
"(",
"main",
".",
"__doc__",
")",
"sys",
".",
"exit",
"(",
")",
"if",
"'-F'",
"in",
"sys",
".",
"argv",
":",
"ind",
"=",
"sys",
".",
"ar... | NAME
squish.py
DESCRIPTION
takes dec/inc data and "squishes" with specified flattening factor, flt
using formula tan(Io)=flt*tan(If)
INPUT
declination inclination
OUTPUT
"squished" declincation inclination
SYNTAX
squish.py [command line ... | [
"NAME",
"squish",
".",
"py",
"DESCRIPTION",
"takes",
"dec",
"/",
"inc",
"data",
"and",
"squishes",
"with",
"specified",
"flattening",
"factor",
"flt",
"using",
"formula",
"tan",
"(",
"Io",
")",
"=",
"flt",
"*",
"tan",
"(",
"If",
")",
"INPUT",
"declinatio... | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/squish.py#L7-L59 |
PmagPy/PmagPy | programs/conversion_scripts/iodp_samples_magic.py | main | def main():
"""
iodp_samples_magic.py
OPTIONS:
-f FILE, input csv file
-Fsa FILE, output samples file for updating, default is to overwrite existing samples file
"""
if "-h" in sys.argv:
print(main.__doc__)
sys.exit()
dataframe = extractor.command_line_dataframe(... | python | def main():
"""
iodp_samples_magic.py
OPTIONS:
-f FILE, input csv file
-Fsa FILE, output samples file for updating, default is to overwrite existing samples file
"""
if "-h" in sys.argv:
print(main.__doc__)
sys.exit()
dataframe = extractor.command_line_dataframe(... | [
"def",
"main",
"(",
")",
":",
"if",
"\"-h\"",
"in",
"sys",
".",
"argv",
":",
"print",
"(",
"main",
".",
"__doc__",
")",
"sys",
".",
"exit",
"(",
")",
"dataframe",
"=",
"extractor",
".",
"command_line_dataframe",
"(",
"[",
"[",
"'WD'",
",",
"False",
... | iodp_samples_magic.py
OPTIONS:
-f FILE, input csv file
-Fsa FILE, output samples file for updating, default is to overwrite existing samples file | [
"iodp_samples_magic",
".",
"py",
"OPTIONS",
":",
"-",
"f",
"FILE",
"input",
"csv",
"file",
"-",
"Fsa",
"FILE",
"output",
"samples",
"file",
"for",
"updating",
"default",
"is",
"to",
"overwrite",
"existing",
"samples",
"file"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/conversion_scripts/iodp_samples_magic.py#L7-L28 |
PmagPy/PmagPy | SPD/new_lj_thellier_gui_spd.py | Arai_GUI.cart2dir | def cart2dir(self,cart):
"""
converts a direction to cartesian coordinates
"""
# print "calling cart2dir(), not in anything"
cart=numpy.array(cart)
rad=old_div(numpy.pi,180.) # constant to convert degrees to radians
if len(cart.shape)>1:
Xs,Ys,Zs=cart[:... | python | def cart2dir(self,cart):
"""
converts a direction to cartesian coordinates
"""
# print "calling cart2dir(), not in anything"
cart=numpy.array(cart)
rad=old_div(numpy.pi,180.) # constant to convert degrees to radians
if len(cart.shape)>1:
Xs,Ys,Zs=cart[:... | [
"def",
"cart2dir",
"(",
"self",
",",
"cart",
")",
":",
"# print \"calling cart2dir(), not in anything\"",
"cart",
"=",
"numpy",
".",
"array",
"(",
"cart",
")",
"rad",
"=",
"old_div",
"(",
"numpy",
".",
"pi",
",",
"180.",
")",
"# constant to convert degree... | converts a direction to cartesian coordinates | [
"converts",
"a",
"direction",
"to",
"cartesian",
"coordinates"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/new_lj_thellier_gui_spd.py#L1060-L1079 |
PmagPy/PmagPy | SPD/new_lj_thellier_gui_spd.py | Arai_GUI.magic_read | def magic_read(self,infile):
"""
reads a Magic template file, puts data in a list of dictionaries
"""
# print "calling magic_read(self, infile)", infile
hold,magic_data,magic_record,magic_keys=[],[],{},[]
try:
f=open(infile,"r")
except:
ret... | python | def magic_read(self,infile):
"""
reads a Magic template file, puts data in a list of dictionaries
"""
# print "calling magic_read(self, infile)", infile
hold,magic_data,magic_record,magic_keys=[],[],{},[]
try:
f=open(infile,"r")
except:
ret... | [
"def",
"magic_read",
"(",
"self",
",",
"infile",
")",
":",
"# print \"calling magic_read(self, infile)\", infile",
"hold",
",",
"magic_data",
",",
"magic_record",
",",
"magic_keys",
"=",
"[",
"]",
",",
"[",
"]",
",",
"{",
"}",
",",
"[",
"]",
"try",
":... | reads a Magic template file, puts data in a list of dictionaries | [
"reads",
"a",
"Magic",
"template",
"file",
"puts",
"data",
"in",
"a",
"list",
"of",
"dictionaries"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/new_lj_thellier_gui_spd.py#L1102-L1155 |
PmagPy/PmagPy | SPD/new_lj_thellier_gui_spd.py | Arai_GUI.get_specs | def get_specs(self,data):
"""
takes a magic format file and returns a list of unique specimen names
"""
# sort the specimen names
#
# print "calling get_specs()"
speclist=[]
for rec in data:
spec=rec["er_specimen_name"]
if spec not in speclist:... | python | def get_specs(self,data):
"""
takes a magic format file and returns a list of unique specimen names
"""
# sort the specimen names
#
# print "calling get_specs()"
speclist=[]
for rec in data:
spec=rec["er_specimen_name"]
if spec not in speclist:... | [
"def",
"get_specs",
"(",
"self",
",",
"data",
")",
":",
"# sort the specimen names",
"#",
"# print \"calling get_specs()\"",
"speclist",
"=",
"[",
"]",
"for",
"rec",
"in",
"data",
":",
"spec",
"=",
"rec",
"[",
"\"er_specimen_name\"",
"]",
"if",
"spec",
... | takes a magic format file and returns a list of unique specimen names | [
"takes",
"a",
"magic",
"format",
"file",
"and",
"returns",
"a",
"list",
"of",
"unique",
"specimen",
"names"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/new_lj_thellier_gui_spd.py#L1158-L1171 |
PmagPy/PmagPy | SPD/new_lj_thellier_gui_spd.py | Arai_GUI.sortarai | def sortarai(self,datablock,s,Zdiff):
"""
sorts data block in to first_Z, first_I, etc.
"""
# print "calling sortarai()"
first_Z,first_I,zptrm_check,ptrm_check,ptrm_tail=[],[],[],[],[]
field,phi,theta="","",""
starthere=0
Treat_I,Treat_Z,Treat_PZ,Treat_PI,... | python | def sortarai(self,datablock,s,Zdiff):
"""
sorts data block in to first_Z, first_I, etc.
"""
# print "calling sortarai()"
first_Z,first_I,zptrm_check,ptrm_check,ptrm_tail=[],[],[],[],[]
field,phi,theta="","",""
starthere=0
Treat_I,Treat_Z,Treat_PZ,Treat_PI,... | [
"def",
"sortarai",
"(",
"self",
",",
"datablock",
",",
"s",
",",
"Zdiff",
")",
":",
"# print \"calling sortarai()\"",
"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/SPD/new_lj_thellier_gui_spd.py#L1175-L1496 |
PmagPy/PmagPy | programs/vgpmap_magic.py | main | def main():
"""
NAME
vgpmap_magic.py
DESCRIPTION
makes a map of vgps and a95/dp,dm for site means in a sites table
SYNTAX
vgpmap_magic.py [command line options]
OPTIONS
-h prints help and quits
-eye ELAT ELON [specify eyeball location], default is 90., 0.
... | python | def main():
"""
NAME
vgpmap_magic.py
DESCRIPTION
makes a map of vgps and a95/dp,dm for site means in a sites table
SYNTAX
vgpmap_magic.py [command line options]
OPTIONS
-h prints help and quits
-eye ELAT ELON [specify eyeball location], default is 90., 0.
... | [
"def",
"main",
"(",
")",
":",
"if",
"'-h'",
"in",
"sys",
".",
"argv",
":",
"print",
"(",
"main",
".",
"__doc__",
")",
"sys",
".",
"exit",
"(",
")",
"dir_path",
"=",
"pmag",
".",
"get_named_arg",
"(",
"\"-WD\"",
",",
"\".\"",
")",
"# plot: default is ... | NAME
vgpmap_magic.py
DESCRIPTION
makes a map of vgps and a95/dp,dm for site means in a sites 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 sites fo... | [
"NAME",
"vgpmap_magic",
".",
"py"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/vgpmap_magic.py#L14-L95 |
PmagPy/PmagPy | programs/dayplot_magic2.py | main | def main():
"""
NAME
dayplot_magic.py
DESCRIPTION
makes 'day plots' (Day et al. 1977) and squareness/coercivity,
plots 'linear mixing' curve from Dunlop and Carter-Stiglitz (2006).
squareness coercivity of remanence (Neel, 1955) plots after
Tauxe et al. (2002)
... | python | def main():
"""
NAME
dayplot_magic.py
DESCRIPTION
makes 'day plots' (Day et al. 1977) and squareness/coercivity,
plots 'linear mixing' curve from Dunlop and Carter-Stiglitz (2006).
squareness coercivity of remanence (Neel, 1955) plots after
Tauxe et al. (2002)
... | [
"def",
"main",
"(",
")",
":",
"args",
"=",
"sys",
".",
"argv",
"hyst_file",
",",
"rem_file",
"=",
"\"rmag_hysteresis.txt\"",
",",
"\"rmag_remanence.txt\"",
"dir_path",
"=",
"'.'",
"verbose",
"=",
"pmagplotlib",
".",
"verbose",
"fmt",
"=",
"'svg'",
"# default f... | NAME
dayplot_magic.py
DESCRIPTION
makes 'day plots' (Day et al. 1977) and squareness/coercivity,
plots 'linear mixing' curve from Dunlop and Carter-Stiglitz (2006).
squareness coercivity of remanence (Neel, 1955) plots after
Tauxe et al. (2002)
SYNTAX
dayplo... | [
"NAME",
"dayplot_magic",
".",
"py"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/dayplot_magic2.py#L11-L141 |
PmagPy/PmagPy | programs/orientation_magic.py | main | def main():
"""
NAME
orientation_magic.py
DESCRIPTION
takes tab delimited field notebook information and converts to MagIC formatted tables
SYNTAX
orientation_magic.py [command line options]
OPTIONS
-f FILE: specify input file, default is: orient.txt
-Fsa F... | python | def main():
"""
NAME
orientation_magic.py
DESCRIPTION
takes tab delimited field notebook information and converts to MagIC formatted tables
SYNTAX
orientation_magic.py [command line options]
OPTIONS
-f FILE: specify input file, default is: orient.txt
-Fsa F... | [
"def",
"main",
"(",
")",
":",
"args",
"=",
"sys",
".",
"argv",
"if",
"\"-h\"",
"in",
"args",
":",
"print",
"(",
"main",
".",
"__doc__",
")",
"sys",
".",
"exit",
"(",
")",
"else",
":",
"info",
"=",
"[",
"[",
"'WD'",
",",
"False",
",",
"'.'",
"... | NAME
orientation_magic.py
DESCRIPTION
takes tab delimited field notebook information and converts to MagIC formatted tables
SYNTAX
orientation_magic.py [command line options]
OPTIONS
-f FILE: specify input file, default is: orient.txt
-Fsa FILE: specify output file... | [
"NAME",
"orientation_magic",
".",
"py"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/orientation_magic.py#L8-L111 |
PmagPy/PmagPy | dialogs/magic_grid2.py | MagicGrid.add_items | def add_items(self, items_list, incl_pmag=True, incl_parents=True):
"""
Add items and/or update existing items in grid
"""
num_rows = self.GetNumberRows()
current_grid_rows = [self.GetCellValue(num, 0) for num in range(num_rows)]
er_data = {item.name: item.er_data for ite... | python | def add_items(self, items_list, incl_pmag=True, incl_parents=True):
"""
Add items and/or update existing items in grid
"""
num_rows = self.GetNumberRows()
current_grid_rows = [self.GetCellValue(num, 0) for num in range(num_rows)]
er_data = {item.name: item.er_data for ite... | [
"def",
"add_items",
"(",
"self",
",",
"items_list",
",",
"incl_pmag",
"=",
"True",
",",
"incl_parents",
"=",
"True",
")",
":",
"num_rows",
"=",
"self",
".",
"GetNumberRows",
"(",
")",
"current_grid_rows",
"=",
"[",
"self",
".",
"GetCellValue",
"(",
"num",
... | Add items and/or update existing items in grid | [
"Add",
"items",
"and",
"/",
"or",
"update",
"existing",
"items",
"in",
"grid"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/magic_grid2.py#L71-L89 |
PmagPy/PmagPy | dialogs/magic_grid2.py | MagicGrid.add_row | def add_row(self, label='', item=''):
"""
Add a row to the grid
"""
self.AppendRows(1)
last_row = self.GetNumberRows() - 1
self.SetCellValue(last_row, 0, str(label))
self.row_labels.append(label)
self.row_items.append(item) | python | def add_row(self, label='', item=''):
"""
Add a row to the grid
"""
self.AppendRows(1)
last_row = self.GetNumberRows() - 1
self.SetCellValue(last_row, 0, str(label))
self.row_labels.append(label)
self.row_items.append(item) | [
"def",
"add_row",
"(",
"self",
",",
"label",
"=",
"''",
",",
"item",
"=",
"''",
")",
":",
"self",
".",
"AppendRows",
"(",
"1",
")",
"last_row",
"=",
"self",
".",
"GetNumberRows",
"(",
")",
"-",
"1",
"self",
".",
"SetCellValue",
"(",
"last_row",
","... | Add a row to the grid | [
"Add",
"a",
"row",
"to",
"the",
"grid"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/magic_grid2.py#L266-L274 |
PmagPy/PmagPy | dialogs/magic_grid2.py | MagicGrid.remove_row | def remove_row(self, row_num=None):
"""
Remove a row from the grid
"""
#DeleteRows(self, pos, numRows, updateLabel
if not row_num and row_num != 0:
row_num = self.GetNumberRows() - 1
label = self.GetCellValue(row_num, 0)
self.DeleteRows(pos=row_num, nu... | python | def remove_row(self, row_num=None):
"""
Remove a row from the grid
"""
#DeleteRows(self, pos, numRows, updateLabel
if not row_num and row_num != 0:
row_num = self.GetNumberRows() - 1
label = self.GetCellValue(row_num, 0)
self.DeleteRows(pos=row_num, nu... | [
"def",
"remove_row",
"(",
"self",
",",
"row_num",
"=",
"None",
")",
":",
"#DeleteRows(self, pos, numRows, updateLabel",
"if",
"not",
"row_num",
"and",
"row_num",
"!=",
"0",
":",
"row_num",
"=",
"self",
".",
"GetNumberRows",
"(",
")",
"-",
"1",
"label",
"=",
... | Remove a row from the grid | [
"Remove",
"a",
"row",
"from",
"the",
"grid"
] | train | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/magic_grid2.py#L276-L297 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.