# Welcome to the SATQUERY package
[![PyPI version shields.io](https://img.shields.io/pypi/v/satcatalogquery.svg)](https://pypi.python.org/pypi/satcatalogquery/) [![PyPI pyversions](https://img.shields.io/pypi/pyversions/satcatalogquery.svg)](https://pypi.python.org/pypi/satcatalogquery/) [![PyPI status](https://img.shields.io/pypi/status/satcatalogquery.svg)](https://pypi.python.org/pypi/satcatalogquery/) [![GitHub contributors](https://img.shields.io/github/contributors/lcx366/SATQUERY.svg)](https://GitHub.com/lcx366/SATQUERY/graphs/contributors/) [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/lcx366/SATQUERY/graphs/commit-activity) [![GitHub license](https://img.shields.io/github/license/lcx366/SATQUERY.svg)](https://github.com/lcx366/SATQUERY/blob/master/LICENSE) [![Documentation Status](https://readthedocs.org/projects/satcatalogquery/badge/?version=latest)](http://satcatalogquery.readthedocs.io/?badge=latest) [![Build Status](https://travis-ci.org/lcx366/satcatalogquery.svg?branch=master)](https://travis-ci.org/lcx366/satcatalogquery)
This package is an archive of scientific routines for querying orbital and geometric information of space objects.
Currently, operations on objects catalogue query include:
1. Query of spatial objects on geometric information from DISCOS(Database and Information System Characterising Objects in Space) database;
2. Query of spatial objects on orbital information from CelesTrak database;
3. Query of spatial objects on both geometric and orbital information from a combined database;
## How to Install
On Linux, macOS and Windows architectures, the binary wheels can be installed using pip by executing one of the following commands:
```
pip install satcatalogquery
pip install satcatalogquery --upgrade # to upgrade a pre-existing installation
```
## How to use
### Objects catalogue query from DISCOS
Query by NORAD_ID, where type of NORAD_ID can be int/str, list of int/str, or a text file named satno.txt in the following format:
```
# satno
52132
51454
37637
26758
44691
```
```python
>>> from satcatalogquery import SatCatalog
>>> satcatlog = SatCatalog.discos_query(NORAD_ID=[52132,51454,37637,26758,44691])
>>> # satcatog = SatCatalog.discos_query(NORAD_ID='satno.txt')
>>> satcatlog.df # output pandas dataframe
>>> satcatlog.to_csv() # save dataframe to .csv file
```
Query by mutiple options at the same time, such as COSPAR_ID, MASS, SHAPE, RCSAvg, etc.
```python
>>> satcatlog = SatCatalog.discos_query(SHAPE=['Box','Pan'],RCSAvg=[0.5,10],DECAYED=False)
```
#### Objects catalogue query from CelesTrak
```python
>>> satcatlog = SatCatalog.celestrak_query(MEAN_ALT=[300,2000],ECC=[0.01,0.1],PAYLOAD=False)
```
### Objects catalogue query from combined database
```python
>>> satcatlog = SatCatalog.objects_query(DECAYED=False,RCSAvg=[0.25,10],MEAN_ALT=[250,2000],TLE_STATUS=True,sort='RCSAvg')
```
### Create object `SatCatlog` from a loacl .csv file
```python
>>> from satcatalogquery import SatCatalog
>>> satcatlog = SatCatalog.from_csv('filename.csv')
```
### Statistics
```python
>>> satcatlog.hist1d('RCSAvg')
>>> satcatlog.hist1d(['StdMag','LAUNCH_DATE'])
>>> satcatlog.hist2d('MEAN_ALT','INCLINATION')
>>> satcatlog.pie('LAUNCH_SITE',cutoff=100)
```
<p align="middle">
<img src="readme_figs/RCSAvg.png" width="500" />
</p>
<p align="middle">
<img src="readme_figs/StdMag_LAUNCH_DATE.png" width="500" />
</p>
<p align="middle">
<img src="readme_figs/MEAN_ALT-INCLINATION.png" width="500" />
</p>
<p align="middle">
<img src="readme_figs/LAUNCH_SITE.png" width="500" />
</p>
### Download TLE from Space-Track according to the results of objects catalogue query
```python
>>> tle_path = satcatlog.get_tle()
```
### Download TLE from Space-Track by Norad IDs
```python
>>> from satcatalogquery import download_tle
>>> tle_file = download_tle([52132,51454,37637,26758,44691])
>>> print(tle_file)
```
Next, you may be interested in [Data processing related to TLE files](https://github.com/lcx366/ORBDTOOLS#data-processing-related-to-tle-files).
## Change log
- **0.2.4 — Dec 08, 2023**
- Fixed a bug where a newline character was appended to the end of the string when reading tokens from a file.
- The download URL of qsmag.zip has been modified to solve the bug that caused the file download failure due to the original URL being invalid.
- **0.2.3 — Sep 23, 2023**
- Fixed the bug that when downloading TLE data from SpaceTrack, the automatically generated wrong authentication file due to incorrect user name or password input could no longer be updated.
- **0.2.2 — Apr 24, 2023**
- Change the method `.save()` to `.to_csv()`
- Add methods `.discos_query()`, `.celestrak_query()`, `.objects_query()`to class SatCatalog
- Change class `SatCatlog` to `SatCatalog`
- **0.2.1 — Jan 4, 2023**
- Add method `from_csv` and `pie` to class SatCatlog
- Add statistics figures to README.md
- **0.1.1 — Jan 2, 2023**
- The ***satcatalogquery*** package was released.
## Next Release
- Added DISCOSweb API support for version [2.0.0](https://discosweb.esoc.esa.int/apidocs/v2).
- Improve code structure and enrich technical documentation.
# Reference
- [DISCOSweb](https://discosweb.esoc.esa.int)
- [CelesTrak](http://www.celestrak.com) and [SATCAT Format Documentation](https://celestrak.org/satcat/satcat-format.php)
- [Space-Track](https://www.space-track.org/auth/login)
Raw data
{
"_id": null,
"home_page": "https://github.com/lcx366/SATQUERY",
"name": "satcatalogquery",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "",
"keywords": "DISCOS,CelesTrak,SpaceTrack,Space Debris",
"author": "Chunxiao Li",
"author_email": "lcx366@126.com",
"download_url": "",
"platform": null,
"description": "# Welcome to the SATQUERY package\n\n[![PyPI version shields.io](https://img.shields.io/pypi/v/satcatalogquery.svg)](https://pypi.python.org/pypi/satcatalogquery/) [![PyPI pyversions](https://img.shields.io/pypi/pyversions/satcatalogquery.svg)](https://pypi.python.org/pypi/satcatalogquery/) [![PyPI status](https://img.shields.io/pypi/status/satcatalogquery.svg)](https://pypi.python.org/pypi/satcatalogquery/) [![GitHub contributors](https://img.shields.io/github/contributors/lcx366/SATQUERY.svg)](https://GitHub.com/lcx366/SATQUERY/graphs/contributors/) [![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/lcx366/SATQUERY/graphs/commit-activity) [![GitHub license](https://img.shields.io/github/license/lcx366/SATQUERY.svg)](https://github.com/lcx366/SATQUERY/blob/master/LICENSE) [![Documentation Status](https://readthedocs.org/projects/satcatalogquery/badge/?version=latest)](http://satcatalogquery.readthedocs.io/?badge=latest) [![Build Status](https://travis-ci.org/lcx366/satcatalogquery.svg?branch=master)](https://travis-ci.org/lcx366/satcatalogquery)\n\nThis package is an archive of scientific routines for querying orbital and geometric information of space objects.\nCurrently, operations on objects catalogue query include:\n\n1. Query of spatial objects on geometric information from DISCOS(Database and Information System Characterising Objects in Space) database;\n2. Query of spatial objects on orbital information from CelesTrak database;\n3. Query of spatial objects on both geometric and orbital information from a combined database;\n\n## How to Install\n\nOn Linux, macOS and Windows architectures, the binary wheels can be installed using pip by executing one of the following commands:\n\n```\npip install satcatalogquery\npip install satcatalogquery --upgrade # to upgrade a pre-existing installation\n```\n\n## How to use\n\n### Objects catalogue query from DISCOS\n\nQuery by NORAD_ID, where type of NORAD_ID can be int/str, list of int/str, or a text file named satno.txt in the following format:\n\n```\n# satno\n52132\n51454\n37637\n26758\n44691\n```\n\n```python\n>>> from satcatalogquery import SatCatalog\n>>> satcatlog = SatCatalog.discos_query(NORAD_ID=[52132,51454,37637,26758,44691])\n>>> # satcatog = SatCatalog.discos_query(NORAD_ID='satno.txt')\n>>> satcatlog.df # output pandas dataframe\n>>> satcatlog.to_csv() # save dataframe to .csv file\n```\n\nQuery by mutiple options at the same time, such as COSPAR_ID, MASS, SHAPE, RCSAvg, etc.\n\n```python\n>>> satcatlog = SatCatalog.discos_query(SHAPE=['Box','Pan'],RCSAvg=[0.5,10],DECAYED=False)\n```\n\n#### Objects catalogue query from CelesTrak\n\n```python\n>>> satcatlog = SatCatalog.celestrak_query(MEAN_ALT=[300,2000],ECC=[0.01,0.1],PAYLOAD=False)\n```\n\n### Objects catalogue query from combined database\n\n```python\n>>> satcatlog = SatCatalog.objects_query(DECAYED=False,RCSAvg=[0.25,10],MEAN_ALT=[250,2000],TLE_STATUS=True,sort='RCSAvg')\n```\n\n### Create object `SatCatlog` from a loacl .csv file\n\n```python\n>>> from satcatalogquery import SatCatalog\n>>> satcatlog = SatCatalog.from_csv('filename.csv')\n```\n\n### Statistics\n\n```python\n>>> satcatlog.hist1d('RCSAvg')\n>>> satcatlog.hist1d(['StdMag','LAUNCH_DATE'])\n>>> satcatlog.hist2d('MEAN_ALT','INCLINATION')\n>>> satcatlog.pie('LAUNCH_SITE',cutoff=100)\n```\n\n<p align=\"middle\">\n <img src=\"readme_figs/RCSAvg.png\" width=\"500\" />\n</p>\n\n<p align=\"middle\">\n <img src=\"readme_figs/StdMag_LAUNCH_DATE.png\" width=\"500\" />\n</p>\n\n<p align=\"middle\">\n <img src=\"readme_figs/MEAN_ALT-INCLINATION.png\" width=\"500\" />\n</p>\n\n<p align=\"middle\">\n <img src=\"readme_figs/LAUNCH_SITE.png\" width=\"500\" />\n</p>\n\n### Download TLE from Space-Track according to the results of objects catalogue query\n\n```python\n>>> tle_path = satcatlog.get_tle()\n```\n\n### Download TLE from Space-Track by Norad IDs\n\n```python\n>>> from satcatalogquery import download_tle\n>>> tle_file = download_tle([52132,51454,37637,26758,44691])\n>>> print(tle_file)\n```\n\nNext, you may be interested in [Data processing related to TLE files](https://github.com/lcx366/ORBDTOOLS#data-processing-related-to-tle-files).\n\n## Change log\n\n- **0.2.4 \u2014 Dec 08, 2023**\n \n - Fixed a bug where a newline character was appended to the end of the string when reading tokens from a file.\n - The download URL of qsmag.zip has been modified to solve the bug that caused the file download failure due to the original URL being invalid.\n\n- **0.2.3 \u2014 Sep 23, 2023**\n \n - Fixed the bug that when downloading TLE data from SpaceTrack, the automatically generated wrong authentication file due to incorrect user name or password input could no longer be updated.\n\n- **0.2.2 \u2014 Apr 24, 2023**\n \n - Change the method `.save()` to `.to_csv()` \n \n - Add methods `.discos_query()`, `.celestrak_query()`, `.objects_query()`to class SatCatalog\n \n - Change class `SatCatlog` to `SatCatalog` \n\n- **0.2.1 \u2014 Jan 4, 2023**\n \n - Add method `from_csv` and `pie` to class SatCatlog\n \n - Add statistics figures to README.md\n\n- **0.1.1 \u2014 Jan 2, 2023**\n \n - The ***satcatalogquery*** package was released.\n\n## Next Release\n\n- Added DISCOSweb API support for version [2.0.0](https://discosweb.esoc.esa.int/apidocs/v2).\n- Improve code structure and enrich technical documentation.\n\n# Reference\n\n- [DISCOSweb](https://discosweb.esoc.esa.int)\n- [CelesTrak](http://www.celestrak.com) and [SATCAT Format Documentation](https://celestrak.org/satcat/satcat-format.php)\n- [Space-Track](https://www.space-track.org/auth/login)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A package for querying orbital and geometric information of spatial objects",
"version": "0.2.4",
"project_urls": {
"Homepage": "https://github.com/lcx366/SATQUERY"
},
"split_keywords": [
"discos",
"celestrak",
"spacetrack",
"space debris"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0300c22773a8025f6502230f4419433e852ce32eba0f4731e00a80e5a26b2811",
"md5": "b715b8b976101aa1e0427abac68d45f5",
"sha256": "300af6d478ae1bbf04861141c369f27910313a511d03644b9308fde8da432ac6"
},
"downloads": -1,
"filename": "satcatalogquery-0.2.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b715b8b976101aa1e0427abac68d45f5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 19618,
"upload_time": "2023-12-08T14:26:45",
"upload_time_iso_8601": "2023-12-08T14:26:45.062842Z",
"url": "https://files.pythonhosted.org/packages/03/00/c22773a8025f6502230f4419433e852ce32eba0f4731e00a80e5a26b2811/satcatalogquery-0.2.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-08 14:26:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "lcx366",
"github_project": "SATQUERY",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "satcatalogquery"
}