qharv.refine package

Submodules

qharv.refine.scalar module

qharv.refine.scalar.mean_error_text(texts)[source]

convert strings such as 1.23(1) to data such as 1.23 +/- 0.01 i.e. inverse of text_mean_error

Parameters

texts (np.array) – an array of texts

Returns

(ym, ye), (mean, error)

Return type

(np.array, np.array)

qharv.refine.scalar.text_df(df, obsl, **kwargs)[source]

write a subset of df into readable text

for each observable in obsl, there must be a mean and an error column associated with it. The column names must be obs+’_mean’ and obs+’_error’

Parameters
  • df (pd.DataFrame) – database of Monte-Carlo data with *_mean and *_error

  • obsl (array-like) – list of observable names

qharv.refine.scalar.text_df_obs_exobs(df, obsl, exobsl, **kwargs)[source]

construct text dataframe

assume obsl have associated _mean and _error columns.

Parameters
  • df (pd.DataFrame) – scalar database

  • obsl (list) – a list of observable names, each with _mean and _error

  • exobsl (list) – a list of exact observable names

Returns

text database

Return type

pd.DataFrame

qharv.refine.scalar.text_mean_error(ym, ye, nshow=1, mndig=8)[source]

convert data such as 1.23 +/- 0.01 to strings such as 1.23(1)

Parameters
  • ym (np.array) – mean

  • ye (np.array) – error

Returns

an array of strings

Return type

np.array

Module contents