pyflightstream.post.disc_maps (provisional)¶
Generated from the docstrings at build time: every one of the 8 names in the __all__ of pyflightstream.post.disc_maps has an entry below. The names a guide or an example uses come first; the others follow under Advanced.
The disc maps of a rotor point: sectional load by radius and azimuth.
Pipeline role: the post row, where recorded exports become products.
It tabulates the sectional load of a rotor over its disc, by radius and
azimuth, from the WRITTEN sections of the point: every blade at every
clocking of a quasi-steady wheel (sections/<point>_sections.csv),
or every blade at every step of the last complete revolution of an
unsteady_rotor point (series/<point>_sections_series.csv).
One CSV per rotor and quantity, sections/<point>_disc_<ROTOR>_<QUANTITY>.csv.
A row is one blade station at one sample: SAMPLE (the clocking or the
step), BLADE, AZIMUTH_DEG (where THAT blade is, 0 to 360, placed as
:func:pyflightstream.post.axes.placed_blade_azimuth_deg places it), the
station's radius STATION_R_M and, where the rotor's diameter is known,
R_OVER_R, and the load VALUE. Rows run by azimuth, then radius, so
the table is the disc read as a polar grid. No azimuth is computed here: every
angle is the table's own, or comes from :mod:pyflightstream.post.axes, the
one home of where a blade is.
The table is the product; no figure is drawn, because matplotlib is not a
dependency the post uses. The definitions page,
docs/post-processing-definitions.md, is the definition of record.
Advanced¶
pyflightstream.post.disc_maps.DISC_MAP_COLUMNS
module-attribute
¶
DISC_MAP_COLUMNS: tuple[str, ...] = (
POLAR_ID_COLUMN,
*CONTEXT_COLUMNS,
*_MAP_COLUMNS,
)
pyflightstream.post.disc_maps.DiscMaps
dataclass
¶
DiscMaps(
maps: dict[tuple[str, str], list[_Row]] = dict(),
samples: dict[str, int] = dict(),
skipped: dict[str, str] = dict(),
)
The disc maps of one table, and what could not be mapped, for the stage to say.
maps holds, for each (rotor, quantity), the rows
(rotor, quantity, sample, blade, azimuth, radius, r / R, value) by
azimuth then radius (a radius that is not a number is NaN and sorts last).
samples counts the blade samples of each rotor. skipped maps a
marker (#rotor=<alias>) to why the rotor has no map.
pyflightstream.post.disc_maps.disc_map_name
¶
disc_map_name(point: str, rotor: str, quantity: str) -> str
Return the file name of one rotor's and quantity's disc map.
Characters a file name should not carry are written _.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
point
|
str
|
The point's file stem. |
required |
rotor
|
str
|
The rotor's alias. |
required |
quantity
|
str
|
The mapped quantity. |
required |
Returns:
| Type | Description |
|---|---|
str
|
|
Examples:
>>> disc_map_name("DP_AL+000", "PROP", "Fz")
'DP_AL+000_disc_PROP_Fz.csv'
pyflightstream.post.disc_maps.disc_map_rows
¶
disc_map_rows(
columns: Sequence[str],
rows: Sequence[Mapping[str, str]],
rotors: Mapping[str, HarmonicRotor],
*,
sample_column: str,
) -> DiscMaps
Map every rotor of one written sections table over its disc.
rows are the table's rows as :func:~pyflightstream.post.products.read_csv_table
reads them, already cut to the samples wanted (an unsteady point's last
complete revolution); sample_column tells one sample from the next
(CLOCKING on a wheel, STEP on a series). A block is the consecutive
rows of one sample, family, plane and rotor; a block of one blade of a
rotor in rotors is a sample of that rotor at its blade's azimuth, and
each of its rows a station at the radius |Offset|. A row whose radius
or load is not a number keeps its place and states NA; a block that
states no azimuth, or that is no blade of the rotor, is not a sample.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
columns
|
sequence of str
|
The sections table's columns. |
required |
rows
|
sequence of mapping of str to str
|
The table's rows, cut to the samples wanted. |
required |
rotors
|
mapping of str to HarmonicRotor
|
The rotors to map, by alias. |
required |
sample_column
|
str
|
The column that tells one sample from the next. |
required |
Returns:
| Type | Description |
|---|---|
DiscMaps
|
The maps by rotor and quantity, the sample counts and what could not be mapped. |
pyflightstream.post.disc_maps.write_disc_map
¶
write_disc_map(
sections: str | Path,
rotors: Mapping[str, HarmonicRotor],
*,
sample_column: str,
out_dir: str | Path | None = None,
point: str | None = None,
windows: Mapping[str, tuple[int, int]] | None = None,
overwrite: bool = True,
) -> tuple[Path, ...]
Write the disc maps of a written sections table, one CSV per rotor and quantity.
A series (sample_column="STEP") is mapped over ONE revolution of each
rotor, as the campaign does: windows gives, by rotor alias, the first and
last step of that revolution (:func:pyflightstream.post.harmonics.last_complete_revolution),
and rows of a rotor with no window, or outside it, are not mapped.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sections
|
str or Path
|
A written sections table of a rotor point: a quasi-steady wheel's
( |
required |
rotors
|
mapping of str to HarmonicRotor
|
The rotors to map, each with its blades' section families. |
required |
sample_column
|
str
|
The column that tells one sample from the next. |
required |
out_dir
|
str or Path
|
Where the maps are written; the table's own folder where not given. |
None
|
point
|
str
|
The point's name in the file names; the table's stem, less a trailing
|
None
|
windows
|
mapping of str to tuple of (int, int)
|
The steps of the revolution to map, by rotor alias; required for a
|
None
|
overwrite
|
bool
|
Replace a file that already exists, as the writer always did (the default). False refuses an existing file, naming it, before it is replaced. |
True
|
Returns:
| Type | Description |
|---|---|
tuple of Path
|
The files written, sorted by rotor and quantity. |
Raises:
| Type | Description |
|---|---|
ProductError
|
The table cannot be read, a |
pyflightstream.post.disc_maps.write_disc_maps
¶
write_disc_maps(
rows_of: DiscMaps,
*,
point: str,
pol: str,
context: Sequence[object],
out_dir: str | Path,
target: Callable[[Path], Path] | None = None,
overwrite: bool = True,
) -> tuple[Path, ...]
Write one CSV per rotor and quantity of rows_of in out_dir, and return the paths.
The header is POL, the condition, then the map's own columns; a radius
that is not a number is written NA. target, where given, maps each
path to the one written (the stage's guard against replacing a product).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rows_of
|
DiscMaps
|
The maps of :func: |
required |
point
|
str
|
The point's file stem. |
required |
pol
|
str
|
The polar the point belongs to, written as |
required |
context
|
sequence of object
|
The point's condition values, written after |
required |
out_dir
|
str or Path
|
The folder the maps are written into. |
required |
target
|
callable
|
Maps each path to the one written. |
None
|
overwrite
|
bool
|
Replace a file that already exists, as the writer always did (the default). False refuses an existing file, naming it, before it is replaced. |
True
|
Returns:
| Type | Description |
|---|---|
tuple of Path
|
The written maps. |
Raises:
| Type | Description |
|---|---|
ProductError
|
If two rotors' maps would be written to one file name. |