Exemple #1
0
def major_elements():
    oxides = app.config.get("OXIDES")

    data = whole_rock_major_elements()

    template = tex_renderer.get_template(argv[1])
    text = template.render(
        oxides=oxides,
        samples=data)
    write_file(argv[2], text)
Exemple #2
0
def mineral_compositions():
    """
    Creates a table of the average composition of
    each of the mineral components in each Xenolith sample.
    Could potentially be combined with modal abundance
    data, but might not be best.
    """
    oxides = app.config.get("OXIDES")

    text = (tex_renderer.get_template(argv[1]).render(
        ncols=len(oxides) + 5,
        oxides=oxides,
        samples=xenolith_minerals("weight")))
    write_file(argv[2], text)
def create_table():
    data = sims_data(whole_rock=True)
    elements = data.index.get_level_values('symbol').unique()

    data = element_data(data, columns='symbol')

    d = data.reset_index()
    min_data = {
        k: d[d['mineral'] == k].iterrows()
        for k in ('opx', 'cpx', 'whole_rock')
    }

    text = (tex_renderer.get_template("trace-elements.tex").render(
        ncols=len(elements) + 2, elements=elements, **min_data))
    write_file("build/trace-elements.tex", text)
import numpy as N
from uncertainties import ufloat
from figurator import tex_renderer, write_file
from xenoliths import app
from data import ree_data, summary_data

template = tex_renderer.get_template("temperature.tex")

with app.app_context():
    text = template.render(samples=summary_data())
    write_file("build/temperatures.tex", text)
redo_ifchange(table_data)


def build_data():
    data = DataFrame.from_csv(table_data, sep='\t')
    for id, row in data.iterrows():
        d = row.to_dict()
        d['id'] = id

        T = 1.65 * 1e6  # years
        d['143Nd/144Nd(T)'] = sample_nd_ratio(row, T)
        d['87Sr/86Sr(T)'] = sample_sr_ratio(row, T)
        d['deltaNd'] = (d['143Nd/144Nd(T)'] - d['143Nd/144Nd(0)']) * 1e6
        d['deltaSr'] = (d['87Sr/86Sr(T)'] - d['87Sr/86Sr(0)']) * 1e7

        d["T_CHUR"] = round(T_CHUR(row, T), 2)

        for i, s in [('143Nd/144Nd(0)', 'std err%'),
                     ('87Sr/86Sr(0)', 'std err%.1')]:
            s = d.pop(s)
            d[i] = ufloat(d[i], s / 100 * d[i])
        d.pop('Sm/Nd')
        d.pop('Rb/Sr')

        yield d


text = (tex_renderer.get_template("isotopes.tex").render(samples=build_data()))

write_file(argv[1], text)
from __future__ import division, print_function

from sys import argv
from depletion_model import depletion_degrees
from figurator import tex_renderer, write_file

sample_data = depletion_degrees()

text = (tex_renderer.get_template("depletion_degrees.tex").render(
    samples=sample_data))

write_file(argv[2], text)