smart_lorentz_gauss 2.0.3

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new50

Smart Lorentz Gauss #

What the package can do for you #

This package provides functionalities to compute an n-dimensional mixed Lorentz-Gauss line shape, also called an n-dimensional Pseudo-Voigt function. Typically such functions occur in spectroscopic data originating from electro-magnetic radiation. The function can for example be used for fitting or deconvolution of such data, or for simulating (computing) spectra, i.e. as a superposition of several shapes with different parameters.

The major API functionalities #

  • class LorentzGauss

This example constructs a LorentzGauss shape with the given height, center, width, and Gaussian fraction.

LorentzGauss lg = new LorentzGauss.fromPars(height, [center], [width], [0.2]);

This example would compute the value of the above shape value at position x.

double val = lg.getValueAt(x]);

Detailed API #

Please view the detailed API documentation in the API reference of this package (sidebar at the right of this page).

Using this package #

You need Dart 2.0 or later.

Import the package using:

  • import 'package:smart_arrays_peaks/smart_arrays.dart_peaks';

smart_arrays_base: Basic functions for 1D and 2D arrays

smart_arrays_compress: Compress 1D and 2D arrays to a smaller size

smart_arrays_peaks: Pick peaks in 1D and 2D arrays.

Smart Lorentz Gauss #

Version history #

2.0.0 - 2019-03-14 First version available on pub site

2.0.1 - 2019-03-14 Minor doc changes

2.0.2 - 2019-03-14 Minor doc changes

2.0.3 - 2019-03-15 Description updates

example/example.dart

// Copyright (c) 2019, Dr. Bruno Guigas. All rights reserved. Use of this source
// code is governed by a BSD-style license that can be found in the LICENSE file.
import 'package:smart_lorentz_gauss/smart_lorentz_gauss.dart';
import 'dart:typed_data';

/// Creates an array containing a mixed Lorentz-Gauss line shape.
main() {
  final int NPOINTS = 100; // array length
  double height = 100; // value of line shape maximum
  double center = 40; // the maximum should be at this position
  double width = 10; // width of shape at half height of maximum
  Float64List array = Float64List(NPOINTS); // create array

  // construct a line shape with 80% Lorentzian and 20% Gaussian fractions
  LorentzGauss lg = new LorentzGauss.fromPars(height, [center], [width], [0.2]);

  // fill array with line shape values
  for (int k = 0; k < NPOINTS; k++) {
    array[k] = lg.getValueAt([k.toDouble()]);
  }

  // print result: you may paste the result to a MS Excel, OpenOffice Calc or so
  // to view the shape.
  for (int k = 0; k < NPOINTS; k++) {
    print("$k ${array[k].toStringAsFixed(2)}");
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  smart_lorentz_gauss: ^2.0.3

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:smart_lorentz_gauss/smart_lorentz_gauss.dart';
  
Version Uploaded Documentation Archive
2.0.3 Mar 15, 2019 Go to the documentation of smart_lorentz_gauss 2.0.3 Download smart_lorentz_gauss 2.0.3 archive
2.0.2 Mar 14, 2019 Go to the documentation of smart_lorentz_gauss 2.0.2 Download smart_lorentz_gauss 2.0.2 archive
2.0.1 Mar 14, 2019 Go to the documentation of smart_lorentz_gauss 2.0.1 Download smart_lorentz_gauss 2.0.1 archive
2.0.0 Mar 14, 2019 Go to the documentation of smart_lorentz_gauss 2.0.0 Download smart_lorentz_gauss 2.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

We analyzed this package on Mar 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:smart_lorentz_gauss/smart_lorentz_gauss.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
build_runner ^1.1.2 1.2.8
build_web_compilers ^1.0.0 1.2.0
pedantic ^1.5.0 1.5.0
Transitive dependencies
analyzer 0.35.3
archive 2.0.8
args 1.5.1
async 2.0.8
bazel_worker 0.1.20
build 1.1.1
build_config 0.3.1+4
build_daemon 0.4.2
build_modules 1.0.9
build_resolvers 1.0.3
build_runner_core 2.0.3
built_collection 4.1.0
built_value 6.3.2
charcode 1.1.2
code_builder 3.2.0
collection 1.14.11
convert 2.1.1
crypto 2.0.6
csslib 0.14.6
dart_style 1.2.4
fixnum 0.10.9
front_end 0.1.13
glob 1.1.7
graphs 0.2.0
html 0.13.4+1
http 0.12.0+1
http_multi_server 2.0.5
http_parser 3.1.3
io 0.3.3
js 0.6.1+1
json_annotation 2.0.0
kernel 0.3.13
logging 0.11.3+2
matcher 0.12.4
meta 1.1.7
mime 0.9.6+2
package_config 1.0.5
package_resolver 1.0.10
path 1.6.2
plugin 0.2.0+3
pool 1.4.0
protobuf 0.13.4
pub_semver 1.4.2
pubspec_parse 0.1.4
quiver 2.0.1
scratch_space 0.0.3+2
shelf 0.7.4
shelf_web_socket 0.2.2+4
source_maps 0.10.8
source_span 1.5.5
stack_trace 1.9.3
stream_channel 1.6.8
stream_transform 0.0.16+1
string_scanner 1.0.4
term_glyph 1.1.0
timing 0.1.1+1
typed_data 1.1.6
utf 0.9.0+5
watcher 0.9.7+10
web_socket_channel 1.0.9
yaml 2.1.15