Skip to content
This repository was archived by the owner on Oct 14, 2023. It is now read-only.
This repository was archived by the owner on Oct 14, 2023. It is now read-only.

Jacchia77.density() returns value in kg2 mol / (K m3) #1509

@Nosudrum

Description

@Nosudrum

🐞 Problem

While other atmosphere models COESA62 and COESA76 return density values in kg / m3, Jacchia77 returns a density value in kg2 mol / (K m3).

This can be reproduced with the following code :

from astropy import units as u
from poliastro.earth.atmosphere import coesa62, coesa76, jacchia

# Create atmospheres
atm_coesa62 = coesa62.COESA62()
atm_coesa76 = coesa76.COESA76()
atm_jacchia = jacchia.Jacchia77(1050 * u.K)

# Get densities
alt = 500 * u.km
rho_coesa62 = atm_coesa62.density(alt)
rho_coesa76 = atm_coesa76.density(alt)
rho_jacchia = atm_jacchia.density(alt)
print(f'rho_coesa62 = {rho_coesa62}, rho_coesa76 = {rho_coesa76}, rho_jacchia = {rho_jacchia}')

This generates the following output :

rho_coesa62 = 1.576876104054915e-12 kg / m3, rho_coesa76 = 5.212859332411656e-13 kg / m3, rho_jacchia = 7.346968613514447e-13 kg2 mol / (K m3)

Now, a quick dimensional analysis when reading the documentation of Jacchia77 leads me to think that combining the density output in kg2 mol / (K m3) with jacchia.R in J / (kg mol) and jacchia.k in J / K could lead to something in kg / m3.

However, if that is the expected procedure to get an atmospheric density using Jacchia77 that can then be used in the atmospheric_drag perturbation, then I would suggest to mention it more clearly in the documentation.

If it is not, then I would be interested to know what is and would also suggest updating the Jacchia77 documentation to reflect the fact that its density method does not return rho in usual units, unlike other models.

🖥 Please paste the output of following commands

conda info -a
     active environment : poliastro
    active env location : C:\Users\a.muller\Anaconda3\envs\poliastro
            shell level : 2
       user config file : C:\Users\a.muller\.condarc
 populated config files : C:\Users\a.muller\.condarc
          conda version : 4.12.0
    conda-build version : 3.21.6
         python version : 3.9.7.final.0
       virtual packages : __cuda=11.3=0
                          __win=0=0
                          __archspec=1=x86_64
       base environment : C:\Users\a.muller\Anaconda3  (writable)
      conda av data dir : C:\Users\a.muller\Anaconda3\etc\conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/tudat-team/win-64
                          https://conda.anaconda.org/tudat-team/noarch
                          https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\Users\a.muller\Anaconda3\pkgs
                          C:\Users\a.muller\.conda\pkgs
                          C:\Users\a.muller\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\a.muller\Anaconda3\envs
                          C:\Users\a.muller\.conda\envs
                          C:\Users\a.muller\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.12.0 requests/2.26.0 CPython/3.9.7 Windows/10 Windows/10.0.19041
          administrator : False
             netrc file : None
           offline mode : False

# conda environments:
#
base                     C:\Users\a.muller\Anaconda3
2022_muller_arnaud       C:\Users\a.muller\Anaconda3\envs\2022_muller_arnaud
orekit-python            C:\Users\a.muller\Anaconda3\envs\orekit-python
poliastro             *  C:\Users\a.muller\Anaconda3\envs\poliastro
poliastro-main           C:\Users\a.muller\Anaconda3\envs\poliastro-main
tudat-space              C:\Users\a.muller\Anaconda3\envs\tudat-space

sys.version: 3.9.7 (default, Sep 16 2021, 16:59:28) [...
sys.prefix: C:\Users\a.muller\Anaconda3
sys.executable: C:\Users\a.muller\Anaconda3\python.exe
conda location: C:\Users\a.muller\Anaconda3\lib\site-packages\conda
conda-build: C:\Users\a.muller\Anaconda3\Scripts\conda-build.exe
conda-content-trust: C:\Users\a.muller\Anaconda3\Scripts\conda-content-trust.exe
conda-convert: C:\Users\a.muller\Anaconda3\Scripts\conda-convert.exe
conda-debug: C:\Users\a.muller\Anaconda3\Scripts\conda-debug.exe
conda-develop: C:\Users\a.muller\Anaconda3\Scripts\conda-develop.exe
conda-env: C:\Users\a.muller\Anaconda3\Scripts\conda-env.exe
conda-index: C:\Users\a.muller\Anaconda3\Scripts\conda-index.exe
conda-inspect: C:\Users\a.muller\Anaconda3\Scripts\conda-inspect.exe
conda-metapackage: C:\Users\a.muller\Anaconda3\Scripts\conda-metapackage.exe
conda-pack: C:\Users\a.muller\Anaconda3\Scripts\conda-pack.exe
conda-render: C:\Users\a.muller\Anaconda3\Scripts\conda-render.exe
conda-repo: C:\Users\a.muller\Anaconda3\Scripts\conda-repo.exe
conda-server: C:\Users\a.muller\Anaconda3\Scripts\conda-server.exe
conda-skeleton: C:\Users\a.muller\Anaconda3\Scripts\conda-skeleton.exe
conda-token: C:\Users\a.muller\Anaconda3\Scripts\conda-token.exe
conda-verify: C:\Users\a.muller\Anaconda3\Scripts\conda-verify.exe
user site dirs:

CIO_TEST: <not set>
CONDA_DEFAULT_ENV: poliastro
CONDA_EXE: C:\Users\a.muller\Anaconda3\Scripts\conda.exe
CONDA_PREFIX: C:\Users\a.muller\Anaconda3\envs\poliastro
CONDA_PREFIX_1: C:\Users\a.muller\Anaconda3
CONDA_PROMPT_MODIFIER: (poliastro)
CONDA_PYTHON_EXE: C:\Users\a.muller\Anaconda3\python.exe
CONDA_ROOT: C:\Users\a.muller\Anaconda3
CONDA_SHLVL: 2
CURL_CA_BUNDLE: <not set>
HOMEPATH: \
PATH: C:\Users\a.muller\Anaconda3;C:\Users\a.muller\Anaconda3\Library\mingw-w64\bin;C:\Users\a.muller\Anaconda3\Library\usr\bin;C:\Users\a.muller\Anaconda3\Library\bin;C:\Users\a.muller\Anaconda3\Scripts;C:\Users\a.muller\Anaconda3\bin;C:\Users\a.muller\Anaconda3\envs\poliastro;C:\Users\a.muller\Anaconda3\envs\poliastro\Library\mingw-w64\bin;C:\Users\a.muller\Anaconda3\envs\poliastro\Library\usr\bin;C:\Users\a.muller\Anaconda3\envs\poliastro\Library\bin;C:\Users\a.muller\Anaconda3\envs\poliastro\Scripts;C:\Users\a.muller\Anaconda3\envs\poliastro\bin;C:\Users\a.muller\Anaconda3\condabin;C:\Python365\Scripts;C:\Python365;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0;C:\windows\System32\OpenSSH;C:\Users\a.muller\AppData\Local\Microsoft\WindowsApps;C:\Users\a.muller\AppData\Local\JetBrains\PyCharm 2022.1\bin;.;C:\Users\a.muller\AppData\Local\Programs\Git\cmd;C:\Users\a.muller\AppData\Local\GitHubDesktop\bin
PSMODULEPATH: D:\a.muller\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\windows\system32\WindowsPowerShell\v1.0\Modules
REQUESTS_CA_BUNDLE: <not set>
SSL_CERT_FILE: <not set>
conda list
# packages in environment at C:\Users\a.muller\Anaconda3\envs\poliastro:
#
# Name                    Version                   Build  Channel
about-time                3.1.1                    pypi_0    pypi
alive-progress            2.4.1                    pypi_0    pypi
astropy                   4.3.1            py39hc7d831d_0
astroquery                0.4.6              pyhd8ed1ab_0    conda-forge
attrs                     21.4.0             pyhd8ed1ab_0    conda-forge
beautifulsoup4            4.11.1             pyha770c72_0    conda-forge
brotli                    1.0.9                h8ffe710_7    conda-forge
brotli-bin                1.0.9                h8ffe710_7    conda-forge
brotlipy                  0.7.0           py39hb82d6ee_1004    conda-forge
bzip2                     1.0.8                h8ffe710_4    conda-forge
ca-certificates           2022.4.26            haa95532_0
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
certifi                   2021.10.8        py39hcbf5309_2    conda-forge
cffi                      1.15.0           py39h0878f49_0    conda-forge
charset-normalizer        2.0.12             pyhd8ed1ab_0    conda-forge
cryptography              36.0.2           py39h7bc7c5c_1    conda-forge
cycler                    0.11.0             pyhd8ed1ab_0    conda-forge
czml3                     0.7.0              pyhd8ed1ab_0    conda-forge
fonttools                 4.33.3           py39hb82d6ee_0    conda-forge
freetype                  2.10.4               h546665d_1    conda-forge
grapheme                  0.6.0                    pypi_0    pypi
html5lib                  1.1                pyh9f0ad1d_0    conda-forge
icu                       69.1                 h0e60522_0    conda-forge
idna                      3.3                pyhd8ed1ab_0    conda-forge
importlib-metadata        4.11.3           py39hcbf5309_1    conda-forge
importlib_metadata        4.11.3               hd8ed1ab_1    conda-forge
intel-openmp              2022.0.0          h57928b3_3663    conda-forge
jbig                      2.1               h8d14728_2003    conda-forge
jpeg                      9e                   h8ffe710_1    conda-forge
jplephem                  2.17               pyhf3f802f_0    conda-forge
keyring                   23.4.0           py39hcbf5309_2    conda-forge
kiwisolver                1.4.2            py39h2e07f2f_1    conda-forge
lcms2                     2.12                 h2a16943_0    conda-forge
lerc                      3.0                  h0e60522_0    conda-forge
libblas                   3.9.0              14_win64_mkl    conda-forge
libbrotlicommon           1.0.9                h8ffe710_7    conda-forge
libbrotlidec              1.0.9                h8ffe710_7    conda-forge
libbrotlienc              1.0.9                h8ffe710_7    conda-forge
libcblas                  3.9.0              14_win64_mkl    conda-forge
libclang                  13.0.1          default_h81446c8_0    conda-forge
libcurl                   7.82.0               h86230a5_0
libdeflate                1.10                 h8ffe710_0    conda-forge
libffi                    3.4.2                h8ffe710_5    conda-forge
liblapack                 3.9.0              14_win64_mkl    conda-forge
libpng                    1.6.37               h1d00b33_2    conda-forge
libssh2                   1.10.0               hcd4344a_0
libtiff                   4.3.0                hc4061b1_3    conda-forge
libwebp                   1.2.2                h57928b3_0    conda-forge
libwebp-base              1.2.2                h8ffe710_1    conda-forge
libxcb                    1.13              hcd874cb_1004    conda-forge
libzlib                   1.2.11            h8ffe710_1014    conda-forge
llvmlite                  0.38.0           py39ha0cd8c8_1    conda-forge
lz4-c                     1.9.3                h8ffe710_1    conda-forge
m2w64-gcc-libgfortran     5.3.0                         6    conda-forge
m2w64-gcc-libs            5.3.0                         7    conda-forge
m2w64-gcc-libs-core       5.3.0                         7    conda-forge
m2w64-gmp                 6.1.0                         2    conda-forge
m2w64-libwinpthread-git   5.0.0.4634.697f757               2    conda-forge
matplotlib                3.5.2            py39hcbf5309_0    conda-forge
matplotlib-base           3.5.2            py39h581301d_0    conda-forge
mkl                       2022.0.0           h0e2418a_796    conda-forge
msys2-conda-epoch         20160418                      1    conda-forge
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
numba                     0.55.1           py39hb8cd55e_0    conda-forge
numpy                     1.21.6           py39h6331f09_0    conda-forge
openjpeg                  2.4.0                hb211442_1    conda-forge
openssl                   1.1.1o               h2bbff1b_0
packaging                 21.3               pyhd8ed1ab_0    conda-forge
pillow                    9.1.0            py39ha53f419_2    conda-forge
pip                       22.0.4             pyhd8ed1ab_0    conda-forge
plotly                    5.7.0              pyhd8ed1ab_0    conda-forge
poliastro                 0.16.3             pyhd8ed1ab_0    conda-forge
proj                      8.2.1                h5ed7ab8_0
pthread-stubs             0.4               hcd874cb_1001    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pyerfa                    2.0.0.1          py39h5d4886f_2    conda-forge
pymap3d                   2.8.0                    pypi_0    pypi
pyopenssl                 22.0.0             pyhd8ed1ab_0    conda-forge
pyparsing                 3.0.8              pyhd8ed1ab_0    conda-forge
pyproj                    3.3.0            py39hb622704_0
pyqt                      5.12.3           py39hcbf5309_8    conda-forge
pyqt-impl                 5.12.3           py39h415ef7b_8    conda-forge
pyqt5-sip                 4.19.18          py39h415ef7b_8    conda-forge
pyqtchart                 5.12             py39h415ef7b_8    conda-forge
pyqtwebengine             5.12.1           py39h415ef7b_8    conda-forge
pysocks                   1.7.1            py39hcbf5309_5    conda-forge
python                    3.9.12          h9a09f29_1_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python_abi                3.9                      2_cp39    conda-forge
pyvo                      1.3                pyhd8ed1ab_0    conda-forge
pywin32-ctypes            0.2.0           py39hcbf5309_1005    conda-forge
pyyaml                    6.0              py39hb82d6ee_4    conda-forge
qt                        5.12.9               h556501e_6    conda-forge
requests                  2.27.1             pyhd8ed1ab_0    conda-forge
scipy                     1.8.0            py39hc0c34ad_1    conda-forge
setuptools                62.1.0           py39hcbf5309_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
soupsieve                 2.3.1              pyhd8ed1ab_0    conda-forge
sqlite                    3.38.5               h8ffe710_0    conda-forge
tbb                       2021.5.0             h2d74725_1    conda-forge
tenacity                  8.0.1              pyhd8ed1ab_0    conda-forge
tk                        8.6.12               h8ffe710_0    conda-forge
tornado                   6.1              py39hb82d6ee_3    conda-forge
tzdata                    2022a                h191b570_0    conda-forge
ucrt                      10.0.20348.0         h57928b3_0    conda-forge
unicodedata2              14.0.0           py39hb82d6ee_1    conda-forge
urllib3                   1.26.9             pyhd8ed1ab_0    conda-forge
vc                        14.2                 hb210afc_6    conda-forge
vs2015_runtime            14.29.30037          h902a5da_6    conda-forge
w3lib                     1.22.0             pyh9f0ad1d_0    conda-forge
webencodings              0.5.1                      py_1    conda-forge
wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
win_inet_pton             1.1.0            py39hcbf5309_4    conda-forge
xorg-libxau               1.0.9                hcd874cb_0    conda-forge
xorg-libxdmcp             1.1.3                hcd874cb_0    conda-forge
xz                        5.2.5                h62dcd97_1    conda-forge
yaml                      0.2.5                h8ffe710_2    conda-forge
zipp                      3.8.0              pyhd8ed1ab_0    conda-forge
zlib                      1.2.11            h8ffe710_1014    conda-forge
zstd                      1.5.2                h6255e5f_0    conda-forge
pip freeze
about-time==3.1.1
alive-progress==2.4.1
astropy @ file:///C:/ci/astropy_1629829318700/work
astroquery==0.4.6
attrs @ file:///home/conda/feedstock_root/build_artifacts/attrs_1640799537051/work
beautifulsoup4 @ file:///home/conda/feedstock_root/build_artifacts/beautifulsoup4_1649463573192/work
brotlipy @ file:///D:/bld/brotlipy_1648854327487/work
cached-property @ file:///home/conda/feedstock_root/build_artifacts/cached_property_1615209429212/work
certifi==2021.10.8
cffi @ file:///D:/bld/cffi_1636046278333/work
charset-normalizer @ file:///home/conda/feedstock_root/build_artifacts/charset-normalizer_1644853463426/work
cryptography @ file:///D:/bld/cryptography_1649035434655/work
cycler @ file:///home/conda/feedstock_root/build_artifacts/cycler_1635519461629/work
czml3 @ file:///home/conda/feedstock_root/build_artifacts/czml3_1639548540228/work
fonttools @ file:///D:/bld/fonttools_1651018206941/work
grapheme==0.6.0
html5lib @ file:///home/conda/feedstock_root/build_artifacts/html5lib_1592930327044/work
idna @ file:///home/conda/feedstock_root/build_artifacts/idna_1642433548627/work
importlib-metadata @ file:///D:/bld/importlib-metadata_1648728550588/work
jplephem @ file:///home/conda/feedstock_root/build_artifacts/jplephem_1640954253146/work
keyring @ file:///D:/bld/keyring_1643122234718/work
kiwisolver @ file:///D:/bld/kiwisolver_1648854553193/work
llvmlite==0.38.0
matplotlib @ file:///D:/bld/matplotlib-suite_1651609646819/work
munkres==1.1.4
numba @ file:///D:/bld/numba_1644004406986/work
numpy @ file:///D:/bld/numpy_1649806531213/work
packaging @ file:///home/conda/feedstock_root/build_artifacts/packaging_1637239678211/work
Pillow @ file:///D:/bld/pillow_1649818211002/work
plotly @ file:///home/conda/feedstock_root/build_artifacts/plotly_1649183764952/work
poliastro @ file:///home/conda/feedstock_root/build_artifacts/poliastro_1652129457343/work
pycparser @ file:///home/conda/feedstock_root/build_artifacts/pycparser_1636257122734/work
pyerfa @ file:///D:/bld/pyerfa_1649586279666/work
pymap3d==2.8.0
pyOpenSSL @ file:///home/conda/feedstock_root/build_artifacts/pyopenssl_1643496850550/work
pyparsing @ file:///home/conda/feedstock_root/build_artifacts/pyparsing_1649603503565/work
pyproj @ file:///C:/ci/pyproj_1644510246938/work
PyQt5==5.12.3
PyQt5_sip==4.19.18
PyQtChart==5.12
PyQtWebEngine==5.12.1
PySocks @ file:///D:/bld/pysocks_1648857426942/work
python-dateutil @ file:///home/conda/feedstock_root/build_artifacts/python-dateutil_1626286286081/work
pyvo @ file:///home/conda/feedstock_root/build_artifacts/pyvo_1645470589834/work
pywin32-ctypes @ file:///D:/bld/pywin32-ctypes_1648607901171/work
PyYAML @ file:///D:/bld/pyyaml_1648757346451/work
requests @ file:///home/conda/feedstock_root/build_artifacts/requests_1641580202195/work
scipy @ file:///C:/bld/scipy_1644357595180/work
six @ file:///home/conda/feedstock_root/build_artifacts/six_1620240208055/work
soupsieve @ file:///home/conda/feedstock_root/build_artifacts/soupsieve_1638550740809/work
tenacity @ file:///home/conda/feedstock_root/build_artifacts/tenacity_1626090218611/work
tornado @ file:///D:/bld/tornado_1648827405403/work
unicodedata2 @ file:///D:/bld/unicodedata2_1649112114189/work
urllib3 @ file:///home/conda/feedstock_root/build_artifacts/urllib3_1647489083693/work
w3lib @ file:///home/conda/feedstock_root/build_artifacts/w3lib_1591173357158/work
webencodings==0.5.1
win-inet-pton @ file:///D:/bld/win_inet_pton_1648771910527/work
zipp @ file:///home/conda/feedstock_root/build_artifacts/zipp_1649012893348/work

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions