flightcondition


Nameflightcondition JSON
Version 24.6.22 PyPI version JSON
download
home_pagehttps://github.com/MattCJones/flightcondition
SummaryAirspeed conversions (true/calibrated/equivalent/Mach),
upload_time2024-06-22 23:05:41
maintainerNone
docs_urlNone
authorMatthew C. Jones
requires_python>=3.8
licenseMIT License
keywords utility aerospace engineering design
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Flight Condition

## About

Airspeed conversions (true/calibrated/equivalent/Mach), atmospheric data, and
more with built-in unit checking.  Specific sub-modules include:

* `flightcondition`: input altitude to compute common flight condition data.
  Easily swap between true airspeed, calibrated airspeed, equivalent airspeed,
  and Mach number.  Includes atmospheric data.
* `atmosphere`: input altitude to compute atmospheric
  data.  Many relevant, derived quantities are included. The upper limit is
  86 km for the 
  [1993 International Standard Atmosphere](
  https://en.wikipedia.org/wiki/International_Standard_Atmosphere) model and
  10,000 kilometers for the [NRL MSIS](
  https://en.wikipedia.org/wiki/International_Standard_Atmosphere) model.
* `units`: built-in unit-checking and conversion using the
  [pint](https://pint.readthedocs.io) package.

See the web application here: [https://flightcondition.streamlit.app](
https://flightcondition.streamlit.app/)

![Flight Condition Demo](
https://github.com/MattCJones/videos/blob/main/flightcondition/flightcondition_demo.gif
)

## Author

Matthew C. Jones [matt.c.jones.aoe@gmail.com](matt.c.jones.aoe@gmail.com)

## Installation

### Install Commands

Install using the `pip` package-management system. The
easiest method is to open the terminal and run:

```python
pip install flightcondition
```

Alternatively, manually download the
[source code](https://github.com/MattCJones/flightcondition), unpack, and run:

```python
pip install <path/to/flightcondition>
```

### Dependencies

-   [numpy](https://numpy.org): package for scientific computing.
-   [pint](https://pint.readthedocs.io): package for dealing with units.
-   [pymsis](https://swxtrec.github.io/pymsis/index.html): package for NRL MSIS
    atmospheric model.

## Usage

Import all utilities with,

```python
from flightcondition import *
```

or more explicitly as shown in the following examples.

### Flight Condition

The `FlightCondition` class is used to compute and interact with common flight
condition data. Inputs include altitude, velocity in some format, and an
optional length scale.

#### Input Arguments
Input arguments include:

1.  **Altitude**: `h` (aliases include: `alt`, `altitude`)
2.  **Velocity** (pick one):
    -   *True airspeed*: `TAS` (aliases include: `tas`, `true_airspeed`,
        `U_inf`, `V_inf`)
    -   *Calibrated airspeed*: `CAS` (aliases include: `cas`,
        `calibrated_airspeed`)
    -   *Equivalent airspeed*: `EAS` (aliases include: `eas`,
        `equivalent_airspeed`)
    -   *Mach number*: `M` (aliases include: `mach`, `Mach`, `M_inf`,
        `mach_number`)
3.  **Length-scale** (optional): `L` (aliases include: `ell`, `bylen`,
    `length`, `length_scale`, `l`)

Input quantities must be dimensionalized - see the usage below.  Alternatively
use `KTAS`, `KCAS`, or `KEAS` for convenience.  For example, `KCAS=233`
is equivalent to `CAS=233*unit('knots')`.

#### Output Quantities

The following tables list the quantities and the variables used to access them.
Quantities may be accessed by either (a) their abbreviated variable, e.g.
`.TAS`, or (b) by their full names, e.g.  `byname.true_airspeed`. They
may also be accessed through their particular sub-category: `byalt`, `byvel`,
or `bylen`, e.g.  `.byvel.TAS` or `.byvel.byname.true_airspeed`.

| Altitude Quantity     | Variable | Full Name (via `.byname.`) |
|-----------------------|----------|----------------------------|
| Geometric altitude    | `h`      | `geometric_altitude`       |
| Geopotential altitude | `H`      | `geopotential_altitude`    |
| Pressure              | `p`      | `pressure`                 |
| Temperature           | `T`      | `temperature`              |
| Density               | `rho`    | `density`                  |
| Sound speed           | `a`      | `sounds_speed`             |
| Dynamic viscosity     | `mu`     | `dynamic_viscosity`        |
| Kinematic viscosity   | `nu`     | `kinematic_viscosity`      |
| Thermal conductivity  | `k`      | `thermal_conductivity`     |
| Gravity               | `g`      | `gravity`                  |
| Mean free path        | `MFP`    | `mean_free_path`           |

| Velocity Quantity                | Name      | Full Name (via `.byname.`)       |
|----------------------------------|-----------|----------------------------------|
| True airspeed (TAS)              | `TAS`     | `true_airspeed`                  |
| Calibrated airspeed (CAS)        | `CAS`     | `calibrated_airspeed`            |
| Equivalent airspeed (EAS)        | `EAS`     | `equivalent_airspeed`            |
| Mach number                      | `M`       | `mach_number`                    |
| Mach angle                       | `mu_M`    | `mach_angle`                     |
| Dynamic pressure                 | `q_inf`   | `dynamic_pressure`               |
| Impact pressure                  | `q_c`     | `impact_pressure`                |
| Stagnation pressure              | `p0`      | `stagnation_pressure`            |
| Stagnation temperature           | `T0`      | `stagnation_temperature`         |
| Recovery temperature (laminar)   | `Tr_lamr` | `recovery_temperature_laminar`   |
| Recovery temperature (turbulent) | `Tr_turb` | `recovery_temperature_turbulent` |
| Reynolds number per unit length  | `Re_by_L` | `recovery_temperature_turbulent` |

| Length-Scale Quantity                            | Name        | Full Name (via `.byname.`)       |
|--------------------------------------------------|-------------|----------------------------------|
| Length scale                                     | `L`         | `length_scale`                   |
| Reynolds number                                  | `Re`        | `reynolds_number`                |
| Boundary layer thickness (laminar)               | `h_BL_lamr` | `boundary_thickness_laminar`     |
| Boundary layer thickness (turbulent)             | `h_BL_turb` | `boundary_thickness_turbulent`   |
| Flat plate skin friction coefficient (laminar)   | `Cf_lamr`   | `friction_coefficient_laminar`   |
| Flat plate skin friction coefficient (turbulent) | `Cf_turb`   | `friction_coefficient_turbulent` |

#### Example Usage

```python
from flightcondition import FlightCondition, unit

# Compute flight condition at 3 km, Mach 0.5
fc = FlightCondition(h=3*unit('km'), M=0.5)

# Uncomment to print summary of flight condition quantities:
#print(f"{fc}")

# Uncomment to print abbreviated output in US units:
#print(f"\n{fc.tostring(full_output=False, units="US")}")

# Convert true, calibrated, equivalent airspeeds
KTAS = fc.TAS.to('knots')
KCAS = fc.CAS.to('knots')
KEAS = fc.EAS.to('knots')
print(f"Flying at {KTAS.magnitude:.4g} KTAS,"
      f" which is {KCAS.magnitude:.4g} KCAS,"
      f" or {KEAS.magnitude:.4g} KEAS")
# >>> Flying at 319.4 KTAS, which is 277.7 KCAS, or 275.1 KEAS

# Access atmospheric data (see Atmosphere class for more)
h, p, T, rho, nu, a = fc.h, fc.p, fc.T, fc.rho, fc.nu, fc.a
print(f"The ambient temperature at {h.to('km'):.4g} is {T:.4g}")
# >>> The ambient temperature at 3 km is 268.7 K

# Change airspeed to 300 KEAS and altitude to 12 kft
fc.EAS = 300 * unit('knots')
fc.h = 12 * unit('kft')
#print(f"{fc}")  # uncomment to print output

# Recompute for a range of altitudes at 275.14 knots-equivalent
# airspeed with a characteristic length scale of 10 meters
fc = FlightCondition(h=[0, 9.8425, 20]*unit('kft'),
                    EAS=275.14*unit('kt'),
                    L=10*unit('m'))

# Compute additional derived quantities - explore the class for more!
print(f"\nThe dynamic pressure in psi is {fc.q_inf.to('psi'):.3g}")
# >>> The dynamic pressure in psi is [1.78 1.78 1.78] psi
print(f"The Reynolds number is {fc.Re:.3g}")
# >>> The Reynolds number is [9.69e+07 8.82e+07 7.95e+07]
h_yplus100 = fc.wall_distance_from_yplus(100)
print(f"The wall distance where y+=100 is {h_yplus100.to('in'):.3g}")
# >>> The wall distance where y+=100 is [0.0126 0.0138 0.0153] in

# Alternatively access quantities by their full name
print(fc.TAS == fc.byname.true_airspeed)
# >>> [ True  True  True]

# Or by their sub-categories: `byalt`, `byvel`, or `bylen`
print(fc.byvel.TAS == fc.byvel.byname.true_airspeed)
# >>> [ True  True  True]
```

### Atmosphere

The `Atmosphere` class can be used to compute and interact with common standard
atmosphere data and derived quantities.  See the list of output quantities in
the `FlightCondition` documentation above.
See also `layer` for layer properties such as `layer.name` for the layer name.

Note that all `Atmosphere` properties can be accessed through the
`FlightCondition` class, however, this class stands on its own if the
additional velocity and length-scale quantities are not desired.

#### Input Arguments
The input argument is geometric altitude `h`.  Aliases include `alt` and
`altitude`.  Note that these geometric altitude must be input as dimensional
length quantities - see the usage below.  Alternatively input
un-dimensionalized numbers using `h_kft` or `h_km` for kilofeet and kilometers
respectively.

#### Example Usage

```python
from flightcondition import Atmosphere, unit

# Compute atmospheric data for a scalar or array of altitudes
h = [0.0, 44.2, 81.0] * unit('km')
atm = Atmosphere(h)

# Uncomment to print all atmospheric quantities:
#print(f"\n{atm}")

# Uncomment to print while specifying abbreviated output in US units:
#print(f"\n{atm.tostring(full_output=False, units="US")}")

# See also the linspace() function from numpy, e.g.
# h = linspace(0, 81.0, 82) * unit('km')

# Access individual properties and convert to desired units: "
p, T, rho, nu, a, k = atm.p, atm.T, atm.rho, atm.nu, atm.a, atm.k
print(f"\nThe pressure in psi is {p.to('psi'):.3g}")
# >>> The pressure in psi is [14.7 0.024 0.000129] psi

# Compute additional properties such as mean free path
# Explore the class data structure for all options
print( f"\nThe mean free path = {atm.MFP:.3g}")
# >>> The mean free path = [7.25e-08 4.04e-05 0.00564] yd
```

### Units

Conveniently input, output, and convert units using
[pint](https://pint.readthedocs.io) units.

```python
from flightcondition import unit, printv

h = 33 * unit('km')
print(h.to('kft'))
# >>> 108.26771653543307 kft
printv(h, to='kft')
# >>> h = 108.27 kft

U_inf = 20 * unit('knots')
rho_inf = 1.225 * unit('kg/m^3')
q_inf = 0.5*rho_inf*U_inf**2
printv(q_inf, to='psi')
# >>> q_inf = 0.0094042 psi
```

Note that [pint](https://pint.readthedocs.io) does not support conflicting unit
registries so avoid interactions between `flightcondition.unit` and a separate
`pint.UnitRegistry`.

### Command Line Interface

A command line interface (CLI) is included for convenience but with limited
functionality. Run `flightcondition -h` for help.

An example call is given for the flight condition of 233
knots-equivalent-airspeed at 23 kilofeet with a length scale of 4 feet and
abbreviated output:

```bash
flightcondition --h 23 kft --EAS 233 knots --L 4 ft --no-full-output
```

```bash
===========================================================
   Flight Condition (units=US, full_output=False)
===========================================================
------------------  Altitude Quantities  ------------------
geometric_altitude  h       = 23 kft
pressure            p       = 857.25 lbf/ft²
temperature         T       = 436.74 °R
density             rho     = 1.1435×10⁻³ slug/ft³
sound_speed         a       = 1024.5 ft/s
kinematic_viscosity nu      = 2.8509×10⁻⁴ ft²/s
------------------  Velocity Quantities  ------------------
mach_number         M       = 0.55344
true_airspeed       TAS     = 335.93 kt
calibrated_airspeed CAS     = 238.14 kt
equivalent_airspeed EAS     = 233 kt
reynolds_per_length Re_by_L = 1.6573×10⁵ 1/in
------------------   Length Quantities   ------------------
length_scale        L       = 4 ft
reynolds_number     Re      = 7.9551×10⁶
```

Alternatively use the `--KEAS 233` syntactic sugar to omit the `knots` unit.
See also `--KTAS` and `--KCAS`.

## Web Application
See the web application here: [https://flightcondition.streamlit.app](
https://flightcondition.streamlit.app/)

## Assumptions

-   When using `model=standard`, Atmospheric quantities follow the
    [1993 International Standard Atmosphere](
    https://en.wikipedia.org/wiki/NRLMSISE-00) model.
-   When using `model=msis`, atmospheric quantities follow the [NRL MSIS](
    https://en.wikipedia.org/wiki/International_Standard_Atmosphere) model.
    Note that `model=msis` is automatically enabled for altitudes higher than
    80 kilometers.
-   Velocity computations include varying degrees of the following assumptions.
    Note that several assumptions break down for hypersonic flow.
    -   Continuum flow (mean free path is much smaller than the characteristic
        length scale)
    -   Ideal gas
    -   Thermally perfect gas
    -   Calorically perfect gas
    -   Adiabatic
    -   Reversible (`CAS`, `q_c`, `p_0`)

## Unit Testing
`flightcondition` is maintained using unit tests to maintain functionality and
accuracy.  Even so, see the Disclaimer below.

## License

`flightcondition` is licensed under the MIT LICENSE. See the
[LICENSE](https://github.com/MattCJones/flightcondition/blob/main/LICENSE)
document.

## Disclaimer

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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/MattCJones/flightcondition",
    "name": "flightcondition",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "utility, aerospace, engineering, design",
    "author": "Matthew C. Jones",
    "author_email": "matt.c.jones.aoe@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/4e/08/4cd538a3106887f650341daa57437f7f0c4765bd6c580bc26fcfc804622c/flightcondition-24.6.22.tar.gz",
    "platform": null,
    "description": "# Flight Condition\n\n## About\n\nAirspeed conversions (true/calibrated/equivalent/Mach), atmospheric data, and\nmore with built-in unit checking.  Specific sub-modules include:\n\n* `flightcondition`: input altitude to compute common flight condition data.\n  Easily swap between true airspeed, calibrated airspeed, equivalent airspeed,\n  and Mach number.  Includes atmospheric data.\n* `atmosphere`: input altitude to compute atmospheric\n  data.  Many relevant, derived quantities are included. The upper limit is\n  86 km for the \n  [1993 International Standard Atmosphere](\n  https://en.wikipedia.org/wiki/International_Standard_Atmosphere) model and\n  10,000 kilometers for the [NRL MSIS](\n  https://en.wikipedia.org/wiki/International_Standard_Atmosphere) model.\n* `units`: built-in unit-checking and conversion using the\n  [pint](https://pint.readthedocs.io) package.\n\nSee the web application here: [https://flightcondition.streamlit.app](\nhttps://flightcondition.streamlit.app/)\n\n![Flight Condition Demo](\nhttps://github.com/MattCJones/videos/blob/main/flightcondition/flightcondition_demo.gif\n)\n\n## Author\n\nMatthew C. Jones [matt.c.jones.aoe@gmail.com](matt.c.jones.aoe@gmail.com)\n\n## Installation\n\n### Install Commands\n\nInstall using the `pip` package-management system. The\neasiest method is to open the terminal and run:\n\n```python\npip install flightcondition\n```\n\nAlternatively, manually download the\n[source code](https://github.com/MattCJones/flightcondition), unpack, and run:\n\n```python\npip install <path/to/flightcondition>\n```\n\n### Dependencies\n\n-   [numpy](https://numpy.org): package for scientific computing.\n-   [pint](https://pint.readthedocs.io): package for dealing with units.\n-   [pymsis](https://swxtrec.github.io/pymsis/index.html): package for NRL MSIS\n    atmospheric model.\n\n## Usage\n\nImport all utilities with,\n\n```python\nfrom flightcondition import *\n```\n\nor more explicitly as shown in the following examples.\n\n### Flight Condition\n\nThe `FlightCondition` class is used to compute and interact with common flight\ncondition data. Inputs include altitude, velocity in some format, and an\noptional length scale.\n\n#### Input Arguments\nInput arguments include:\n\n1.  **Altitude**: `h` (aliases include: `alt`, `altitude`)\n2.  **Velocity** (pick one):\n    -   *True airspeed*: `TAS` (aliases include: `tas`, `true_airspeed`,\n        `U_inf`, `V_inf`)\n    -   *Calibrated airspeed*: `CAS` (aliases include: `cas`,\n        `calibrated_airspeed`)\n    -   *Equivalent airspeed*: `EAS` (aliases include: `eas`,\n        `equivalent_airspeed`)\n    -   *Mach number*: `M` (aliases include: `mach`, `Mach`, `M_inf`,\n        `mach_number`)\n3.  **Length-scale** (optional): `L` (aliases include: `ell`, `bylen`,\n    `length`, `length_scale`, `l`)\n\nInput quantities must be dimensionalized - see the usage below.  Alternatively\nuse `KTAS`, `KCAS`, or `KEAS` for convenience.  For example, `KCAS=233`\nis equivalent to `CAS=233*unit('knots')`.\n\n#### Output Quantities\n\nThe following tables list the quantities and the variables used to access them.\nQuantities may be accessed by either (a) their abbreviated variable, e.g.\n`.TAS`, or (b) by their full names, e.g.  `byname.true_airspeed`. They\nmay also be accessed through their particular sub-category: `byalt`, `byvel`,\nor `bylen`, e.g.  `.byvel.TAS` or `.byvel.byname.true_airspeed`.\n\n| Altitude Quantity     | Variable | Full Name (via `.byname.`) |\n|-----------------------|----------|----------------------------|\n| Geometric altitude    | `h`      | `geometric_altitude`       |\n| Geopotential altitude | `H`      | `geopotential_altitude`    |\n| Pressure              | `p`      | `pressure`                 |\n| Temperature           | `T`      | `temperature`              |\n| Density               | `rho`    | `density`                  |\n| Sound speed           | `a`      | `sounds_speed`             |\n| Dynamic viscosity     | `mu`     | `dynamic_viscosity`        |\n| Kinematic viscosity   | `nu`     | `kinematic_viscosity`      |\n| Thermal conductivity  | `k`      | `thermal_conductivity`     |\n| Gravity               | `g`      | `gravity`                  |\n| Mean free path        | `MFP`    | `mean_free_path`           |\n\n| Velocity Quantity                | Name      | Full Name (via `.byname.`)       |\n|----------------------------------|-----------|----------------------------------|\n| True airspeed (TAS)              | `TAS`     | `true_airspeed`                  |\n| Calibrated airspeed (CAS)        | `CAS`     | `calibrated_airspeed`            |\n| Equivalent airspeed (EAS)        | `EAS`     | `equivalent_airspeed`            |\n| Mach number                      | `M`       | `mach_number`                    |\n| Mach angle                       | `mu_M`    | `mach_angle`                     |\n| Dynamic pressure                 | `q_inf`   | `dynamic_pressure`               |\n| Impact pressure                  | `q_c`     | `impact_pressure`                |\n| Stagnation pressure              | `p0`      | `stagnation_pressure`            |\n| Stagnation temperature           | `T0`      | `stagnation_temperature`         |\n| Recovery temperature (laminar)   | `Tr_lamr` | `recovery_temperature_laminar`   |\n| Recovery temperature (turbulent) | `Tr_turb` | `recovery_temperature_turbulent` |\n| Reynolds number per unit length  | `Re_by_L` | `recovery_temperature_turbulent` |\n\n| Length-Scale Quantity                            | Name        | Full Name (via `.byname.`)       |\n|--------------------------------------------------|-------------|----------------------------------|\n| Length scale                                     | `L`         | `length_scale`                   |\n| Reynolds number                                  | `Re`        | `reynolds_number`                |\n| Boundary layer thickness (laminar)               | `h_BL_lamr` | `boundary_thickness_laminar`     |\n| Boundary layer thickness (turbulent)             | `h_BL_turb` | `boundary_thickness_turbulent`   |\n| Flat plate skin friction coefficient (laminar)   | `Cf_lamr`   | `friction_coefficient_laminar`   |\n| Flat plate skin friction coefficient (turbulent) | `Cf_turb`   | `friction_coefficient_turbulent` |\n\n#### Example Usage\n\n```python\nfrom flightcondition import FlightCondition, unit\n\n# Compute flight condition at 3 km, Mach 0.5\nfc = FlightCondition(h=3*unit('km'), M=0.5)\n\n# Uncomment to print summary of flight condition quantities:\n#print(f\"{fc}\")\n\n# Uncomment to print abbreviated output in US units:\n#print(f\"\\n{fc.tostring(full_output=False, units=\"US\")}\")\n\n# Convert true, calibrated, equivalent airspeeds\nKTAS = fc.TAS.to('knots')\nKCAS = fc.CAS.to('knots')\nKEAS = fc.EAS.to('knots')\nprint(f\"Flying at {KTAS.magnitude:.4g} KTAS,\"\n      f\" which is {KCAS.magnitude:.4g} KCAS,\"\n      f\" or {KEAS.magnitude:.4g} KEAS\")\n# >>> Flying at 319.4 KTAS, which is 277.7 KCAS, or 275.1 KEAS\n\n# Access atmospheric data (see Atmosphere class for more)\nh, p, T, rho, nu, a = fc.h, fc.p, fc.T, fc.rho, fc.nu, fc.a\nprint(f\"The ambient temperature at {h.to('km'):.4g} is {T:.4g}\")\n# >>> The ambient temperature at 3 km is 268.7 K\n\n# Change airspeed to 300 KEAS and altitude to 12 kft\nfc.EAS = 300 * unit('knots')\nfc.h = 12 * unit('kft')\n#print(f\"{fc}\")  # uncomment to print output\n\n# Recompute for a range of altitudes at 275.14 knots-equivalent\n# airspeed with a characteristic length scale of 10 meters\nfc = FlightCondition(h=[0, 9.8425, 20]*unit('kft'),\n                    EAS=275.14*unit('kt'),\n                    L=10*unit('m'))\n\n# Compute additional derived quantities - explore the class for more!\nprint(f\"\\nThe dynamic pressure in psi is {fc.q_inf.to('psi'):.3g}\")\n# >>> The dynamic pressure in psi is [1.78 1.78 1.78] psi\nprint(f\"The Reynolds number is {fc.Re:.3g}\")\n# >>> The Reynolds number is [9.69e+07 8.82e+07 7.95e+07]\nh_yplus100 = fc.wall_distance_from_yplus(100)\nprint(f\"The wall distance where y+=100 is {h_yplus100.to('in'):.3g}\")\n# >>> The wall distance where y+=100 is [0.0126 0.0138 0.0153] in\n\n# Alternatively access quantities by their full name\nprint(fc.TAS == fc.byname.true_airspeed)\n# >>> [ True  True  True]\n\n# Or by their sub-categories: `byalt`, `byvel`, or `bylen`\nprint(fc.byvel.TAS == fc.byvel.byname.true_airspeed)\n# >>> [ True  True  True]\n```\n\n### Atmosphere\n\nThe `Atmosphere` class can be used to compute and interact with common standard\natmosphere data and derived quantities.  See the list of output quantities in\nthe `FlightCondition` documentation above.\nSee also `layer` for layer properties such as `layer.name` for the layer name.\n\nNote that all `Atmosphere` properties can be accessed through the\n`FlightCondition` class, however, this class stands on its own if the\nadditional velocity and length-scale quantities are not desired.\n\n#### Input Arguments\nThe input argument is geometric altitude `h`.  Aliases include `alt` and\n`altitude`.  Note that these geometric altitude must be input as dimensional\nlength quantities - see the usage below.  Alternatively input\nun-dimensionalized numbers using `h_kft` or `h_km` for kilofeet and kilometers\nrespectively.\n\n#### Example Usage\n\n```python\nfrom flightcondition import Atmosphere, unit\n\n# Compute atmospheric data for a scalar or array of altitudes\nh = [0.0, 44.2, 81.0] * unit('km')\natm = Atmosphere(h)\n\n# Uncomment to print all atmospheric quantities:\n#print(f\"\\n{atm}\")\n\n# Uncomment to print while specifying abbreviated output in US units:\n#print(f\"\\n{atm.tostring(full_output=False, units=\"US\")}\")\n\n# See also the linspace() function from numpy, e.g.\n# h = linspace(0, 81.0, 82) * unit('km')\n\n# Access individual properties and convert to desired units: \"\np, T, rho, nu, a, k = atm.p, atm.T, atm.rho, atm.nu, atm.a, atm.k\nprint(f\"\\nThe pressure in psi is {p.to('psi'):.3g}\")\n# >>> The pressure in psi is [14.7 0.024 0.000129] psi\n\n# Compute additional properties such as mean free path\n# Explore the class data structure for all options\nprint( f\"\\nThe mean free path = {atm.MFP:.3g}\")\n# >>> The mean free path = [7.25e-08 4.04e-05 0.00564] yd\n```\n\n### Units\n\nConveniently input, output, and convert units using\n[pint](https://pint.readthedocs.io) units.\n\n```python\nfrom flightcondition import unit, printv\n\nh = 33 * unit('km')\nprint(h.to('kft'))\n# >>> 108.26771653543307 kft\nprintv(h, to='kft')\n# >>> h = 108.27 kft\n\nU_inf = 20 * unit('knots')\nrho_inf = 1.225 * unit('kg/m^3')\nq_inf = 0.5*rho_inf*U_inf**2\nprintv(q_inf, to='psi')\n# >>> q_inf = 0.0094042 psi\n```\n\nNote that [pint](https://pint.readthedocs.io) does not support conflicting unit\nregistries so avoid interactions between `flightcondition.unit` and a separate\n`pint.UnitRegistry`.\n\n### Command Line Interface\n\nA command line interface (CLI) is included for convenience but with limited\nfunctionality. Run `flightcondition -h` for help.\n\nAn example call is given for the flight condition of 233\nknots-equivalent-airspeed at 23 kilofeet with a length scale of 4 feet and\nabbreviated output:\n\n```bash\nflightcondition --h 23 kft --EAS 233 knots --L 4 ft --no-full-output\n```\n\n```bash\n===========================================================\n   Flight Condition (units=US, full_output=False)\n===========================================================\n------------------  Altitude Quantities  ------------------\ngeometric_altitude  h       = 23 kft\npressure            p       = 857.25 lbf/ft\u00b2\ntemperature         T       = 436.74 \u00b0R\ndensity             rho     = 1.1435\u00d710\u207b\u00b3 slug/ft\u00b3\nsound_speed         a       = 1024.5 ft/s\nkinematic_viscosity nu      = 2.8509\u00d710\u207b\u2074 ft\u00b2/s\n------------------  Velocity Quantities  ------------------\nmach_number         M       = 0.55344\ntrue_airspeed       TAS     = 335.93 kt\ncalibrated_airspeed CAS     = 238.14 kt\nequivalent_airspeed EAS     = 233 kt\nreynolds_per_length Re_by_L = 1.6573\u00d710\u2075 1/in\n------------------   Length Quantities   ------------------\nlength_scale        L       = 4 ft\nreynolds_number     Re      = 7.9551\u00d710\u2076\n```\n\nAlternatively use the `--KEAS 233` syntactic sugar to omit the `knots` unit.\nSee also `--KTAS` and `--KCAS`.\n\n## Web Application\nSee the web application here: [https://flightcondition.streamlit.app](\nhttps://flightcondition.streamlit.app/)\n\n## Assumptions\n\n-   When using `model=standard`, Atmospheric quantities follow the\n    [1993 International Standard Atmosphere](\n    https://en.wikipedia.org/wiki/NRLMSISE-00) model.\n-   When using `model=msis`, atmospheric quantities follow the [NRL MSIS](\n    https://en.wikipedia.org/wiki/International_Standard_Atmosphere) model.\n    Note that `model=msis` is automatically enabled for altitudes higher than\n    80 kilometers.\n-   Velocity computations include varying degrees of the following assumptions.\n    Note that several assumptions break down for hypersonic flow.\n    -   Continuum flow (mean free path is much smaller than the characteristic\n        length scale)\n    -   Ideal gas\n    -   Thermally perfect gas\n    -   Calorically perfect gas\n    -   Adiabatic\n    -   Reversible (`CAS`, `q_c`, `p_0`)\n\n## Unit Testing\n`flightcondition` is maintained using unit tests to maintain functionality and\naccuracy.  Even so, see the Disclaimer below.\n\n## License\n\n`flightcondition` is licensed under the MIT LICENSE. See the\n[LICENSE](https://github.com/MattCJones/flightcondition/blob/main/LICENSE)\ndocument.\n\n## Disclaimer\n\nThe software is provided \"as is\", without warranty of any kind, express or\nimplied, including but not limited to the warranties of merchantability,\nfitness for a particular purpose and noninfringement. In no event shall the\nauthors or copyright holders be liable for any claim, damages or other\nliability, whether in an action of contract, tort or otherwise, arising from,\nout of or in connection with the software or the use or other dealings in the\nsoftware.\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Airspeed conversions (true/calibrated/equivalent/Mach),",
    "version": "24.6.22",
    "project_urls": {
        "Homepage": "https://github.com/MattCJones/flightcondition"
    },
    "split_keywords": [
        "utility",
        " aerospace",
        " engineering",
        " design"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "03437ea5431fbcd7e7285b6e94b3b673667acbd2978fa596ba40d8bc7b2af81b",
                "md5": "6c6cfded92629d32b3d30cc530b52d45",
                "sha256": "02f01e98774522067971b1e4d2f97789effdb46992d59e37fc8889d0bb38b472"
            },
            "downloads": -1,
            "filename": "flightcondition-24.6.22-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6c6cfded92629d32b3d30cc530b52d45",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 55707,
            "upload_time": "2024-06-22T23:05:40",
            "upload_time_iso_8601": "2024-06-22T23:05:40.321949Z",
            "url": "https://files.pythonhosted.org/packages/03/43/7ea5431fbcd7e7285b6e94b3b673667acbd2978fa596ba40d8bc7b2af81b/flightcondition-24.6.22-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4e084cd538a3106887f650341daa57437f7f0c4765bd6c580bc26fcfc804622c",
                "md5": "df4547d73c91ce3368ed8c823ea857e6",
                "sha256": "602e29177307cac8be50b2c1ed39e6a56b7229eaacaa9e40a3ef5f0c39056bef"
            },
            "downloads": -1,
            "filename": "flightcondition-24.6.22.tar.gz",
            "has_sig": false,
            "md5_digest": "df4547d73c91ce3368ed8c823ea857e6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 55794,
            "upload_time": "2024-06-22T23:05:41",
            "upload_time_iso_8601": "2024-06-22T23:05:41.775461Z",
            "url": "https://files.pythonhosted.org/packages/4e/08/4cd538a3106887f650341daa57437f7f0c4765bd6c580bc26fcfc804622c/flightcondition-24.6.22.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-22 23:05:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MattCJones",
    "github_project": "flightcondition",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "flightcondition"
}
        
Elapsed time: 0.25589s