Metadata-Version: 2.1
Name: MPLn23d
Version: 0.0.7
Summary: Measure features of second phases in microstructures of materilas
Author-email: Kenjiro Sugio <ksugio@hiroshima-u.ac.jp>
License: MIT License
        
        Copyright (c) 2024 Kenjiro Sugio
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/ksugio/MPLn23d
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Provides-Extra: dev
Requires-Dist: build ; extra == 'dev'
Requires-Dist: twine ; extra == 'dev'

# MPLn23d
Python library to measure the 2-dimensional local number (LN2D) and the 3-dimensional local number (LN3D).

# Install

```
> pip install MPImfp
```

# References
## class ln2d_new(nsmax)
+ nsmax : maximum number of section

### Methods :
#### add_gc(sid, x, y, r)
add gc (gravity center)
+ sid : section id
+ x, y : position of gc
+ r : radius

#### add_gc_random(sid, ngc, sd, r)
add gc randomly
+ sid : section id
+ ngc : number of gc
+ sd : standard deviation of random number, if sd <= 0.0 uniform random
+ r : radius

#### add_sec(step, sx, sy)
add section
+ step : allocation step of gc
+ sx : size of section in x direction
+ sy : size of section in y direction

#### area_fraction()
calculate area fraction

#### cut(step, ln3d, cid, dir, pos)
cut ln3d cell
+ step : allocation step of gc
+ ln3d : ln3d cell
+ cid : cell id
+ dir : direction of cut plane, x:0, y:1, z:2
+ pos : position of cut plane

#### cut_random(nsec, step, ln3d, cid)
cut ln3d cell randomly
+ nsec : number of sections
+ step : allocation step of gc
+ ln3d : ln3d cell
+ cid : cell id

#### measure_gc(f)
measure ln2d on gc
+ f : numpy dimension for result, dtype=np.uint32

#### measure_random(f, nsample)
measure ln2d on random point
+ f : numpy dimension for result, dtype=np.uint32
+ nsample : number of sample

### Data descriptors :
#### nsec
number of section

#### nsec_max
maximum number of section

#### seed
seed of random number (settable)

## class ln3d_new(ncmax)
+ ncmax : maximum number of cell

### Methods :
#### add_cell(step, sx, sy, sz)
add cell
+ step : allocation step of gc
+ sx : size of cell in x direction
+ sy : size of cell in y direction
+ sz : size of cell in z direction

#### add_gc(cid, x, y, z, r)
add gc (gravity center)
+ cid : cell id
+ x, y, z : position of gc
+ r : radius

#### add_gc_random(cid, ngc, sd, r)
add gc randomly
+ cid : cell id
+ ngc : number of gc
+ sd : standard deviation of random number, if sd <= 0.0 uniform random
+ r : radius

#### measure_gc(f)
measure ln3d on gc
+ f : numpy dimension for result, dtype=np.uint32

#### measure_random(f, nsample)
measure ln3d on random point
+ f : numpy dimension for result, dtype=np.uint32
+ nsample : number of sample

#### volume_fraction()
calculate volume fraction

### Data descriptors :
#### ncell
number of cell

#### ncell_max
maximum number of cell

#### seed
seed of random number (settable)
