|
22 | 22 | __copyright__ = 'Copyright (c) 2023 Mathieu Daëron' |
23 | 23 | __license__ = 'Modified BSD License - https://opensource.org/licenses/BSD-3-Clause' |
24 | 24 | __date__ = '2023-07-20' |
25 | | -__version__ = '2.2.0' |
| 25 | +__version__ = '2.2.1' |
26 | 26 |
|
27 | 27 | import os |
28 | 28 | import numpy as np |
@@ -3249,6 +3249,7 @@ def _cli( |
3249 | 3249 | exclude: Annotated[str, typer.Option('--exclude', '-e', help = 'The path of a file specifying UIDs and/or Samples to exclude')] = 'none', |
3250 | 3250 | anchors: Annotated[str, typer.Option('--anchors', '-a', help = 'The path of a file specifying custom anchors')] = 'none', |
3251 | 3251 | output_dir: Annotated[str, typer.Option('--output-dir', '-o', help = 'Specify the output directory')] = 'output', |
| 3252 | + run_D48: Annotated[bool, typer.Option('--D48', help = 'Also standardize D48')] = False, |
3252 | 3253 | ): |
3253 | 3254 | """ |
3254 | 3255 | Process raw D47 data and return standardized results. |
@@ -3290,13 +3291,51 @@ def _cli( |
3290 | 3291 | data.crunch() |
3291 | 3292 | data.standardize() |
3292 | 3293 | data.summary(dir = output_dir) |
3293 | | - data.table_of_samples(dir = output_dir) |
3294 | | - data.table_of_sessions(dir = output_dir) |
3295 | | - data.plot_sessions(dir = output_dir) |
3296 | 3294 | data.plot_residuals(dir = output_dir, filename = 'D47_residuals.pdf', kde = True) |
3297 | | - data.table_of_analyses(dir = output_dir) |
3298 | | - data.plot_distribution_of_analyses(dir = output_dir) |
3299 | 3295 | data.plot_bulk_compositions(dir = output_dir + '/bulk_compositions') |
| 3296 | + data.plot_sessions(dir = output_dir) |
| 3297 | + |
| 3298 | + if not run_D48: |
| 3299 | + data.table_of_samples(dir = output_dir) |
| 3300 | + data.table_of_analyses(dir = output_dir) |
| 3301 | + data.table_of_sessions(dir = output_dir) |
| 3302 | + |
| 3303 | + |
| 3304 | + if run_D48: |
| 3305 | + data2 = D48data() |
| 3306 | + data2.read(rawdata) |
| 3307 | + |
| 3308 | + data2 = D48data([r for r in data2 if r['UID'] not in exclude_uid and r['Sample'] not in exclude_sample]) |
3300 | 3309 |
|
| 3310 | + if anchors != 'none': |
| 3311 | + data2.Nominal_d13C_VPDB = { |
| 3312 | + _['Sample']: _['d13C_VPDB'] |
| 3313 | + for _ in anchors |
| 3314 | + if 'd13C_VPDB' in _ |
| 3315 | + } |
| 3316 | + data2.Nominal_d18O_VPDB = { |
| 3317 | + _['Sample']: _['d18O_VPDB'] |
| 3318 | + for _ in anchors |
| 3319 | + if 'd18O_VPDB' in _ |
| 3320 | + } |
| 3321 | + data2.Nominal_D4x = { |
| 3322 | + _['Sample']: _['D48'] |
| 3323 | + for _ in anchors |
| 3324 | + if 'D48' in _ |
| 3325 | + } |
| 3326 | + |
| 3327 | + data2.refresh() |
| 3328 | + data2.wg() |
| 3329 | + data2.crunch() |
| 3330 | + data2.standardize() |
| 3331 | + data2.summary(dir = output_dir) |
| 3332 | + data2.plot_sessions(dir = output_dir) |
| 3333 | + data2.plot_residuals(dir = output_dir, filename = 'D48_residuals.pdf', kde = True) |
| 3334 | + data2.plot_distribution_of_analyses(dir = output_dir) |
| 3335 | + |
| 3336 | + table_of_analyses(data, data2, dir = output_dir) |
| 3337 | + table_of_samples(data, data2, dir = output_dir) |
| 3338 | + table_of_sessions(data, data2, dir = output_dir) |
| 3339 | + |
3301 | 3340 | def __cli(): |
3302 | 3341 | _app() |
0 commit comments