import georinex as gr import matplotlib.pyplot as plt import numpy as np from datetime import datetime import pandas as pd # Read the RINEX file rinex_file = '96813390_small.24O' data = gr.load(rinex_file) # Get available GPS satellites, start with 'G' available_sats = [sv for sv in data.sv.values if sv.startswith('G')] # Extract GPS pseudorange data gps_data = data.sel(sv=available_sats) # For now, get only the C1C pseudorange data c1c_data = gps_data['C1C'].dropna(dim='sv', how='all') # Convert time index to datetime times = c1c_data.time.values satellites = c1c_data.sv.values # Create the plot plt.figure(figsize=(15, 10)) # Plot each satellite's pseudorange for sat in satellites: sat_data = c1c_data.sel(sv=sat) valid_data = sat_data.dropna(dim='time') if len(valid_data) > 0: # Only plot if we have valid data plt.plot(valid_data.time, valid_data.values, label=sat, marker='.', linestyle='-', markersize=2) # Customize the plot plt.title('GPS Pseudorange Measurements (C1C)', fontsize=14) plt.xlabel('Time (UTC)', fontsize=12) plt.ylabel('Pseudorange', fontsize=12) plt.grid(True, linestyle='--', alpha=0.7) plt.legend(bbox_to_anchor=(1.05, 1), loc='upper left') plt.tight_layout() # Rotate x-axis labels for better readability plt.xticks(rotation=45) # Show the plot plt.show() # Print some basic statistics print("\nBasic Statistics for GPS Pseudorange Measurements:") print("Number of GPS satellites observed:", len(satellites)) print("Observation period:", times[0], "to", times[-1]) print("\nPseudorange ranges for each satellite:") for sat in satellites: sat_data = c1c_data.sel(sv=sat).dropna(dim='time') if len(sat_data) > 0: print(f"{sat}: {sat_data.min().values:.2f} - {sat_data.max().values:.2f} meters") # Optionally, print available satellites print("\nAvailable GPS satellites:", available_sats)