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_documentation_string stringlengths 1 47.2k | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|
PmagPy/PmagPy | dialogs/drop_down_menus2.py | Menus.add_drop_down | def add_drop_down(self, col_number, col_label):
"""
Add a correctly formatted drop-down-menu for given col_label, if required.
Otherwise do nothing.
"""
if col_label in ['magic_method_codes', 'magic_method_codes++']:
self.add_method_drop_down(col_number, col_label)
... | python | def add_drop_down(self, col_number, col_label):
"""
Add a correctly formatted drop-down-menu for given col_label, if required.
Otherwise do nothing.
"""
if col_label in ['magic_method_codes', 'magic_method_codes++']:
self.add_method_drop_down(col_number, col_label)
... | Add a correctly formatted drop-down-menu for given col_label, if required.
Otherwise do nothing. | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/drop_down_menus2.py#L90-L123 |
PmagPy/PmagPy | dialogs/drop_down_menus2.py | Menus.add_method_drop_down | def add_method_drop_down(self, col_number, col_label):
"""
Add drop-down-menu options for magic_method_codes columns
"""
if self.data_type == 'age':
method_list = vocab.age_methods
elif '++' in col_label:
method_list = vocab.pmag_methods
elif self.... | python | def add_method_drop_down(self, col_number, col_label):
"""
Add drop-down-menu options for magic_method_codes columns
"""
if self.data_type == 'age':
method_list = vocab.age_methods
elif '++' in col_label:
method_list = vocab.pmag_methods
elif self.... | Add drop-down-menu options for magic_method_codes columns | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/drop_down_menus2.py#L126-L138 |
PmagPy/PmagPy | dialogs/drop_down_menus2.py | Menus.clean_up | def clean_up(self):#, grid):
"""
de-select grid cols, refresh grid
"""
if self.selected_col:
col_label_value = self.grid.GetColLabelValue(self.selected_col)
col_label_value = col_label_value.strip('\nEDIT ALL')
self.grid.SetColLabelValue(self.selected_... | python | def clean_up(self):#, grid):
"""
de-select grid cols, refresh grid
"""
if self.selected_col:
col_label_value = self.grid.GetColLabelValue(self.selected_col)
col_label_value = col_label_value.strip('\nEDIT ALL')
self.grid.SetColLabelValue(self.selected_... | de-select grid cols, refresh grid | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/drop_down_menus2.py#L198-L208 |
PmagPy/PmagPy | dialogs/drop_down_menus2.py | Menus.on_left_click | def on_left_click(self, event, grid, choices):
"""
creates popup menu when user clicks on the column
if that column is in the list of choices that get a drop-down menu.
allows user to edit the column, but only from available values
"""
color = self.grid.GetCellBackgroundC... | python | def on_left_click(self, event, grid, choices):
"""
creates popup menu when user clicks on the column
if that column is in the list of choices that get a drop-down menu.
allows user to edit the column, but only from available values
"""
color = self.grid.GetCellBackgroundC... | creates popup menu when user clicks on the column
if that column is in the list of choices that get a drop-down menu.
allows user to edit the column, but only from available values | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/drop_down_menus2.py#L210-L294 |
PmagPy/PmagPy | dialogs/drop_down_menus2.py | Menus.on_select_menuitem | def on_select_menuitem(self, event, grid, row, col, selection):
"""
sets value of selected cell to value selected from menu
"""
if self.grid.changes: # if user selects a menuitem, that is an edit
self.grid.changes.add(row)
else:
self.grid.changes = {row}
... | python | def on_select_menuitem(self, event, grid, row, col, selection):
"""
sets value of selected cell to value selected from menu
"""
if self.grid.changes: # if user selects a menuitem, that is an edit
self.grid.changes.add(row)
else:
self.grid.changes = {row}
... | sets value of selected cell to value selected from menu | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/drop_down_menus2.py#L311-L350 |
PmagPy/PmagPy | programs/plot_cdf.py | main | def main():
"""
NAME
plot_cdf.py
DESCRIPTION
makes plots of cdfs of data in input file
SYNTAX
plot_cdf.py [-h][command line options]
OPTIONS
-h prints help message and quits
-f FILE
-t TITLE
-fmt [svg,eps,png,pdf,jpg..] specify format of ou... | python | def main():
"""
NAME
plot_cdf.py
DESCRIPTION
makes plots of cdfs of data in input file
SYNTAX
plot_cdf.py [-h][command line options]
OPTIONS
-h prints help message and quits
-f FILE
-t TITLE
-fmt [svg,eps,png,pdf,jpg..] specify format of ou... | NAME
plot_cdf.py
DESCRIPTION
makes plots of cdfs of data in input file
SYNTAX
plot_cdf.py [-h][command line options]
OPTIONS
-h prints help message and quits
-f FILE
-t TITLE
-fmt [svg,eps,png,pdf,jpg..] specify format of output figure, default is ... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/plot_cdf.py#L12-L63 |
PmagPy/PmagPy | programs/bootams.py | main | def main():
"""
NAME
bootams.py
DESCRIPTION
calculates bootstrap statistics for tensor data
SYNTAX
bootams.py [-h][command line options]
OPTIONS:
-h prints help message and quits
-f FILE specifies input file name
-par specifies parametric bootstrap [b... | python | def main():
"""
NAME
bootams.py
DESCRIPTION
calculates bootstrap statistics for tensor data
SYNTAX
bootams.py [-h][command line options]
OPTIONS:
-h prints help message and quits
-f FILE specifies input file name
-par specifies parametric bootstrap [b... | NAME
bootams.py
DESCRIPTION
calculates bootstrap statistics for tensor data
SYNTAX
bootams.py [-h][command line options]
OPTIONS:
-h prints help message and quits
-f FILE specifies input file name
-par specifies parametric bootstrap [by whole data set]
... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/bootams.py#L10-L78 |
PmagPy/PmagPy | pmagpy/controlled_vocabularies3.py | Vocabulary.get_json_online | def get_json_online(self, url):
"""
Use requests module to json from Earthref.
If this fails or times out, return false.
Returns
---------
result : requests.models.Response, or [] if unsuccessful
"""
if not requests:
return False
try:
... | python | def get_json_online(self, url):
"""
Use requests module to json from Earthref.
If this fails or times out, return false.
Returns
---------
result : requests.models.Response, or [] if unsuccessful
"""
if not requests:
return False
try:
... | Use requests module to json from Earthref.
If this fails or times out, return false.
Returns
---------
result : requests.models.Response, or [] if unsuccessful | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/controlled_vocabularies3.py#L68-L86 |
PmagPy/PmagPy | pmagpy/controlled_vocabularies3.py | Vocabulary.get_tiered_meth_category | def get_tiered_meth_category(self, mtype, all_codes, code_types):
"""
Get a tiered list of all er/pmag_age codes
i.e. pmag_codes = {'anisotropy_codes': ['code1', 'code2'],
'sample_preparation': [code1, code2], ...}
"""
categories = Series(code_types[code_types[mtype] == T... | python | def get_tiered_meth_category(self, mtype, all_codes, code_types):
"""
Get a tiered list of all er/pmag_age codes
i.e. pmag_codes = {'anisotropy_codes': ['code1', 'code2'],
'sample_preparation': [code1, code2], ...}
"""
categories = Series(code_types[code_types[mtype] == T... | Get a tiered list of all er/pmag_age codes
i.e. pmag_codes = {'anisotropy_codes': ['code1', 'code2'],
'sample_preparation': [code1, code2], ...} | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/controlled_vocabularies3.py#L159-L167 |
PmagPy/PmagPy | pmagpy/controlled_vocabularies3.py | Vocabulary.get_controlled_vocabularies | def get_controlled_vocabularies(self, vocab_types=default_vocab_types):
"""
Get all non-method controlled vocabularies
"""
if len(VOCAB):
self.set_vocabularies()
return
data = []
controlled_vocabularies = []
# try to get online
if n... | python | def get_controlled_vocabularies(self, vocab_types=default_vocab_types):
"""
Get all non-method controlled vocabularies
"""
if len(VOCAB):
self.set_vocabularies()
return
data = []
controlled_vocabularies = []
# try to get online
if n... | Get all non-method controlled vocabularies | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/controlled_vocabularies3.py#L182-L265 |
PmagPy/PmagPy | programs/remanence_anisotropy_magic.py | main | def main():
"""
NAME
remanence_aniso_magic.py
DESCRIPTION
This program is similar to aarm_magic.py and atrm_magic.py with minor modifications.
Converts magic measurement file with ATRM/AARM data to best-fit tensor (6 elements plus sigma)
following Hext (1963), and calculate... | python | def main():
"""
NAME
remanence_aniso_magic.py
DESCRIPTION
This program is similar to aarm_magic.py and atrm_magic.py with minor modifications.
Converts magic measurement file with ATRM/AARM data to best-fit tensor (6 elements plus sigma)
following Hext (1963), and calculate... | NAME
remanence_aniso_magic.py
DESCRIPTION
This program is similar to aarm_magic.py and atrm_magic.py with minor modifications.
Converts magic measurement file with ATRM/AARM data to best-fit tensor (6 elements plus sigma)
following Hext (1963), and calculates F-test statistics.
... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/remanence_anisotropy_magic.py#L16-L646 |
PmagPy/PmagPy | programs/eqarea_magic2.py | main | def main():
"""
NAME
eqarea_magic.py
DESCRIPTION
makes equal area projections from declination/inclination data
SYNTAX
eqarea_magic.py [command line options]
INPUT
takes magic formatted pmag_results, pmag_sites, pmag_samples or pmag_specimens
OPTIONS
-h ... | python | def main():
"""
NAME
eqarea_magic.py
DESCRIPTION
makes equal area projections from declination/inclination data
SYNTAX
eqarea_magic.py [command line options]
INPUT
takes magic formatted pmag_results, pmag_sites, pmag_samples or pmag_specimens
OPTIONS
-h ... | NAME
eqarea_magic.py
DESCRIPTION
makes equal area projections from declination/inclination data
SYNTAX
eqarea_magic.py [command line options]
INPUT
takes magic formatted pmag_results, pmag_sites, pmag_samples or pmag_specimens
OPTIONS
-h prints help message and ... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/eqarea_magic2.py#L11-L437 |
PmagPy/PmagPy | programs/conversion_scripts2/generic_magic2.py | main | def main(command_line=True, **kwargs):
"""
NAME
generic_magic.py
DESCRIPTION
converts magnetometer files in generic format to MagIC measurements format
SYNTAX
generic_magic.py [command line options]
OPTIONS
-h
prints the help message and quits.
... | python | def main(command_line=True, **kwargs):
"""
NAME
generic_magic.py
DESCRIPTION
converts magnetometer files in generic format to MagIC measurements format
SYNTAX
generic_magic.py [command line options]
OPTIONS
-h
prints the help message and quits.
... | NAME
generic_magic.py
DESCRIPTION
converts magnetometer files in generic format to MagIC measurements format
SYNTAX
generic_magic.py [command line options]
OPTIONS
-h
prints the help message and quits.
-usr USER
identify user, default is ""
... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/conversion_scripts2/generic_magic2.py#L13-L1046 |
PmagPy/PmagPy | programs/irm_unmix.py | loadData | def loadData(filePath=None):
'''
#====================================================================
in:
read measured raw data file,
search the line [' Field Remanence '] in measured data file,
skip all the rows above and the last line,
otherwise, load data as two columns.
#... | python | def loadData(filePath=None):
'''
#====================================================================
in:
read measured raw data file,
search the line [' Field Remanence '] in measured data file,
skip all the rows above and the last line,
otherwise, load data as two columns.
#... | #====================================================================
in:
read measured raw data file,
search the line [' Field Remanence '] in measured data file,
skip all the rows above and the last line,
otherwise, load data as two columns.
#
out:
rawDf,fitDf are the pandas ... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/irm_unmix.py#L81-L123 |
PmagPy/PmagPy | programs/irm_unmix.py | fit_plots | def fit_plots(ax,xfit,xraw,yfit,yraw):
'''
#====================================================================
plot the fitted results for data fit and refit
#====================================================================
'''
global _yfits_
_yfits_ = yfit
ax.plot(xfit, yfit)
... | python | def fit_plots(ax,xfit,xraw,yfit,yraw):
'''
#====================================================================
plot the fitted results for data fit and refit
#====================================================================
'''
global _yfits_
_yfits_ = yfit
ax.plot(xfit, yfit)
... | #====================================================================
plot the fitted results for data fit and refit
#==================================================================== | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/irm_unmix.py#L287-L299 |
PmagPy/PmagPy | programs/uniform.py | main | def main():
"""
NAME
uniform.py
DESCRIPTION
draws N directions from uniform distribution on a sphere
SYNTAX
uniform.py [-h][command line options]
-h prints help message and quits
-n N, specify N on the command line (default is 100)
-F file, specify ... | python | def main():
"""
NAME
uniform.py
DESCRIPTION
draws N directions from uniform distribution on a sphere
SYNTAX
uniform.py [-h][command line options]
-h prints help message and quits
-n N, specify N on the command line (default is 100)
-F file, specify ... | NAME
uniform.py
DESCRIPTION
draws N directions from uniform distribution on a sphere
SYNTAX
uniform.py [-h][command line options]
-h prints help message and quits
-n N, specify N on the command line (default is 100)
-F file, specify output file name, defaul... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/uniform.py#L7-L38 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | _2g_bin | def _2g_bin(dir_path=".", mag_file="", meas_file='measurements.txt',
spec_file="specimens.txt", samp_file="samples.txt", site_file="sites.txt",
loc_file="locations.txt", or_con='3', specnum=0, samp_con='2', corr='1',
gmeths="FS-FD:SO-POM", location="unknown", inst="", user="", noave=... | python | def _2g_bin(dir_path=".", mag_file="", meas_file='measurements.txt',
spec_file="specimens.txt", samp_file="samples.txt", site_file="sites.txt",
loc_file="locations.txt", or_con='3', specnum=0, samp_con='2', corr='1',
gmeths="FS-FD:SO-POM", location="unknown", inst="", user="", noave=... | Convert 2G binary format file to MagIC file(s)
Parameters
----------
dir_path : str
output directory, default "."
mag_file : str
input file name
meas_file : str
output measurement file name, default "measurements.txt"
spec_file : str
output specimen file name, de... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L19-L425 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | agm | def agm(agm_file, dir_path=".", input_dir_path="",
meas_outfile="", spec_outfile="", samp_outfile="",
site_outfile="", loc_outfile="", spec_infile="",
samp_infile="", site_infile="",
specimen="", specnum=0, samp_con="1", location="unknown",
instrument="", institution="", bak=Fals... | python | def agm(agm_file, dir_path=".", input_dir_path="",
meas_outfile="", spec_outfile="", samp_outfile="",
site_outfile="", loc_outfile="", spec_infile="",
samp_infile="", site_infile="",
specimen="", specnum=0, samp_con="1", location="unknown",
instrument="", institution="", bak=Fals... | Convert AGM format file to MagIC file(s)
Parameters
----------
agm_file : str
input file name
dir_path : str
working directory, default "."
input_dir_path : str
input file directory IF different from dir_path, default ""
meas_outfile : str
output measurement file... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L430-L721 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | bgc | def bgc(mag_file, dir_path=".", input_dir_path="",
meas_file='measurements.txt', spec_file='specimens.txt', samp_file='samples.txt',
site_file='sites.txt', loc_file='locations.txt', append=False,
location="unknown", site="", samp_con='1', specnum=0,
meth_code="LP-NO", volume=12, user="",... | python | def bgc(mag_file, dir_path=".", input_dir_path="",
meas_file='measurements.txt', spec_file='specimens.txt', samp_file='samples.txt',
site_file='sites.txt', loc_file='locations.txt', append=False,
location="unknown", site="", samp_con='1', specnum=0,
meth_code="LP-NO", volume=12, user="",... | Convert BGC format file to MagIC file(s)
Parameters
----------
mag_file : str
input file name
dir_path : str
working directory, default "."
input_dir_path : str
input file directory IF different from dir_path, default ""
meas_file : str
output measurement file na... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L726-L981 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | cit | def cit(dir_path=".", input_dir_path="", magfile="", user="", meas_file="measurements.txt",
spec_file="specimens.txt", samp_file="samples.txt",
site_file="sites.txt", loc_file="locations.txt", locname="unknown",
sitename="", methods=['SO-MAG'], specnum=0, samp_con='3',
norm='cc', oersted... | python | def cit(dir_path=".", input_dir_path="", magfile="", user="", meas_file="measurements.txt",
spec_file="specimens.txt", samp_file="samples.txt",
site_file="sites.txt", loc_file="locations.txt", locname="unknown",
sitename="", methods=['SO-MAG'], specnum=0, samp_con='3',
norm='cc', oersted... | Converts CIT formated Magnetometer data into MagIC format for Analysis and contribution to the MagIC database
Parameters
-----------
dir_path : directory to output files to (default : current directory)
input_dir_path : directory to input files (only needed if different from dir_path!)
magfile : ma... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L986-L1426 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | generic | def generic(magfile="", dir_path=".", meas_file="measurements.txt",
spec_file="specimens.txt", samp_file="samples.txt", site_file="sites.txt",
loc_file="locations.txt", user="", labfield=0, labfield_phi=0, labfield_theta=0,
experiment="", cooling_times_list=[], sample_nc=[1, 0], site... | python | def generic(magfile="", dir_path=".", meas_file="measurements.txt",
spec_file="specimens.txt", samp_file="samples.txt", site_file="sites.txt",
loc_file="locations.txt", user="", labfield=0, labfield_phi=0, labfield_theta=0,
experiment="", cooling_times_list=[], sample_nc=[1, 0], site... | Convert generic file to MagIC file(s)
Parameters
----------
mag_file : str
input file name
dir_path : str
output directory, default "."
meas_file : str
output measurement file name, default "measurements.txt"
spec_file : str
output specimen file name, default "sp... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L1431-L2263 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | huji | def huji(magfile="", dir_path=".", input_dir_path="", datafile="", codelist="",
meas_file="measurements.txt", spec_file="specimens.txt",
samp_file="samples.txt", site_file="sites.txt", loc_file="locations.txt",
user="", specnum=0, samp_con="1", labfield=0, phi=0, theta=0,
location=""... | python | def huji(magfile="", dir_path=".", input_dir_path="", datafile="", codelist="",
meas_file="measurements.txt", spec_file="specimens.txt",
samp_file="samples.txt", site_file="sites.txt", loc_file="locations.txt",
user="", specnum=0, samp_con="1", labfield=0, phi=0, theta=0,
location=""... | Convert HUJI format file to MagIC file(s)
Parameters
----------
magfile : str
input file name
dir_path : str
working directory, default "."
input_dir_path : str
input file directory IF different from dir_path, default ""
datafile : str
HUJI datafile with sample ori... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L2268-L2862 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | huji_sample | def huji_sample(orient_file, meths='FS-FD:SO-POM:SO-SUN', location_name='unknown',
samp_con="1", ignore_dip=True, data_model_num=3,
samp_file="samples.txt", site_file="sites.txt",
dir_path=".", input_dir_path=""):
"""
Convert HUJI sample file to MagIC file(s)
... | python | def huji_sample(orient_file, meths='FS-FD:SO-POM:SO-SUN', location_name='unknown',
samp_con="1", ignore_dip=True, data_model_num=3,
samp_file="samples.txt", site_file="sites.txt",
dir_path=".", input_dir_path=""):
"""
Convert HUJI sample file to MagIC file(s)
... | Convert HUJI sample file to MagIC file(s)
Parameters
----------
orient_file : str
input file name
meths : str
colon-delimited sampling methods, default FS-FD:SO-POM:SO-SUN
for more options, see info below
location : str
location name, default "unknown"
samp_con : s... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L2867-L3041 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | iodp_dscr_lore | def iodp_dscr_lore(dscr_file,dscr_ex_file="", dir_path=".", input_dir_path="",volume=7,noave=False,\
meas_file="measurements.txt", offline_meas_file="",spec_file="specimens.txt"):
"""
Convert IODP discrete measurement files in MagIC file(s). This program
assumes that you have created the speci... | python | def iodp_dscr_lore(dscr_file,dscr_ex_file="", dir_path=".", input_dir_path="",volume=7,noave=False,\
meas_file="measurements.txt", offline_meas_file="",spec_file="specimens.txt"):
"""
Convert IODP discrete measurement files in MagIC file(s). This program
assumes that you have created the speci... | Convert IODP discrete measurement files in MagIC file(s). This program
assumes that you have created the specimens, samples, sites and location
files using convert_2_magic.iodp_samples_csv from files downloaded from the LIMS online
repository and that all samples are in that file.
If there are offline ... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L3045-L3244 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | iodp_jr6_lore | def iodp_jr6_lore(jr6_file, dir_path=".", input_dir_path="",volume=7,noave=False,dc_field=50e-6,\
meas_file="measurements.txt", spec_file="specimens.txt"):
"""
Convert IODP JR6 measurement files in MagIC file(s). This program
assumes that you have created the specimens, samples, sites and loca... | python | def iodp_jr6_lore(jr6_file, dir_path=".", input_dir_path="",volume=7,noave=False,dc_field=50e-6,\
meas_file="measurements.txt", spec_file="specimens.txt"):
"""
Convert IODP JR6 measurement files in MagIC file(s). This program
assumes that you have created the specimens, samples, sites and loca... | Convert IODP JR6 measurement files in MagIC file(s). This program
assumes that you have created the specimens, samples, sites and location
files using convert_2_magic.iodp_samples_csv from files downloaded from the LIMS online
repository and that all samples are in that file.
Parameters
----------
... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L3248-L3372 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | iodp_kly4s_lore | def iodp_kly4s_lore(kly4s_file, meas_out='measurements.txt',
spec_infile='specimens.txt', spec_out='specimens.txt', instrument='IODP-KLY4S',
actual_volume="",dir_path='.', input_dir_path=''):
"""
Converts ascii files generated by SUFAR ver.4.0 and downloaded from the LIMS online
repos... | python | def iodp_kly4s_lore(kly4s_file, meas_out='measurements.txt',
spec_infile='specimens.txt', spec_out='specimens.txt', instrument='IODP-KLY4S',
actual_volume="",dir_path='.', input_dir_path=''):
"""
Converts ascii files generated by SUFAR ver.4.0 and downloaded from the LIMS online
repos... | Converts ascii files generated by SUFAR ver.4.0 and downloaded from the LIMS online
repository to MagIC (datamodel 3) files
Parameters
----------
kly4s_file : str
input LORE downloaded csv file, required
meas_output : str
measurement output filename, default "measurements.txt"
s... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L3375-L3539 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | iodp_jr6 | def iodp_jr6(mag_file, dir_path=".", input_dir_path="",
meas_file="measurements.txt", spec_file="specimens.txt",
samp_file="samples.txt", site_file="sites.txt", loc_file="locations.txt",
site="unknown", expedition="unknown", lat="", lon="",
noave=False, volume=12, met... | python | def iodp_jr6(mag_file, dir_path=".", input_dir_path="",
meas_file="measurements.txt", spec_file="specimens.txt",
samp_file="samples.txt", site_file="sites.txt", loc_file="locations.txt",
site="unknown", expedition="unknown", lat="", lon="",
noave=False, volume=12, met... | Conversion for IODP jr6 format files into MagIC file(s)
Parameters
----------
mag_file : str
input file name
dir_path : str
working directory, default "."
input_dir_path : str
input file directory IF different from dir_path, default ""
meas_file : str
output meas... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L3543-L3764 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | iodp_samples | def iodp_samples(samp_file, output_samp_file=None, output_dir_path='.',
input_dir_path='', data_model_num=3):
"""
Convert IODP samples data file into MagIC samples file.
Default is to overwrite samples.txt in your working directory.
Parameters
----------
samp_file : str
... | python | def iodp_samples(samp_file, output_samp_file=None, output_dir_path='.',
input_dir_path='', data_model_num=3):
"""
Convert IODP samples data file into MagIC samples file.
Default is to overwrite samples.txt in your working directory.
Parameters
----------
samp_file : str
... | Convert IODP samples data file into MagIC samples file.
Default is to overwrite samples.txt in your working directory.
Parameters
----------
samp_file : str
path to IODP sample file to convert
output_samp_file : str
MagIC-format samples file to append to, default None
output_dir... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L3769-L3951 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | iodp_sample_names | def iodp_sample_names(df):
"""
Convert expedition, hole, section, type, interval to sample name in format:
exp-hole-type-sect-interval
Parameters
___________
df : Pandas DataFrame
dataframe read in from .csv file downloaded from LIMS online database
Returns
--------------
... | python | def iodp_sample_names(df):
"""
Convert expedition, hole, section, type, interval to sample name in format:
exp-hole-type-sect-interval
Parameters
___________
df : Pandas DataFrame
dataframe read in from .csv file downloaded from LIMS online database
Returns
--------------
... | Convert expedition, hole, section, type, interval to sample name in format:
exp-hole-type-sect-interval
Parameters
___________
df : Pandas DataFrame
dataframe read in from .csv file downloaded from LIMS online database
Returns
--------------
holes : list
IODP Holes nam... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L3954-L3986 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | iodp_samples_csv | def iodp_samples_csv(lims_sample_file, spec_file='specimens.txt',samp_file="samples.txt",
site_file="sites.txt",loc_file="locations.txt",dir_path='.',
input_dir_path='',comp_depth_key="",lat="",lon="",
exp_name="",exp_desc="",age_low=0,age_high=200e6):
... | python | def iodp_samples_csv(lims_sample_file, spec_file='specimens.txt',samp_file="samples.txt",
site_file="sites.txt",loc_file="locations.txt",dir_path='.',
input_dir_path='',comp_depth_key="",lat="",lon="",
exp_name="",exp_desc="",age_low=0,age_high=200e6):
... | Convert IODP samples data file downloaded from LIMS as .csv file into datamodel 3.0 MagIC samples file.
Default is to overwrite samples.txt in your working directory.
Parameters
----------
lims_sample_file : str
path to IODP sample file to convert
dir_path : str
working directory, d... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L3988-L4159 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | iodp_samples_srm | def iodp_samples_srm(df, spec_file='specimens.txt',samp_file="samples.txt",site_file="sites.txt",dir_path='.',
input_dir_path='',comp_depth_key="",lat="",lon=""):
"""
Convert IODP samples data generated from the SRM measurements file into datamodel 3.0 MagIC samples file.
Default is to over... | python | def iodp_samples_srm(df, spec_file='specimens.txt',samp_file="samples.txt",site_file="sites.txt",dir_path='.',
input_dir_path='',comp_depth_key="",lat="",lon=""):
"""
Convert IODP samples data generated from the SRM measurements file into datamodel 3.0 MagIC samples file.
Default is to over... | Convert IODP samples data generated from the SRM measurements file into datamodel 3.0 MagIC samples file.
Default is to overwrite the output files in your working directory.
Parameters
----------
df : str
Pandas DataFrame of SRM Archive data
dir_path : str
working directory, default... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L4161-L4272 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | iodp_srm_lore | def iodp_srm_lore(srm_file, dir_path=".", input_dir_path="",noave=False,comp_depth_key='Depth CSF-B (m)',\
meas_file="srm_arch_measurements.txt", spec_file="srm_arch_specimens.txt",\
samp_file='srm_arch_samples.txt',site_file='srm_arch_sites.txt',lat="",lon=""):
"""
Convert IODP a... | python | def iodp_srm_lore(srm_file, dir_path=".", input_dir_path="",noave=False,comp_depth_key='Depth CSF-B (m)',\
meas_file="srm_arch_measurements.txt", spec_file="srm_arch_specimens.txt",\
samp_file='srm_arch_samples.txt',site_file='srm_arch_sites.txt',lat="",lon=""):
"""
Convert IODP a... | Convert IODP archive half measurement files into MagIC file(s).
Parameters
----------
srm_file : str
input csv file downloaded from LIMS online repository
dir_path : str
output directory, default "."
input_dir_path : str
input file directory IF different from dir_path, defau... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L4274-L4371 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | iodp_srm | def iodp_srm(csv_file="", dir_path=".", input_dir_path="",
meas_file="measurements.txt", spec_file="specimens.txt",
samp_file="samples.txt", site_file="sites.txt", loc_file="locations.txt",
lat="", lon="", noave=0):
"""
Converts IODP LIMS and LORE SRM archive half sample ... | python | def iodp_srm(csv_file="", dir_path=".", input_dir_path="",
meas_file="measurements.txt", spec_file="specimens.txt",
samp_file="samples.txt", site_file="sites.txt", loc_file="locations.txt",
lat="", lon="", noave=0):
"""
Converts IODP LIMS and LORE SRM archive half sample ... | Converts IODP LIMS and LORE SRM archive half sample format files
to measurements format files.
Parameters
----------
csv_file : str
input csv file, default ""
if no file name is provided, find any .csv files in the provided dir_path
dir_path : str
working directory, default ... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L4376-L4825 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | jr6_jr6 | def jr6_jr6(mag_file, dir_path=".", input_dir_path="",
meas_file="measurements.txt", spec_file="specimens.txt",
samp_file="samples.txt", site_file="sites.txt", loc_file="locations.txt",
specnum=1, samp_con='1', location='unknown', lat='', lon='',
noave=False, meth_code="L... | python | def jr6_jr6(mag_file, dir_path=".", input_dir_path="",
meas_file="measurements.txt", spec_file="specimens.txt",
samp_file="samples.txt", site_file="sites.txt", loc_file="locations.txt",
specnum=1, samp_con='1', location='unknown', lat='', lon='',
noave=False, meth_code="L... | Convert JR6 .jr6 files to MagIC file(s)
Parameters
----------
mag_file : str
input file name
dir_path : str
working directory, default "."
input_dir_path : str
input file directory IF different from dir_path, default ""
meas_file : str
output measurement file nam... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L4830-L5092 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | jr6_txt | def jr6_txt(mag_file, dir_path=".", input_dir_path="",
meas_file="measurements.txt", spec_file="specimens.txt",
samp_file="samples.txt", site_file="sites.txt", loc_file="locations.txt",
user="", specnum=1, samp_con='1', location='unknown', lat='', lon='',
noave=False, vol... | python | def jr6_txt(mag_file, dir_path=".", input_dir_path="",
meas_file="measurements.txt", spec_file="specimens.txt",
samp_file="samples.txt", site_file="sites.txt", loc_file="locations.txt",
user="", specnum=1, samp_con='1', location='unknown', lat='', lon='',
noave=False, vol... | Converts JR6 .txt format files to MagIC measurements format files.
Parameters
----------
mag_file : str
input file name
dir_path : str
working directory, default "."
input_dir_path : str
input file directory IF different from dir_path, default ""
meas_file : str
... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L5098-L5357 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | k15 | def k15(k15file, dir_path='.', input_dir_path='',
meas_file='measurements.txt', aniso_outfile='specimens.txt',
samp_file="samples.txt", result_file ="rmag_anisotropy.txt",
specnum=0, sample_naming_con='1', location="unknown",
data_model_num=3):
"""
converts .k15 format data to Ma... | python | def k15(k15file, dir_path='.', input_dir_path='',
meas_file='measurements.txt', aniso_outfile='specimens.txt',
samp_file="samples.txt", result_file ="rmag_anisotropy.txt",
specnum=0, sample_naming_con='1', location="unknown",
data_model_num=3):
"""
converts .k15 format data to Ma... | converts .k15 format data to MagIC format.
assumes Jelinek Kappabridge measurement scheme.
Parameters
----------
k15file : str
input file name
dir_path : str
output file directory, default "."
input_dir_path : str
input file directory IF different from dir_path, default... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L5360-L5875 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | ldeo | def ldeo(magfile, dir_path=".", input_dir_path="",
meas_file="measurements.txt", spec_file="specimens.txt",
samp_file="samples.txt", site_file="sites.txt", loc_file="locations.txt",
specnum=0, samp_con="1", location="unknown", codelist="",
coil="", arm_labfield=50e-6, trm_peakT=873.,... | python | def ldeo(magfile, dir_path=".", input_dir_path="",
meas_file="measurements.txt", spec_file="specimens.txt",
samp_file="samples.txt", site_file="sites.txt", loc_file="locations.txt",
specnum=0, samp_con="1", location="unknown", codelist="",
coil="", arm_labfield=50e-6, trm_peakT=873.,... | converts Lamont Doherty Earth Observatory measurement files to MagIC data base model 3.0
Parameters
_________
magfile : input measurement file
dir_path : output directory path, default "."
input_dir_path : input file directory IF different from dir_path, default ""
meas_file : output file measu... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L6390-L6713 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | mini | def mini(magfile, dir_path='.', meas_file='measurements.txt',
data_model_num=3, volume=12, noave=0,
inst="", user="", methcode="LP-NO", input_dir_path=""):
"""
Convert the Yale minispin format to MagIC format files
Parameters
----------
magfile : str
input file name, requi... | python | def mini(magfile, dir_path='.', meas_file='measurements.txt',
data_model_num=3, volume=12, noave=0,
inst="", user="", methcode="LP-NO", input_dir_path=""):
"""
Convert the Yale minispin format to MagIC format files
Parameters
----------
magfile : str
input file name, requi... | Convert the Yale minispin format to MagIC format files
Parameters
----------
magfile : str
input file name, required
dir_path : str
working directory, default "."
meas_file : str
output measurement file name, default "measurements.txt"
data_model_num : int
MagIC ... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L7594-L7769 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | mst | def mst(infile, spec_name='unknown', dir_path=".", input_dir_path="",
meas_file="measurements.txt", samp_infile="samples.txt",
user="", specnum=0, samp_con="1", labfield=0.5,
location='unknown', syn=False, data_model_num=3):
"""
Convert MsT data (T,M) to MagIC measurements format files
... | python | def mst(infile, spec_name='unknown', dir_path=".", input_dir_path="",
meas_file="measurements.txt", samp_infile="samples.txt",
user="", specnum=0, samp_con="1", labfield=0.5,
location='unknown', syn=False, data_model_num=3):
"""
Convert MsT data (T,M) to MagIC measurements format files
... | Convert MsT data (T,M) to MagIC measurements format files
Parameters
----------
infile : str
input file name
specimen : str
specimen name, default "unknown"
dir_path : str
working directory, default "."
input_dir_path : str
input file directory IF different from ... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L7773-L8001 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | pmd | def pmd(mag_file, dir_path=".", input_dir_path="",
meas_file="measurements.txt", spec_file='specimens.txt',
samp_file='samples.txt', site_file="sites.txt", loc_file="locations.txt",
lat="", lon="", specnum=0, samp_con='1', location="unknown",
noave=0, meth_code="LP-NO"):
"""
conv... | python | def pmd(mag_file, dir_path=".", input_dir_path="",
meas_file="measurements.txt", spec_file='specimens.txt',
samp_file='samples.txt', site_file="sites.txt", loc_file="locations.txt",
lat="", lon="", specnum=0, samp_con='1', location="unknown",
noave=0, meth_code="LP-NO"):
"""
conv... | converts PMD (Enkin) format files to MagIC format files
Parameters
----------
mag_file : str
input file name, required
dir_path : str
working directory, default "."
input_dir_path : str
input file directory IF different from dir_path, default ""
spec_file : str
... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L8007-L8221 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | sio | def sio(mag_file, dir_path=".", input_dir_path="",
meas_file="measurements.txt", spec_file="specimens.txt",
samp_file="samples.txt", site_file="sites.txt", loc_file="locations.txt",
samp_infile="", institution="", syn=False, syntype="", instrument="",
labfield=0, phi=0, theta=0, peakfiel... | python | def sio(mag_file, dir_path=".", input_dir_path="",
meas_file="measurements.txt", spec_file="specimens.txt",
samp_file="samples.txt", site_file="sites.txt", loc_file="locations.txt",
samp_infile="", institution="", syn=False, syntype="", instrument="",
labfield=0, phi=0, theta=0, peakfiel... | converts Scripps Institution of Oceanography measurement files to MagIC data base model 3.0
Parameters
_________
magfile : input measurement file
dir_path : output directory path, default "."
input_dir_path : input file directory IF different from dir_path, default ""
meas_file : output file me... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L8226-L8897 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | s_magic | def s_magic(sfile, anisfile="specimens.txt", dir_path=".", atype="AMS",
coord_type="s", sigma=False, samp_con="1", specnum=0,
location="unknown", spec="unknown", sitename="unknown",
user="", data_model_num=3, name_in_file=False, input_dir_path=""):
"""
converts .s format data... | python | def s_magic(sfile, anisfile="specimens.txt", dir_path=".", atype="AMS",
coord_type="s", sigma=False, samp_con="1", specnum=0,
location="unknown", spec="unknown", sitename="unknown",
user="", data_model_num=3, name_in_file=False, input_dir_path=""):
"""
converts .s format data... | converts .s format data to measurements format.
Parameters
----------
sfile : str
.s format file, required
anisfile : str
specimen filename, default 'specimens.txt'
dir_path : str
output directory, default "."
atype : str
anisotropy type (AMS, AARM, ATRM, default... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L8902-L9094 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | sufar4 | def sufar4(ascfile, meas_output='measurements.txt', aniso_output='rmag_anisotropy.txt',
spec_infile=None, spec_outfile='specimens.txt', samp_outfile='samples.txt',
site_outfile='sites.txt', specnum=0, sample_naming_con='1', user="",
locname="unknown", instrument='', static_15_position_m... | python | def sufar4(ascfile, meas_output='measurements.txt', aniso_output='rmag_anisotropy.txt',
spec_infile=None, spec_outfile='specimens.txt', samp_outfile='samples.txt',
site_outfile='sites.txt', specnum=0, sample_naming_con='1', user="",
locname="unknown", instrument='', static_15_position_m... | Converts ascii files generated by SUFAR ver.4.0 to MagIC files
Parameters
----------
ascfile : str
input ASC file, required
meas_output : str
measurement output filename, default "measurements.txt"
aniso_output : str
anisotropy output filename, MagIC 2 only, "rmag_anisotropy... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L9100-L9564 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | tdt | def tdt(input_dir_path, experiment_name="Thellier", meas_file_name="measurements.txt",
spec_file_name="specimens.txt", samp_file_name="samples.txt",
site_file_name="sites.txt", loc_file_name="locations.txt",
user="", location="", lab_dec=0, lab_inc=90, moment_units="mA/m",
samp_name_con=... | python | def tdt(input_dir_path, experiment_name="Thellier", meas_file_name="measurements.txt",
spec_file_name="specimens.txt", samp_file_name="samples.txt",
site_file_name="sites.txt", loc_file_name="locations.txt",
user="", location="", lab_dec=0, lab_inc=90, moment_units="mA/m",
samp_name_con=... | converts TDT formatted files to measurements format files
Parameters
----------
input_dir_path : str
directory with one or more .tdt files
experiment: str
one of: ["Thellier", "ATRM 6 pos", "NLT"], default "Thellier"
meas_file_name : str
default "measurements.txt"
spec_f... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L9567-L10280 |
PmagPy/PmagPy | pmagpy/convert_2_magic.py | utrecht | def utrecht(mag_file, dir_path=".", input_dir_path="", meas_file="measurements.txt",
spec_file="specimens.txt", samp_file="samples.txt", site_file="sites.txt",
loc_file="locations.txt", location="unknown", lat="", lon="", dmy_flag=False,
noave=False, meas_n_orient=8, meth_code="LP-N... | python | def utrecht(mag_file, dir_path=".", input_dir_path="", meas_file="measurements.txt",
spec_file="specimens.txt", samp_file="samples.txt", site_file="sites.txt",
loc_file="locations.txt", location="unknown", lat="", lon="", dmy_flag=False,
noave=False, meas_n_orient=8, meth_code="LP-N... | Converts Utrecht magnetometer data files to MagIC files
Parameters
----------
mag_file : str
input file name
dir_path : str
working directory, default "."
input_dir_path : str
input file directory IF different from dir_path, default ""
spec_file : str
output spec... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/convert_2_magic.py#L10287-L10612 |
PmagPy/PmagPy | SPD/spd.py | make_thing | def make_thing():
""" makes example PintPars object """
cwd = os.getcwd()
main_dir = cwd + '/SPD'
try:
import new_lj_thellier_gui_spd as tgs
gui = tgs.Arai_GUI('/magic_measurements.txt', main_dir)
specimens = list(gui.Data.keys())
thing = PintPars(gui.Data, '0238x6011044'... | python | def make_thing():
""" makes example PintPars object """
cwd = os.getcwd()
main_dir = cwd + '/SPD'
try:
import new_lj_thellier_gui_spd as tgs
gui = tgs.Arai_GUI('/magic_measurements.txt', main_dir)
specimens = list(gui.Data.keys())
thing = PintPars(gui.Data, '0238x6011044'... | makes example PintPars object | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/spd.py#L806-L823 |
PmagPy/PmagPy | SPD/spd.py | PintPars.get_curve_prime | def get_curve_prime(self):
"""not in SPD documentation. same as k, but using the segment instead of the full data set"""
if len(self.x_Arai_segment) < 4:
self.pars['specimen_k_prime'], self.pars['specimen_k_prime_sse'] = 0, 0
return 0
data = lib_k.AraiCurvature(self.x_Ar... | python | def get_curve_prime(self):
"""not in SPD documentation. same as k, but using the segment instead of the full data set"""
if len(self.x_Arai_segment) < 4:
self.pars['specimen_k_prime'], self.pars['specimen_k_prime_sse'] = 0, 0
return 0
data = lib_k.AraiCurvature(self.x_Ar... | not in SPD documentation. same as k, but using the segment instead of the full data set | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/spd.py#L274-L281 |
PmagPy/PmagPy | SPD/spd.py | PintPars.get_ptrm_dec_and_inc | def get_ptrm_dec_and_inc(self):
"""not included in spd."""
PTRMS = self.PTRMS[1:]
CART_pTRMS_orig = numpy.array([lib_direct.dir2cart(row[1:4]) for row in PTRMS])
#B_lab_dir = [self.B_lab_dir[0], self.B_lab_dir[1], 1.] # dir
tmin, tmax = self.t_Arai[0], self.t_Arai[-1]
ptr... | python | def get_ptrm_dec_and_inc(self):
"""not included in spd."""
PTRMS = self.PTRMS[1:]
CART_pTRMS_orig = numpy.array([lib_direct.dir2cart(row[1:4]) for row in PTRMS])
#B_lab_dir = [self.B_lab_dir[0], self.B_lab_dir[1], 1.] # dir
tmin, tmax = self.t_Arai[0], self.t_Arai[-1]
ptr... | not included in spd. | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/SPD/spd.py#L391-L401 |
PmagPy/PmagPy | programs/thellier_magic.py | main | def main():
"""
NAME
thellier_magic.py
DESCRIPTION
plots Thellier-Thellier data in version 3.0 format
Reads saved interpretations from a specimen formatted table, default: specimens.txt
SYNTAX
thellier_magic.py [command line options]
OPTIONS
-h prints help ... | python | def main():
"""
NAME
thellier_magic.py
DESCRIPTION
plots Thellier-Thellier data in version 3.0 format
Reads saved interpretations from a specimen formatted table, default: specimens.txt
SYNTAX
thellier_magic.py [command line options]
OPTIONS
-h prints help ... | NAME
thellier_magic.py
DESCRIPTION
plots Thellier-Thellier data in version 3.0 format
Reads saved interpretations from a specimen formatted table, default: specimens.txt
SYNTAX
thellier_magic.py [command line options]
OPTIONS
-h prints help message and quits
... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_magic.py#L18-L100 |
PmagPy/PmagPy | pmagpy/data_model3.py | DataModel.get_data_model | def get_data_model(self):
"""
Try to download the data model from Earthref.
If that fails, grab the cached data model.
"""
if len(DM):
self.dm = DM
self.crit_map = CRIT_MAP
return
if not set_env.OFFLINE:
dm = self.get_dm_onl... | python | def get_data_model(self):
"""
Try to download the data model from Earthref.
If that fails, grab the cached data model.
"""
if len(DM):
self.dm = DM
self.crit_map = CRIT_MAP
return
if not set_env.OFFLINE:
dm = self.get_dm_onl... | Try to download the data model from Earthref.
If that fails, grab the cached data model. | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/data_model3.py#L35-L53 |
PmagPy/PmagPy | pmagpy/data_model3.py | DataModel.get_dm_offline | def get_dm_offline(self):
"""
Grab the 3.0 data model from the PmagPy/pmagpy directory
Returns
---------
full : DataFrame
cached data model json in DataFrame format
"""
model_file = self.find_cached_dm()
try:
f = open(model_file, '... | python | def get_dm_offline(self):
"""
Grab the 3.0 data model from the PmagPy/pmagpy directory
Returns
---------
full : DataFrame
cached data model json in DataFrame format
"""
model_file = self.find_cached_dm()
try:
f = open(model_file, '... | Grab the 3.0 data model from the PmagPy/pmagpy directory
Returns
---------
full : DataFrame
cached data model json in DataFrame format | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/data_model3.py#L56-L74 |
PmagPy/PmagPy | pmagpy/data_model3.py | DataModel.get_dm_online | def get_dm_online(self):
"""
Use requests module to get data model from Earthref.
If this fails or times out, return false.
Returns
---------
result : requests.models.Response, False if unsuccessful
"""
if not requests:
return False
tr... | python | def get_dm_online(self):
"""
Use requests module to get data model from Earthref.
If this fails or times out, return false.
Returns
---------
result : requests.models.Response, False if unsuccessful
"""
if not requests:
return False
tr... | Use requests module to get data model from Earthref.
If this fails or times out, return false.
Returns
---------
result : requests.models.Response, False if unsuccessful | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/data_model3.py#L77-L95 |
PmagPy/PmagPy | pmagpy/data_model3.py | DataModel.parse_cache | def parse_cache(self, full_df):
"""
Format the cached data model into a dictionary of DataFrames
and a criteria map DataFrame.
Parameters
----------
full_df : DataFrame
result of self.get_dm_offline()
Returns
----------
data_model : d... | python | def parse_cache(self, full_df):
"""
Format the cached data model into a dictionary of DataFrames
and a criteria map DataFrame.
Parameters
----------
full_df : DataFrame
result of self.get_dm_offline()
Returns
----------
data_model : d... | Format the cached data model into a dictionary of DataFrames
and a criteria map DataFrame.
Parameters
----------
full_df : DataFrame
result of self.get_dm_offline()
Returns
----------
data_model : dictionary of DataFrames
crit_map : DataFrame | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/data_model3.py#L98-L123 |
PmagPy/PmagPy | pmagpy/data_model3.py | DataModel.parse | def parse(self, data_model, crit):
"""
Take the relevant pieces of the data model json
and parse into data model and criteria map.
Parameters
----------
data_model : data model piece of json (nested dicts)
crit : criteria map piece of json (nested dicts)
... | python | def parse(self, data_model, crit):
"""
Take the relevant pieces of the data model json
and parse into data model and criteria map.
Parameters
----------
data_model : data model piece of json (nested dicts)
crit : criteria map piece of json (nested dicts)
... | Take the relevant pieces of the data model json
and parse into data model and criteria map.
Parameters
----------
data_model : data model piece of json (nested dicts)
crit : criteria map piece of json (nested dicts)
Returns
----------
data_model : dictio... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/data_model3.py#L126-L159 |
PmagPy/PmagPy | pmagpy/data_model3.py | DataModel.parse_response | def parse_response(self, raw):
"""
Format the requested data model into a dictionary of DataFrames
and a criteria map DataFrame.
Take data returned by a requests.get call to Earthref.
Parameters
----------
raw: 'requests.models.Response'
Returns
... | python | def parse_response(self, raw):
"""
Format the requested data model into a dictionary of DataFrames
and a criteria map DataFrame.
Take data returned by a requests.get call to Earthref.
Parameters
----------
raw: 'requests.models.Response'
Returns
... | Format the requested data model into a dictionary of DataFrames
and a criteria map DataFrame.
Take data returned by a requests.get call to Earthref.
Parameters
----------
raw: 'requests.models.Response'
Returns
---------
data_model : dictionary of DataFr... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/data_model3.py#L162-L180 |
PmagPy/PmagPy | pmagpy/data_model3.py | DataModel.find_cached_dm | def find_cached_dm(self):
"""
Find filename where cached data model json is stored.
Returns
---------
model_file : str
data model json file location
"""
pmag_dir = find_pmag_dir.get_pmag_dir()
if pmag_dir is None:
pmag_dir = '.'
... | python | def find_cached_dm(self):
"""
Find filename where cached data model json is stored.
Returns
---------
model_file : str
data model json file location
"""
pmag_dir = find_pmag_dir.get_pmag_dir()
if pmag_dir is None:
pmag_dir = '.'
... | Find filename where cached data model json is stored.
Returns
---------
model_file : str
data model json file location | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/data_model3.py#L183-L205 |
PmagPy/PmagPy | pmagpy/data_model3.py | DataModel.cache_data_model | def cache_data_model(self, raw):
"""
Cache the data model json.
Take data returned by a requests.get call to Earthref.
Parameters
----------
raw: requests.models.Response
"""
output_json = json.loads(raw.content)
output_file = self.find_cached_dm... | python | def cache_data_model(self, raw):
"""
Cache the data model json.
Take data returned by a requests.get call to Earthref.
Parameters
----------
raw: requests.models.Response
"""
output_json = json.loads(raw.content)
output_file = self.find_cached_dm... | Cache the data model json.
Take data returned by a requests.get call to Earthref.
Parameters
----------
raw: requests.models.Response | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/data_model3.py#L208-L220 |
PmagPy/PmagPy | pmagpy/data_model3.py | DataModel.get_groups | def get_groups(self, table_name):
"""
Return list of all groups for a particular data type
"""
df = self.dm[table_name]
return list(df['group'].unique()) | python | def get_groups(self, table_name):
"""
Return list of all groups for a particular data type
"""
df = self.dm[table_name]
return list(df['group'].unique()) | Return list of all groups for a particular data type | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/data_model3.py#L225-L230 |
PmagPy/PmagPy | pmagpy/data_model3.py | DataModel.get_group_headers | def get_group_headers(self, table_name, group_name):
"""
Return a list of all headers for a given group
"""
# get all headers of a particular group
df = self.dm[table_name]
cond = df['group'] == group_name
return df[cond].index | python | def get_group_headers(self, table_name, group_name):
"""
Return a list of all headers for a given group
"""
# get all headers of a particular group
df = self.dm[table_name]
cond = df['group'] == group_name
return df[cond].index | Return a list of all headers for a given group | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/data_model3.py#L232-L239 |
PmagPy/PmagPy | pmagpy/data_model3.py | DataModel.get_reqd_headers | def get_reqd_headers(self, table_name):
"""
Return a list of all required headers for a particular table
"""
df = self.dm[table_name]
cond = df['validations'].map(lambda x: 'required()' in str(x))
return df[cond].index | python | def get_reqd_headers(self, table_name):
"""
Return a list of all required headers for a particular table
"""
df = self.dm[table_name]
cond = df['validations'].map(lambda x: 'required()' in str(x))
return df[cond].index | Return a list of all required headers for a particular table | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/data_model3.py#L241-L247 |
PmagPy/PmagPy | pmagpy/data_model3.py | DataModel.get_group_for_col | def get_group_for_col(self, table_name, col_name):
"""
Check data model to find group name for a given column header
Parameters
----------
table_name: str
col_name: str
Returns
---------
group_name: str
"""
df = self.dm[table_name... | python | def get_group_for_col(self, table_name, col_name):
"""
Check data model to find group name for a given column header
Parameters
----------
table_name: str
col_name: str
Returns
---------
group_name: str
"""
df = self.dm[table_name... | Check data model to find group name for a given column header
Parameters
----------
table_name: str
col_name: str
Returns
---------
group_name: str | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/data_model3.py#L249-L267 |
PmagPy/PmagPy | programs/fisher.py | main | def main():
"""
NAME
fisher.py
DESCRIPTION
generates set of Fisher distribed data from specified distribution
INPUT (COMMAND LINE ENTRY)
OUTPUT
dec, inc
SYNTAX
fisher.py [-h] [-i] [command line options]
OPTIONS
-h prints help message and quits
... | python | def main():
"""
NAME
fisher.py
DESCRIPTION
generates set of Fisher distribed data from specified distribution
INPUT (COMMAND LINE ENTRY)
OUTPUT
dec, inc
SYNTAX
fisher.py [-h] [-i] [command line options]
OPTIONS
-h prints help message and quits
... | NAME
fisher.py
DESCRIPTION
generates set of Fisher distribed data from specified distribution
INPUT (COMMAND LINE ENTRY)
OUTPUT
dec, inc
SYNTAX
fisher.py [-h] [-i] [command line options]
OPTIONS
-h prints help message and quits
-i for interactive ... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/fisher.py#L13-L54 |
PmagPy/PmagPy | programs/pmm_redo.py | main | def main():
"""
NAME
pmm_redo.py
DESCRIPTION
converts the UCSC PMM files format to PmagPy redo file
SYNTAX
pmm_redo.py [-h] [command line options]
OPTIONS
-h: prints help message and quits
-f FILE: specify input file
-F FILE: specify output file, d... | python | def main():
"""
NAME
pmm_redo.py
DESCRIPTION
converts the UCSC PMM files format to PmagPy redo file
SYNTAX
pmm_redo.py [-h] [command line options]
OPTIONS
-h: prints help message and quits
-f FILE: specify input file
-F FILE: specify output file, d... | NAME
pmm_redo.py
DESCRIPTION
converts the UCSC PMM files format to PmagPy redo file
SYNTAX
pmm_redo.py [-h] [command line options]
OPTIONS
-h: prints help message and quits
-f FILE: specify input file
-F FILE: specify output file, default is 'zeq_redo' | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/pmm_redo.py#L6-L71 |
PmagPy/PmagPy | programs/fishqq.py | main | def main():
"""
NAME
fishqq.py
DESCRIPTION
makes qq plot from dec,inc input data
INPUT FORMAT
takes dec/inc pairs in space delimited file
SYNTAX
fishqq.py [command line options]
OPTIONS
-h help message
-f FILE, specify file on command line
... | python | def main():
"""
NAME
fishqq.py
DESCRIPTION
makes qq plot from dec,inc input data
INPUT FORMAT
takes dec/inc pairs in space delimited file
SYNTAX
fishqq.py [command line options]
OPTIONS
-h help message
-f FILE, specify file on command line
... | NAME
fishqq.py
DESCRIPTION
makes qq plot from dec,inc input data
INPUT FORMAT
takes dec/inc pairs in space delimited file
SYNTAX
fishqq.py [command line options]
OPTIONS
-h help message
-f FILE, specify file on command line
-F FILE, specify output ... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/fishqq.py#L12-L157 |
PmagPy/PmagPy | programs/lnp_magic.py | main | def main():
"""
NAME
lnp_magic.py
DESCRIPTION
makes equal area projections site by site
from specimen formatted file with
Fisher confidence ellipse using McFadden and McElhinny (1988)
technique for combining lines and planes
SYNTAX
lnp_magic [command l... | python | def main():
"""
NAME
lnp_magic.py
DESCRIPTION
makes equal area projections site by site
from specimen formatted file with
Fisher confidence ellipse using McFadden and McElhinny (1988)
technique for combining lines and planes
SYNTAX
lnp_magic [command l... | NAME
lnp_magic.py
DESCRIPTION
makes equal area projections site by site
from specimen formatted file with
Fisher confidence ellipse using McFadden and McElhinny (1988)
technique for combining lines and planes
SYNTAX
lnp_magic [command line options]
INPUT
... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/lnp_magic.py#L14-L210 |
PmagPy/PmagPy | pmagpy/builder2.py | get_item_string | def get_item_string(items_list):
"""
take in a list of pmag_objects
return a colon-delimited list of the findable names
"""
if not items_list:
return ''
string_list = []
for item in items_list:
try:
name = item.name
string_list.append(name)
exc... | python | def get_item_string(items_list):
"""
take in a list of pmag_objects
return a colon-delimited list of the findable names
"""
if not items_list:
return ''
string_list = []
for item in items_list:
try:
name = item.name
string_list.append(name)
exc... | take in a list of pmag_objects
return a colon-delimited list of the findable names | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L1775-L1789 |
PmagPy/PmagPy | pmagpy/builder2.py | combine_dicts | def combine_dicts(new_dict, old_dict):
"""
returns a dictionary with all key, value pairs from new_dict.
also returns key, value pairs from old_dict, if that key does not exist in new_dict.
if a key is present in both new_dict and old_dict, the new_dict value will take precedence.
"""
old_data_k... | python | def combine_dicts(new_dict, old_dict):
"""
returns a dictionary with all key, value pairs from new_dict.
also returns key, value pairs from old_dict, if that key does not exist in new_dict.
if a key is present in both new_dict and old_dict, the new_dict value will take precedence.
"""
old_data_k... | returns a dictionary with all key, value pairs from new_dict.
also returns key, value pairs from old_dict, if that key does not exist in new_dict.
if a key is present in both new_dict and old_dict, the new_dict value will take precedence. | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L1815-L1830 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.find_by_name | def find_by_name(self, item_name, items_list, name_list=None):
"""
Return item from items_list with name item_name.
"""
if not name_list:
names = [item.name for item in items_list if item]
else:
names = name_list
if item_name in names:
... | python | def find_by_name(self, item_name, items_list, name_list=None):
"""
Return item from items_list with name item_name.
"""
if not name_list:
names = [item.name for item in items_list if item]
else:
names = name_list
if item_name in names:
... | Return item from items_list with name item_name. | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L97-L108 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.find_or_create_by_name | def find_or_create_by_name(self, item_name, items_list, item_type):
"""
See if item with item_name exists in item_list.
If not, create that item.
Either way, return an item of type item_type.
"""
item = self.find_by_name(item_name, items_list)
if not item:
... | python | def find_or_create_by_name(self, item_name, items_list, item_type):
"""
See if item with item_name exists in item_list.
If not, create that item.
Either way, return an item of type item_type.
"""
item = self.find_by_name(item_name, items_list)
if not item:
... | See if item with item_name exists in item_list.
If not, create that item.
Either way, return an item of type item_type. | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L110-L119 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.init_default_headers | def init_default_headers(self):
"""
initialize default required headers.
if there were any pre-existing headers, keep them also.
"""
if not self.data_model:
self.data_model = validate_upload.get_data_model()
if not self.data_model:
print("C... | python | def init_default_headers(self):
"""
initialize default required headers.
if there were any pre-existing headers, keep them also.
"""
if not self.data_model:
self.data_model = validate_upload.get_data_model()
if not self.data_model:
print("C... | initialize default required headers.
if there were any pre-existing headers, keep them also. | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L121-L143 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.add_measurement | def add_measurement(self, exp_name, meas_num, spec_name=None, er_data=None, pmag_data=None):
"""
Find actual data object for specimen.
Then create a measurement belonging to that specimen and add it to the data object
"""
specimen = self.find_by_name(spec_name, self.specimens)
... | python | def add_measurement(self, exp_name, meas_num, spec_name=None, er_data=None, pmag_data=None):
"""
Find actual data object for specimen.
Then create a measurement belonging to that specimen and add it to the data object
"""
specimen = self.find_by_name(spec_name, self.specimens)
... | Find actual data object for specimen.
Then create a measurement belonging to that specimen and add it to the data object | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L200-L208 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.change_specimen | def change_specimen(self, old_spec_name, new_spec_name,
new_sample_name=None, new_er_data=None, new_pmag_data=None,
replace_data=False):
"""
Find actual data objects for specimen and sample.
Then call Specimen class change method to update specimen... | python | def change_specimen(self, old_spec_name, new_spec_name,
new_sample_name=None, new_er_data=None, new_pmag_data=None,
replace_data=False):
"""
Find actual data objects for specimen and sample.
Then call Specimen class change method to update specimen... | Find actual data objects for specimen and sample.
Then call Specimen class change method to update specimen name and data. | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L210-L230 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.delete_specimen | def delete_specimen(self, spec_name):
"""
Remove specimen with name spec_name from self.specimens.
If the specimen belonged to a sample, remove it from the sample's specimen list.
"""
specimen = self.find_by_name(spec_name, self.specimens)
if not specimen:
ret... | python | def delete_specimen(self, spec_name):
"""
Remove specimen with name spec_name from self.specimens.
If the specimen belonged to a sample, remove it from the sample's specimen list.
"""
specimen = self.find_by_name(spec_name, self.specimens)
if not specimen:
ret... | Remove specimen with name spec_name from self.specimens.
If the specimen belonged to a sample, remove it from the sample's specimen list. | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L232-L245 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.add_specimen | def add_specimen(self, spec_name, samp_name=None, er_data=None, pmag_data=None):
"""
Create a Specimen object and add it to self.specimens.
If a sample name is provided, add the specimen to sample.specimens as well.
"""
if samp_name:
sample = self.find_by_name(samp_na... | python | def add_specimen(self, spec_name, samp_name=None, er_data=None, pmag_data=None):
"""
Create a Specimen object and add it to self.specimens.
If a sample name is provided, add the specimen to sample.specimens as well.
"""
if samp_name:
sample = self.find_by_name(samp_na... | Create a Specimen object and add it to self.specimens.
If a sample name is provided, add the specimen to sample.specimens as well. | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L247-L266 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.change_sample | def change_sample(self, old_samp_name, new_samp_name, new_site_name=None,
new_er_data=None, new_pmag_data=None, replace_data=False):
"""
Find actual data objects for sample and site.
Then call Sample class change method to update sample name and data..
"""
s... | python | def change_sample(self, old_samp_name, new_samp_name, new_site_name=None,
new_er_data=None, new_pmag_data=None, replace_data=False):
"""
Find actual data objects for sample and site.
Then call Sample class change method to update sample name and data..
"""
s... | Find actual data objects for sample and site.
Then call Sample class change method to update sample name and data.. | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L268-L287 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.add_sample | def add_sample(self, samp_name, site_name=None, er_data=None, pmag_data=None):
"""
Create a Sample object and add it to self.samples.
If a site name is provided, add the sample to site.samples as well.
"""
if site_name:
site = self.find_by_name(site_name, self.sites)
... | python | def add_sample(self, samp_name, site_name=None, er_data=None, pmag_data=None):
"""
Create a Sample object and add it to self.samples.
If a site name is provided, add the sample to site.samples as well.
"""
if site_name:
site = self.find_by_name(site_name, self.sites)
... | Create a Sample object and add it to self.samples.
If a site name is provided, add the sample to site.samples as well. | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L289-L306 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.delete_sample | def delete_sample(self, sample_name, replacement_samp=None):
"""
Remove sample with name sample_name from self.samples.
If the sample belonged to a site, remove it from the site's sample list.
If the sample had any specimens, change specimen.sample to "".
"""
sample = sel... | python | def delete_sample(self, sample_name, replacement_samp=None):
"""
Remove sample with name sample_name from self.samples.
If the sample belonged to a site, remove it from the site's sample list.
If the sample had any specimens, change specimen.sample to "".
"""
sample = sel... | Remove sample with name sample_name from self.samples.
If the sample belonged to a site, remove it from the site's sample list.
If the sample had any specimens, change specimen.sample to "". | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L308-L324 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.change_site | def change_site(self, old_site_name, new_site_name, new_location_name=None,
new_er_data=None, new_pmag_data=None, replace_data=False):
"""
Find actual data objects for site and location.
Then call the Site class change method to update site name and data.
"""
... | python | def change_site(self, old_site_name, new_site_name, new_location_name=None,
new_er_data=None, new_pmag_data=None, replace_data=False):
"""
Find actual data objects for site and location.
Then call the Site class change method to update site name and data.
"""
... | Find actual data objects for site and location.
Then call the Site class change method to update site name and data. | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L336-L363 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.add_site | def add_site(self, site_name, location_name=None, er_data=None, pmag_data=None):
"""
Create a Site object and add it to self.sites.
If a location name is provided, add the site to location.sites as well.
"""
if location_name:
location = self.find_by_name(location_name... | python | def add_site(self, site_name, location_name=None, er_data=None, pmag_data=None):
"""
Create a Site object and add it to self.sites.
If a location name is provided, add the site to location.sites as well.
"""
if location_name:
location = self.find_by_name(location_name... | Create a Site object and add it to self.sites.
If a location name is provided, add the site to location.sites as well. | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L365-L385 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.delete_site | def delete_site(self, site_name, replacement_site=None):
"""
Remove site with name site_name from self.sites.
If the site belonged to a location, remove it from the location's site list.
If the site had any samples, change sample.site to "".
"""
site = self.find_by_name(s... | python | def delete_site(self, site_name, replacement_site=None):
"""
Remove site with name site_name from self.sites.
If the site belonged to a location, remove it from the location's site list.
If the site had any samples, change sample.site to "".
"""
site = self.find_by_name(s... | Remove site with name site_name from self.sites.
If the site belonged to a location, remove it from the location's site list.
If the site had any samples, change sample.site to "". | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L387-L403 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.change_location | def change_location(self, old_location_name, new_location_name, new_parent_name=None,
new_er_data=None, new_pmag_data=None, replace_data=False):
"""
Find actual data object for location with old_location_name.
Then call Location class change method to update location name... | python | def change_location(self, old_location_name, new_location_name, new_parent_name=None,
new_er_data=None, new_pmag_data=None, replace_data=False):
"""
Find actual data object for location with old_location_name.
Then call Location class change method to update location name... | Find actual data object for location with old_location_name.
Then call Location class change method to update location name and data. | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L405-L416 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.add_location | def add_location(self, location_name, parent_name=None, er_data=None, pmag_data=None):
"""
Create a Location object and add it to self.locations.
"""
if not location_name:
return False
location = Location(location_name, data_model=self.data_model, er_data=er_data, pma... | python | def add_location(self, location_name, parent_name=None, er_data=None, pmag_data=None):
"""
Create a Location object and add it to self.locations.
"""
if not location_name:
return False
location = Location(location_name, data_model=self.data_model, er_data=er_data, pma... | Create a Location object and add it to self.locations. | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L418-L426 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.delete_location | def delete_location(self, location_name):
"""
Remove location with name location_name from self.locations.
If the location had any sites, change site.location to "".
"""
location = self.find_by_name(location_name, self.locations)
if not location:
return False
... | python | def delete_location(self, location_name):
"""
Remove location with name location_name from self.locations.
If the location had any sites, change site.location to "".
"""
location = self.find_by_name(location_name, self.locations)
if not location:
return False
... | Remove location with name location_name from self.locations.
If the location had any sites, change site.location to "". | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L428-L442 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.change_result | def change_result(self, old_result_name, new_result_name, new_er_data=None,
new_pmag_data=None, spec_names=None, samp_names=None,
site_names=None, loc_names=None, replace_data=False):
"""
Find actual data object for result with old_result_name.
Then ca... | python | def change_result(self, old_result_name, new_result_name, new_er_data=None,
new_pmag_data=None, spec_names=None, samp_names=None,
site_names=None, loc_names=None, replace_data=False):
"""
Find actual data object for result with old_result_name.
Then ca... | Find actual data object for result with old_result_name.
Then call Result class change method to update result name and data. | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L479-L504 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.get_data | def get_data(self):
"""
attempt to read measurements file in working directory.
"""
meas_file = os.path.join(self.WD, 'magic_measurements.txt')
if not os.path.isfile(meas_file):
print("-I- No magic_measurements.txt file")
return {}
try:
... | python | def get_data(self):
"""
attempt to read measurements file in working directory.
"""
meas_file = os.path.join(self.WD, 'magic_measurements.txt')
if not os.path.isfile(meas_file):
print("-I- No magic_measurements.txt file")
return {}
try:
... | attempt to read measurements file in working directory. | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L508-L581 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.get_magic_info | def get_magic_info(self, child_type, parent_type=None, attr='er',
filename=None, sort_by_file_type=False):
"""
Read er_*.txt or pmag_*.txt file.
If no filename is provided, use er_* or pmag_* file in WD.
If sort_by_file_type, use file header to determine child, par... | python | def get_magic_info(self, child_type, parent_type=None, attr='er',
filename=None, sort_by_file_type=False):
"""
Read er_*.txt or pmag_*.txt file.
If no filename is provided, use er_* or pmag_* file in WD.
If sort_by_file_type, use file header to determine child, par... | Read er_*.txt or pmag_*.txt file.
If no filename is provided, use er_* or pmag_* file in WD.
If sort_by_file_type, use file header to determine child, parent types,
instead of passing those in as arguments.
Once file is open, parse information into dictionaries for each item.
If ... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L595-L707 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.get_age_info | def get_age_info(self, filename=None):
"""
Read er_ages.txt file.
Parse information into dictionaries for each site/sample.
Then add it to the site/sample object as site/sample.age_data.
"""
# use filename if provided, otherwise find er_ages.txt in WD
if not filen... | python | def get_age_info(self, filename=None):
"""
Read er_ages.txt file.
Parse information into dictionaries for each site/sample.
Then add it to the site/sample object as site/sample.age_data.
"""
# use filename if provided, otherwise find er_ages.txt in WD
if not filen... | Read er_ages.txt file.
Parse information into dictionaries for each site/sample.
Then add it to the site/sample object as site/sample.age_data. | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L709-L776 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.get_results_info | def get_results_info(self, filename=None):
"""
Read pmag_results.txt file.
Parse information into dictionaries for each item.
Then add it to the item object as object.results_data.
"""
if not filename:
short_filename = "pmag_results.txt"
magic_file... | python | def get_results_info(self, filename=None):
"""
Read pmag_results.txt file.
Parse information into dictionaries for each item.
Then add it to the item object as object.results_data.
"""
if not filename:
short_filename = "pmag_results.txt"
magic_file... | Read pmag_results.txt file.
Parse information into dictionaries for each item.
Then add it to the item object as object.results_data. | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L778-L831 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.read_magic_file | def read_magic_file(self, path, sort_by_this_name, sort_by_file_type=False):
"""
read a magic-formatted tab-delimited file.
return a dictionary of dictionaries, with this format:
{'Z35.5a': {'specimen_weight': '1.000e-03', 'er_citation_names': 'This study', 'specimen_volume': '', 'er_loc... | python | def read_magic_file(self, path, sort_by_this_name, sort_by_file_type=False):
"""
read a magic-formatted tab-delimited file.
return a dictionary of dictionaries, with this format:
{'Z35.5a': {'specimen_weight': '1.000e-03', 'er_citation_names': 'This study', 'specimen_volume': '', 'er_loc... | read a magic-formatted tab-delimited file.
return a dictionary of dictionaries, with this format:
{'Z35.5a': {'specimen_weight': '1.000e-03', 'er_citation_names': 'This study', 'specimen_volume': '', 'er_location_name': '', 'er_site_name': 'Z35.', 'er_sample_name': 'Z35.5', 'specimen_class': '', 'er_spe... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L833-L877 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.write_files | def write_files(self):
"""
write all data out into er_* and pmag_* files as appropriate
"""
warnings = self.validate_data()
print('-I- Writing all saved data to files')
if self.measurements:
self.write_measurements_file()
for dtype in ['specimen', 'sa... | python | def write_files(self):
"""
write all data out into er_* and pmag_* files as appropriate
"""
warnings = self.validate_data()
print('-I- Writing all saved data to files')
if self.measurements:
self.write_measurements_file()
for dtype in ['specimen', 'sa... | write all data out into er_* and pmag_* files as appropriate | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L924-L954 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.write_age_file | def write_age_file(self):
"""
Write er_ages.txt based on updated ErMagicBuilder data object
"""
if not self.write_ages:
print('-I- No age data available to write')
return
first_headers = self.first_age_headers
actual_headers = sorted(self.headers['... | python | def write_age_file(self):
"""
Write er_ages.txt based on updated ErMagicBuilder data object
"""
if not self.write_ages:
print('-I- No age data available to write')
return
first_headers = self.first_age_headers
actual_headers = sorted(self.headers['... | Write er_ages.txt based on updated ErMagicBuilder data object | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L1113-L1189 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.validate_data | def validate_data(self):
"""
Validate specimen, sample, site, and location data.
"""
warnings = {}
spec_warnings, samp_warnings, site_warnings, loc_warnings = {}, {}, {}, {}
if self.specimens:
spec_warnings = self.validate_items(self.specimens, 'specimen')
... | python | def validate_data(self):
"""
Validate specimen, sample, site, and location data.
"""
warnings = {}
spec_warnings, samp_warnings, site_warnings, loc_warnings = {}, {}, {}, {}
if self.specimens:
spec_warnings = self.validate_items(self.specimens, 'specimen')
... | Validate specimen, sample, site, and location data. | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L1193-L1207 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.validate_items | def validate_items(self, item_list, item_type):
"""
Go through a list Pmag_objects and check for:
parent errors,
children errors,
type errors.
Return a dictionary of exceptions in this format:
{sample1: {'parent': [warning1, warning2, warning3], 'child': [warning1... | python | def validate_items(self, item_list, item_type):
"""
Go through a list Pmag_objects and check for:
parent errors,
children errors,
type errors.
Return a dictionary of exceptions in this format:
{sample1: {'parent': [warning1, warning2, warning3], 'child': [warning1... | Go through a list Pmag_objects and check for:
parent errors,
children errors,
type errors.
Return a dictionary of exceptions in this format:
{sample1: {'parent': [warning1, warning2, warning3], 'child': [warning1, warning2]},
sample2: {'child': [warning1], 'type': [warni... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L1210-L1302 |
PmagPy/PmagPy | pmagpy/builder2.py | ErMagicBuilder.get_min_max_lat_lon | def get_min_max_lat_lon(self, locations):
"""
Take a list of locations and return a dictionary with:
location1:
'location_begin_lat', 'location_begin_lon',
'location_end_lat', 'location_end_lon'.
and so on.
"""
d = {}
for location in locations:
... | python | def get_min_max_lat_lon(self, locations):
"""
Take a list of locations and return a dictionary with:
location1:
'location_begin_lat', 'location_begin_lon',
'location_end_lat', 'location_end_lon'.
and so on.
"""
d = {}
for location in locations:
... | Take a list of locations and return a dictionary with:
location1:
'location_begin_lat', 'location_begin_lon',
'location_end_lat', 'location_end_lon'.
and so on. | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L1391-L1426 |
PmagPy/PmagPy | pmagpy/builder2.py | Specimen.set_parent | def set_parent(self, new_samp):
"""
Set self.sample as either an empty string, or with a new Sample.
"""
self.sample = new_samp
if new_samp:
if not isinstance(new_samp, Sample):
raise Exception
self.propagate_data()
return new_samp | python | def set_parent(self, new_samp):
"""
Set self.sample as either an empty string, or with a new Sample.
"""
self.sample = new_samp
if new_samp:
if not isinstance(new_samp, Sample):
raise Exception
self.propagate_data()
return new_samp | Set self.sample as either an empty string, or with a new Sample. | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L1551-L1560 |
PmagPy/PmagPy | pmagpy/builder2.py | Sample.set_parent | def set_parent(self, new_site):
"""
Set self.site as either an empty string, or with a new Site.
"""
if new_site:
if not isinstance(new_site, Site):
raise Exception
self.site = new_site
self.propagate_data()
return new_site | python | def set_parent(self, new_site):
"""
Set self.site as either an empty string, or with a new Site.
"""
if new_site:
if not isinstance(new_site, Site):
raise Exception
self.site = new_site
self.propagate_data()
return new_site | Set self.site as either an empty string, or with a new Site. | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L1600-L1609 |
PmagPy/PmagPy | pmagpy/builder2.py | Site.change_site | def change_site(self, new_name, new_location=None, new_er_data=None,
new_pmag_data=None, replace_data=False):
"""
Update a site's name, location, er_data, and pmag_data.
By default, new data will be added in to pre-existing data, overwriting existing values.
If replac... | python | def change_site(self, new_name, new_location=None, new_er_data=None,
new_pmag_data=None, replace_data=False):
"""
Update a site's name, location, er_data, and pmag_data.
By default, new data will be added in to pre-existing data, overwriting existing values.
If replac... | Update a site's name, location, er_data, and pmag_data.
By default, new data will be added in to pre-existing data, overwriting existing values.
If replace_data is True, the new data dictionary will simply take the place of the existing dict. | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/pmagpy/builder2.py#L1666-L1676 |
PmagPy/PmagPy | programs/thellier_magic2.py | main | def main():
"""
NAME
thellier_magic.py
DESCRIPTION
plots Thellier-Thellier, allowing interactive setting of bounds
and customizing of selection criteria. Saves and reads interpretations
from a pmag_specimen formatted table, default: thellier_specimens.txt
SYNTAX
... | python | def main():
"""
NAME
thellier_magic.py
DESCRIPTION
plots Thellier-Thellier, allowing interactive setting of bounds
and customizing of selection criteria. Saves and reads interpretations
from a pmag_specimen formatted table, default: thellier_specimens.txt
SYNTAX
... | NAME
thellier_magic.py
DESCRIPTION
plots Thellier-Thellier, allowing interactive setting of bounds
and customizing of selection criteria. Saves and reads interpretations
from a pmag_specimen formatted table, default: thellier_specimens.txt
SYNTAX
thellier_magic.py [com... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/thellier_magic2.py#L21-L725 |
PmagPy/PmagPy | programs/deprecated/nrm_specimens_magic.py | main | def main():
"""
NAME
nrm_specimens_magic.py
Note: this program has been deprecated and is not maintained
DESCRIPTION
converts NRM data in a measurements type file to
geographic and tilt corrected data in a specimens type file
SYNTAX
... | python | def main():
"""
NAME
nrm_specimens_magic.py
Note: this program has been deprecated and is not maintained
DESCRIPTION
converts NRM data in a measurements type file to
geographic and tilt corrected data in a specimens type file
SYNTAX
... | NAME
nrm_specimens_magic.py
Note: this program has been deprecated and is not maintained
DESCRIPTION
converts NRM data in a measurements type file to
geographic and tilt corrected data in a specimens type file
SYNTAX
nrm_specimens_magic.py [-h... | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/programs/deprecated/nrm_specimens_magic.py#L10-L154 |
PmagPy/PmagPy | dialogs/thellier_interpreter.py | thellier_auto_interpreter.run_interpreter | def run_interpreter(self):
"""
Run thellier_auto_interpreter
"""
import random
import copy
start_time = time.time()
#------------------------------------------------
# Clean work directory
#------------------------------------------------
... | python | def run_interpreter(self):
"""
Run thellier_auto_interpreter
"""
import random
import copy
start_time = time.time()
#------------------------------------------------
# Clean work directory
#------------------------------------------------
... | Run thellier_auto_interpreter | https://github.com/PmagPy/PmagPy/blob/c7984f8809bf40fe112e53dcc311a33293b62d0b/dialogs/thellier_interpreter.py#L54-L583 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.