PGDTools
In here is the main class PresolarGrains.
You can either load this class either by importing and defining it:
or by importing the pgd command directly:
Most functionality is available through the available subtools.
Main PresolarGrains class that handles the overall database stuff.
All sub functions and tools live in the sub_tools folder and are imported here.
PresolarGrains
Presolar grain database class.
This class is the main class to work with the presolar grain database.
Attention: Only SiC grains are currently supported!
Example:
from pgdtools import pgd pgd.filter.db(pgd.DataBase.SiC) pgd.filter.pgd_type("M") assert pgd.info.pgd_types == {"M"} pgd.reset() pgd.filter.ratio(("29Si", "28Si"), "<", -1000) assert pgd.info.number_of_grains == 0
Source code in pgdtools/pgdtools.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | |
data
property
Get data from the currently filtered database.
Returns:
| Type | Description |
|---|---|
Data
|
Data class. Example: todo |
filter
property
Filter the database for specific grains.
Various filters are implements, the examples below show some of the possibilities. Please consult the documentation for a full list of options.
Generally, all filter default to select the grains that are in the filter.
If you want to exclude grains, you can set the exclude parameter to True.
This will invert the selection.
Returns:
| Type | Description |
|---|---|
Filters
|
Filter class Example: todo |
format
property
info
property
Provide information for the currently filtered database.
Returns:
| Type | Description |
|---|---|
Info
|
Information class. Example: todo |
reference
property
Return the reference class initialized with current database.
Various routines are implemented, e.g., to return references for each grain as a table, or to return references as a set, which can be useful to ensure the original authors are cited when you use the database. For a quick overview, you can also simply print the reference representation of the grains.
Returns:
| Type | Description |
|---|---|
References
|
Reference class Example: todo |
technique
property
Return the technique class initialized with the current database
Various routines are implemented, e.g., to return technques for each grain as a table, or to return techniques as a set, which can be useful to ensure the original authors are cited when you use the database. For a quick overview, you can also simply print the technique representation of the grains.
Returns:
| Type | Description |
|---|---|
Techniques
|
Technique class Example: todo |
DataBase
Bases: Enum
Enum to represent the different databases.
The name of each enum is something that should make sense to the user, the value the 3 letter abbreviation that each PGD Grain Name starts with.
Source code in pgdtools/pgdtools.py
__eq__(other)
__init__()
Initialize the presolar grain class.
Load the default database into self.db and self._db as a backup.