NUCDENS
Library for online accessing, reading and writing Compton densities.
When using the data files or software, please cite the original work:
H.~W.~Griesshammer, J.~A.~McGovern, A.~Nogga and D.~R.~Phillips, ``Scattering Observables from One- and Two-Body Densities: Formalism and Application to $\gamma,{}^3$He Scattering,'' Few Body Syst. \textbf{61} (2020) no.4, 48 doi:10.1007/s00601-020-01578-w [arXiv:2005.12207 [nucl-th]].
Installation
The source code and examples are available at https://jugit.fz-juelich.de/a.nogga/nucdensity.
The easiest way to install is using git clone and pip:
git clone git clone https://jugit.fz-juelich.de/a.nogga/nucdensity.git
cd nucdensity
pip install -e .
Usage
The package provides an interface to download the data files from our repository and to read the files and test. More advanced options will be documented later. Jupyter notebook testing the access can be found in tests. Some examples are in examples.
For downloading specific files to a local directory, e.g., $HOME/work/denstest use
from nucdens import access
testdf=access.database(workdir=os.environ["HOME"]+"/work/denstest")
This downloads a pandas dataframe with the available density files and stores it into testdf . The pandas dataframe can be printed using
import pandas as pd
pd.set_option('display.max_columns', None)
print(testdf.pddf)
Downloading density files of, e.g., row 36 and 4 of the table is done by
import os
# get file info from table
row=testdf.pddf.loc[[36]]
densid=row.to_dict('records')[0]
# retrieve file
hashname,uniquename=testdf.get_file(**densid)
# print name and file size
print("hashname: ",hashname)
print("filesize: ",os.path.getsize(hashname))
print("uniquename: ",uniquename)
The files are downloaded and gunzipped. They are partly also compressed using the ZFP compressors (see https://github.com/LLNL/zfp). Using the files might require to install the corresponding HDF plugins (https://github.com/LLNL/H5Z-ZFP). The local files will be first stored under their hashname. However, the python method also returns a suggestion for a unique file name uniquename that includes the parameters of the file. If wanted, users may rename the file using the provided uniquename.
The file from the example is two-body density. You can read in and get some basic properties using the densfile2b constructor
density2b=access.densfile2b(hashname,printlevel=1)
One-body densities can be tested similarly using the densfile1b constructor
density1b=access.densfile1b(hashname,printlevel=1)
Metadata
Release files for nucdens 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nucdens-1.2.0.tar.gz | 8.1 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nucdens-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.1 MB
Release files / nucdens-1.2.0.tar.gz
| Download URL | nucdens-1.2.0.tar.gz |
|---|---|
| Size | 8.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8614052eb10ab7c8ddf2616044aec24ed23d4a0b2f99a72c7fbabc23cd46fa46
|
|
BLAKE2b-256 checksum How to use checksums |
f7015908a8bacf2bb5dbf8069bde483b2c016b983ab29d4a5c8da19e2e9f54b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / nucdens-1.2.0-py3-none-any.whl
| Download URL | nucdens-1.2.0-py3-none-any.whl |
|---|---|
| Size | 24.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
09411a06ad8b0a75953b00ec8bd9f2479d1cd5519a6386cad9c5d6efbe145948
|
|
BLAKE2b-256 checksum How to use checksums |
950633acff6c87559abef9ccc11693d8007e009dbd2b6e78ee0d2a2ff10bd192
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|