mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-09-03 03:17:59 +00:00
skyplot: make constellation(s) to be plot configurable
This commit is contained in:
@@ -24,6 +24,7 @@ showing satellite visibility over time.
|
|||||||
- Plots satellite tracks in azimuth-elevation coordinates.
|
- Plots satellite tracks in azimuth-elevation coordinates.
|
||||||
- Elevation mask set to 5°, configurable via the `--elev-mask` flag.
|
- Elevation mask set to 5°, configurable via the `--elev-mask` flag.
|
||||||
- Color-codes satellites by constellation (GPS, Galileo, GLONASS, BeiDou).
|
- Color-codes satellites by constellation (GPS, Galileo, GLONASS, BeiDou).
|
||||||
|
- Constellations to plot can be configured via the `--system` flag.
|
||||||
- Customizable observer location.
|
- Customizable observer location.
|
||||||
- Outputs high-quality image in PDF format.
|
- Outputs high-quality image in PDF format.
|
||||||
- Non-interactive mode for CI jobs (with `--no-show` flag).
|
- Non-interactive mode for CI jobs (with `--no-show` flag).
|
||||||
@@ -40,7 +41,7 @@ showing satellite visibility over time.
|
|||||||
### Basic Command
|
### Basic Command
|
||||||
|
|
||||||
```
|
```
|
||||||
./skyplot.py <RINEX_FILE> [LATITUDE] [LONGITUDE] [ALTITUDE] [--use-obs] [--elev-mask] [--no-show]
|
./skyplot.py <RINEX_FILE> [LATITUDE] [LONGITUDE] [ALTITUDE] [--use-obs] [--elev-mask] [--system ...] [--no-show]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Arguments
|
### Arguments
|
||||||
@@ -52,6 +53,8 @@ showing satellite visibility over time.
|
|||||||
| `LONGITUDE` | Optional | degrees (°) | East/West position | 1.9876°E |
|
| `LONGITUDE` | Optional | degrees (°) | East/West position | 1.9876°E |
|
||||||
| `ALTITUDE` | Optional | meters (m) | Height above sea level | 80.0 m |
|
| `ALTITUDE` | Optional | meters (m) | Height above sea level | 80.0 m |
|
||||||
| `--use-obs` | Optional | - | Use RINEX obs data | - |
|
| `--use-obs` | Optional | - | Use RINEX obs data | - |
|
||||||
|
| `--elev-mask` | Optional | degrees (°) | Elevation mask | 5° |
|
||||||
|
| `--system` | Optional | - | Systems to plot | All |
|
||||||
| `--no-show` | Optional | - | Do not show plot | - |
|
| `--no-show` | Optional | - | Do not show plot | - |
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
@@ -73,6 +76,14 @@ showing satellite visibility over time.
|
|||||||
```
|
```
|
||||||
./skyplot.py brdc0010.22n -33.4592 -70.6453 520.0 --no-show
|
./skyplot.py brdc0010.22n -33.4592 -70.6453 520.0 --no-show
|
||||||
```
|
```
|
||||||
|
- Only plot GPS and Galileo satellites:
|
||||||
|
```
|
||||||
|
./skyplot.py brdc0010.22n -33.4592 -70.6453 520.0 --system GPS Galileo
|
||||||
|
```
|
||||||
|
or
|
||||||
|
```
|
||||||
|
./skyplot.py brdc0010.22n -33.4592 -70.6453 520.0 --system G E
|
||||||
|
```
|
||||||
|
|
||||||
## Output
|
## Output
|
||||||
|
|
||||||
|
@@ -517,6 +517,17 @@ def plot_satellite_tracks(satellites, obs_lat, obs_lon, obs_alt,
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Generate the skyplot"""
|
"""Generate the skyplot"""
|
||||||
|
# Set system names and codes
|
||||||
|
system_name_to_code = {
|
||||||
|
'GPS': 'G',
|
||||||
|
'GLONASS': 'R',
|
||||||
|
'GALILEO': 'E',
|
||||||
|
'BEIDOU': 'C',
|
||||||
|
'QZSS': 'J',
|
||||||
|
'IRNSS': 'I',
|
||||||
|
'SBAS': 'S'
|
||||||
|
}
|
||||||
|
|
||||||
# Set up argument parser
|
# Set up argument parser
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description='Generate GNSS skyplot from RINEX navigation file',
|
description='Generate GNSS skyplot from RINEX navigation file',
|
||||||
@@ -540,17 +551,22 @@ def main():
|
|||||||
'--elev-mask', type=float, default=5.0,
|
'--elev-mask', type=float, default=5.0,
|
||||||
help='Elevation mask in degrees for plotting satellite tracks (default: 5°)'
|
help='Elevation mask in degrees for plotting satellite tracks (default: 5°)'
|
||||||
)
|
)
|
||||||
|
# Add the system flag.
|
||||||
|
parser.add_argument(
|
||||||
|
'--system',
|
||||||
|
nargs='+',
|
||||||
|
help='Only plot satellites from these systems (e.g., G R E or GPS Galileo GLONASS)'
|
||||||
|
)
|
||||||
# Parse known args (this ignores other positional args)
|
# Parse known args (this ignores other positional args)
|
||||||
args, remaining_args = parser.parse_known_args()
|
args, remaining_args = parser.parse_known_args()
|
||||||
|
|
||||||
# Handle help manually
|
# Handle help manually
|
||||||
if '-h' in remaining_args or '--help' in remaining_args:
|
if '-h' in remaining_args or '--help' in remaining_args:
|
||||||
print("""
|
print("""
|
||||||
Usage: python skyplot.py <RINEX_FILE> [LATITUDE] [LONGITUDE] [ALTITUDE] [--use-obs] [--elev-mask] [--no-show]
|
Usage: python skyplot.py <RINEX_FILE> [LATITUDE] [LONGITUDE] [ALTITUDE] [--use-obs] [--elev-mask] [--system ...] [--no-show]
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
python skyplot.py brdc0010.22n 41.275 1.9876 80.0 --use-obs --no-show --elev-mask=10
|
python skyplot.py brdc0010.22n 41.275 1.9876 80.0 --use-obs --no-show --elev-mask=10 --system GPS Galileo
|
||||||
""")
|
""")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
@@ -587,6 +603,21 @@ Example:
|
|||||||
print("No satellite data found in the file.")
|
print("No satellite data found in the file.")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if args.system:
|
||||||
|
systems_upper = set()
|
||||||
|
for s in args.system:
|
||||||
|
s_upper = s.upper()
|
||||||
|
if s_upper in system_name_to_code:
|
||||||
|
systems_upper.add(system_name_to_code[s_upper])
|
||||||
|
else:
|
||||||
|
systems_upper.add(s_upper) # Assume user passed the code
|
||||||
|
|
||||||
|
satellites = {prn: eph_list for prn, eph_list in satellites.items() if prn[0].upper() in systems_upper}
|
||||||
|
|
||||||
|
if not satellites:
|
||||||
|
print(f"No satellites found for systems: {', '.join(sorted(systems_upper))}")
|
||||||
|
return
|
||||||
|
|
||||||
# Print summary information
|
# Print summary information
|
||||||
all_epochs = sorted(list(set(
|
all_epochs = sorted(list(set(
|
||||||
e['epoch'] for prn, ephemerides in satellites.items() for e in ephemerides
|
e['epoch'] for prn, ephemerides in satellites.items() for e in ephemerides
|
||||||
|
Reference in New Issue
Block a user