Skip to content

src/core/methodsText.js ​

text
"How to cite and report": a methods paragraph for a paper, written from a session document (docs/FORMAT.md), and
the BibTeX of exactly the references that session's model components need. Pure functions: no DOM, no I/O.

  import { methodsParagraph } from './core/methodsText.js';
  const { text, bibtex, keys, notes } = methodsParagraph(session, { ldSource, sliceUsed });

Every sentence states something the session records (which data entered the fit, the limb-darkening law and where
its coefficients came from, what was free with which prior, the sampler settings and its outcome) or something the
code always does (how the baseline and the zero points are treated, which interval is quoted). Nothing is claimed
about the user's data that the session does not say; `notes` lists what the author must add or check by hand.
The text is a draft to adapt, in the past tense, with citation keys in square brackets ([claret2000]) that match
the BibTeX entries.

The bibliography is the one of the Methods page, methods and validation alike (src/validation/refs.js, pure data).

Import: import { … } from './src/core/methodsText.js' — no DOM, runs in Node and the browser.

SOFTWARE_KEY ​

js
const SOFTWARE_KEY

No description in the source.

bibtexAuthors ​

js
function bibtexAuthors(authors)
text
"Agol, E., Luger, R. & Foreman-Mackey, D." -> "Agol, E. and Luger, R. and Foreman-Mackey, D." (collaborations in braces, "et al." -> "and others").

bibtexEntry ​

js
function bibtexEntry(key, opts = {})

One BibTeX entry for a key of REFS, or for the software itself (SOFTWARE_KEY; opts.version, opts.year).

bibtexFor ​

js
function bibtexFor(keys, opts = {})

BibTeX for a list of keys (in the order given, duplicates dropped).

allBibtex ​

js
function allBibtex(opts = {})

Every reference of the project, the software first (docs/references.bib).

methodsParagraph ​

js
function methodsParagraph(session, opts = {})
text
A methods paragraph for the analysis a session describes.

session   an esl-session document; with `result` the outcome of the run is reported as well.
opts.ldSource   where star-tied limb darkening came from, as the analyzer records it for a run (S.fit.ldSource):
                'grey atmosphere' or the name of the model-atmosphere table. Only used when limb_darkening.mode is "star".
opts.sliceUsed  true when the run drew points by slice sampling (res.sampling.sliceIter > 0).
opts.year       year printed in the software's BibTeX entry (default: the year of session.created).

Returns { text, bibtex, keys, notes }: the paragraph (plain text, citation keys in square brackets), the BibTeX of
exactly those keys (the software first), the keys, and a list of things the author still has to state or check.

MIT licensed · Kyle A. Pearson