jac2dat - Convert .jac/.jca files to various data formats
perl jac2dat.pl [jac_files ...] [--all] [--inp_encoding]
[--det=det_file] [--out_encoding]
[--out_fmts=ext ...] [--out_path=path]
[--out_prepend=flag] [--out_append=flag]
[--out_xl_first_row=int] [--out_xl_first_col=int]
[--out_xl_freeze_panes=cell] [--out_csv_xl_subheads]
[--noyn] [--nofm] [--nopause]
jac2dat converts .jac/.jca files to various data formats.
- JAC file: The gamma spectra format of MEXT (previously the Science and
Technology Agency), Japan. For details, refer to the catalogue
of DS-P1001 Gamma Station, SII.
A .jac/.jca file consists of only one column, in which
gamma counts are stored in ascending order of channels.
The first four records are "not" gamma counts, and
are used for special purposes:
- Record 1: Live time (duration)
- Record 2: Real time (duration)
- Record 3: Acquired time
- Record 4: Comment
- DAT file: A plain text file converted from a .jac/.jca file.
A .dat file consists of multiple columns, in which
channels, gamma energies, peak FWHMs, peak efficiencies,
counts, count per second (cps), gammas, and
gamma per second (gps) are stored.
- Other supported data formats include tex, csv, xlsx, json, and yaml.
jac_files ...
.jac/.jca files to be converted.
--all (short: -a)
All .jac/.jca files in the current working directory will be converted.
--inp_encoding (default: cp932)
Specify the encoding of .jac/.jca files to be converted.
Use one of the supported encodings listed in the following URL.
https://perldoc.perl.org/Encode::Supported#Supported-Encodings
Use cp932 for .jac/.jca files encoded in Shift JIS.
--detector=det_file (short: --det)
A file containing conversion functions of a detector
such as channel-to-energy and channel-to-FWHM functions.
Key-value pairs contained in this file take precedence
over the predefined functions.
Refer to the sample file 'detector.j2d' for the syntax.
--out_encoding (default: UTF-8)
Specify the encoding of converted files.
Use one of the supported encodings listed in the following URL.
https://perldoc.perl.org/Encode::Supported#Supported-Encodings
Use UTF-8 unless you specifically need a different encoding.
--out_fmts=ext ... (short: --fmts, default: dat)
Output formats. Multiple formats are separated by the comma (,).
all
All of the following ext's.
dat
Plain text
tex
LaTeX tabular environment
csv
comma-separated value
xlsx
Microsoft Excel 2007
json
JavaScript Object Notation
yaml
YAML
--out_path=path (short: --path, default: current working directory)
The output path.
--out_prepend=flag (short: --prep, default: empty)
A flag to be prepended to the names of output files.
--out_append=flag (short: --app, default: empty)
A flag to be appended to the names of output files.
--out_xl_first_row=int (default: 0)
The first row index (0-based) of an Excel output file.
--out_xl_first_col=int (default: 0)
The first column index (0-based) of an Excel output file.
--out_xl_freeze_panes=cell (default: B2)
The cell at which the panes will be frozen in an Excel output file.
--out_csv_xl_subheads
Divide the data headings into name and unit components
in .csv and .xlsx output files.
--noyn
Run the program without prompting a y/n selection message.
--nofm
Do not show the front matter at the beginning of the program.
--nopause
Do not pause the shell at the end of the program.
perl jac2dat.pl lt1200s.jac --fmts=dat,xlsx
perl jac2dat.pl ./samples/sample_rand.jac --det=./j2d/det_fitted.j2d
perl jac2dat.pl ./samples/sample_rand.jac --nopause
Perl 5
Text::CSV, Excel::Writer::XLSX, JSON, YAML
Jaewoong Jang <jangj@korea.ac.kr>
Copyright (c) 2019-2023 Jaewoong Jang
This software is available under the MIT license; the license information is found in 'LICENSE'.