Range-Time Interval Plots¶
This function provides a powerful mechanism for targeted analysis of ionospheric data by allowing users to isolate specific frequency and range windows of interest for a chosen propagation mode (O or X). The implications are significant for research and monitoring: scientists can efficiently extract and visualize relevant signal characteristics (power and noise) from large datasets, facilitating the study of specific ionospheric phenomena, tracking layer movements, or assessing radio communication conditions within defined parameters. By automating the data filtering, processing, and visualization steps, it streamlines the workflow for identifying trends, disturbances, or features like Sporadic E layers or F-region traces within the ionosphere.
Method: DataSource.extract_FTI_RTI¶
This method extracts Frequency-Time-Intensity (FTI) and Range-Time-Intensity (RTI) data from a collection of datasets (presumably ionosonde measurements). It filters the data based on specified frequency and range limits, processes it into a Pandas DataFrame, and generates a plot visualizing the selected data.
Parameters¶
| Parameter | Type | Default Value | Description |
|---|---|---|---|
folder |
str |
"tmp/" |
The directory path where the generated plot image will be saved. |
rlim |
List[float] |
[50, 800] |
A list containing two float values representing the minimum and maximum range limits (in km) for filtering. |
flim |
List[float] |
[3.95, 4.05] |
A list containing two float values representing the minimum and maximum frequency limits (in MHz) for filtering. |
mode |
str |
"O" |
Specifies the propagation mode to extract data for (e.g., "O" for Ordinary, "X" for Extraordinary). This string is used to access attributes like "{mode}_mode_power" and "{mode}_mode_noise" from the dataset objects. |
index |
int |
0 |
An integer index used as a prefix for the output plot filename. |
Returns¶
| Type | Description |
|---|---|
pd.DataFrame |
A Pandas DataFrame (rti) containing the filtered and aggregated FTI/RTI data. The DataFrame includes columns for time, frequency (MHz), range (km), and mode-specific power (dB) and noise (dB). |
Processing Steps¶
-
Initialization:
- Logs the extraction parameters (
flim,rlim). - Initializes an empty Pandas DataFrame
rtito store the combined results.
- Logs the extraction parameters (
-
Iterate Through Datasets:
- The method iterates through each dataset object (
ds) available inself.datasets. - For each dataset:
- Constructs a
datetimeobject (time) from the dataset's year, month, day, hour, minute, and second attributes. - Logs the current processing
time. - Creates 2D meshgrids for
frequency(fromds.Frequency) andrange(fromds.Range). - Creates a 2D meshgrid for
noiseusing the attribute specified by themodeparameter (e.g.,ds.O_mode_noise). - Initializes a temporary Pandas DataFrame
o. - Populates DataFrame
owith the following columns by flattening the meshgrid arrays:frequency: Frequency values, converted from Hz to MHz (frequency.ravel() / 1e3).range: Range values in km (range.ravel()).{mode}_mode_power: Power values in dB, accessed dynamically usinggetattr(ds, f"{mode}_mode_power").ravel().{mode}_mode_noise: Noise values in dB, accessed dynamically (noise.ravel()).time: Thedatetimeobject constructed for the current dataset.
- Filtering: If
rlimandflimboth contain two elements (indicating valid min/max limits), the DataFrameois filtered:- Ranges are kept if
rlim[0] <= o.range <= rlim[1]. - Frequencies are kept if
flim[0] <= o.frequency <= flim[1].
- Ranges are kept if
- Concatenation: The filtered DataFrame
ois concatenated to the mainrtiDataFrame.
- Constructs a
- The method iterates through each dataset object (
-
Plot Generation and Saving:
- Filename Construction: A filename
fnameis generated for the plot image. It includes:- The
indexparameter. - The URSI code from the last processed dataset (
ds.URSI). - The minimum and maximum timestamps from the
rtiDataFrame, formatted. - The
modeparameter. - Example:
0_XXYYY_20230101.1200-1205_O-mode.png
- The
- Figure Title Construction: A
fig_titleis created for the plot. It includes:- URSI code and time range.
- Date.
- The selected frequency range (
flim).
- Ionogram Plotting:
- An
Ionogramobjectiis instantiated with the generatedfig_title. - The
add_interval_plotsmethod of theIonogramobject is called with thertiDataFrame,mode, andrlim(asylim) to generate the plot. - The plot is saved to the specified
folderwith the generatedfnameusingi.save(). - The plot figure is closed using
i.close().
- An
- Filename Construction: A filename
-
Return Value:
- The aggregated and filtered
rtiDataFrame is returned.
- The aggregated and filtered
Dependencies¶
pandas(aspd): For DataFrame manipulation.numpy(asnp): For numerical operations, especiallymeshgrid.datetime(asdtfrom thedatetimemodule): For handling time information.os: For path joining when saving the figure.logging(presumably aloggerobject is configured elsewhere): For logging informational messages.Ionogramclass: An external or custom class used for plotting ionogram-style data.
Assumed Class Structure¶
This method is part of a class that has:
* DataSource.datasets: An iterable collection of dataset objects. Each dataset object (ds) is expected to have attributes like year, month, day, hour, minute, second, Frequency, Range, URSI, and mode-specific power and noise attributes (e.g., O_mode_power, O_mode_noise).
Example Usage (Conceptual)¶
```python
'DataSource' is an instance of the class containing extract_FTI_RTI¶
and 'processor.datasets' is populated.¶
data_processor = DataSource(...)
... populate data_processor.datasets ...¶
Extract O-mode data for a specific frequency and range, save plot in "output_plots"¶
rti_data = data_processor.extract_FTI_RTI( folder="output_plots/", rlim=[100, 500], # Range: 100 km to 500 km flim=[4.5, 5.5], # Frequency: 4.5 MHz to 5.5 MHz mode="O", index=1 )
print(rti_data.head())
