spinifex.ionospheric.tomion_parser
Module to parse the UPC-Ionsat tomion data format
Attributes
Classes
Object containing all necessary information from Tomion data |
Functions
|
download and convert tomion file to readable nefull text file or if the file already exists |
|
helper function to get the relevant information from the large tomion file. |
|
reads a tomion format file and returns a TomionData object |
|
helper function to get the url of the tomion data |
extracts electron densities for the two TOMION_HEIGHTS for all times in ipp. The returned array |
|
|
download tomion data for all unique days |
|
Interpolate tomion data to the requested lons/lats/times |
Module Contents
- class spinifex.ionospheric.tomion_parser.TomionData[source]
Bases:
NamedTupleObject containing all necessary information from Tomion data
- async spinifex.ionospheric.tomion_parser._download_tomion_file(url: str, nefull_name: str, tomion_options: spinifex.ionospheric.tec_data.TomionOptions | None = None, timeout_seconds: int = 30, chunk_size: int = 1000) pathlib.Path[source]
download and convert tomion file to readable nefull text file or if the file already exists just return a pointer to the file
Parameters
- urlstr
url of the file to download
- nefull_namestr
name of the extracted nefull file
- tomion_optionsTomionOptions | None, optional
options for the ionospheric model, by default None
- timeout_secondsint, optional
time out for downloading, by default 30
- chunk_sizeint, optional
chunksize for downloading, by default 1000
Returns
- Path
pointer to the nefull file
Raises
- IonexError
error if the download times out
- async spinifex.ionospheric.tomion_parser._extract_nefull(tomion_file: pathlib.Path, output_file: pathlib.Path, search_term: str = 'NeFull') pathlib.Path[source]
helper function to get the relevant information from the large tomion file. Deletes the tomion file if the extraction was successful
Parameters
- tomion_filePath
pointer to the tomion file
- output_filePath
name of the nefull file
- search_termstr, optional
the indicator for useful data in the tomion file, by default “NeFull”
Returns
- Path
pointer to the nefull file
- spinifex.ionospheric.tomion_parser._read_tomion(fname: pathlib.Path) TomionData[source]
reads a tomion format file and returns a TomionData object
Parameters
- fnamePath
filename
Returns
- TomionData
object with data and axes of the data
- spinifex.ionospheric.tomion_parser._tomion_format(time: astropy.time.Time) tuple[str, str][source]
helper function to get the url of the tomion data
Parameters
- timeTime
day for which to get the url
Returns
- tuple[Any, Any]
url and the name how the data will be stored on disc
- spinifex.ionospheric.tomion_parser.get_density_dual_layer(ipp: spinifex.geometry.IPP, tomion_options: spinifex.ionospheric.tec_data.TomionOptions | None = None) spinifex.ionospheric.tec_data.ElectronDensity[source]
extracts electron densities for the two TOMION_HEIGHTS for all times in ipp. The returned array will have zeros every where apart from the two altitudes closest to TOMION_HEIGHTS
Parameters
- ippIPP
input piercepoint locations
- tomion_optionsTomionOptions | None, optional
optional ionospheric model options, by default None
Returns
- ElectronDensity
object with arrays of tec and tec_rms values for every entry in ipp
Raises
- FileNotFoundError
error if the tomion files are not available locally nor online
- async spinifex.ionospheric.tomion_parser.get_tomion_paths_coro(unique_days: astropy.time.Time, tomion_options: spinifex.ionospheric.tec_data.TomionOptions | None = None) list[pathlib.Path][source]
download tomion data for all unique days
Parameters
- unique_daysTime
days for which to download data
- tomion_optionsTomionOptions | None, optional
options for the tomion model, by default None
Returns
- list[Any]
list of paths to the files
- spinifex.ionospheric.tomion_parser.interpolate_tomion(tomion: TomionData, lons: numpy.typing.NDArray[numpy.float64], lats: numpy.typing.NDArray[numpy.float64], times: astropy.time.Time, apply_earth_rotation: float = 1, get_rms: bool = False) numpy.typing.NDArray[numpy.float64][source]
Interpolate tomion data to the requested lons/lats/times
Parameters
- tomionTomionData
data object
- lonsNDArray[np.float64]
array of longitudes at the two TOMION_HEIGHTS, shape (2,)
- latsNDArray[np.float64]
array of latitudes at the two TOMION_HEIGHTS, shape (2,)
- timesTime
time
- apply_earth_rotationfloat, optional
specify (with a number between 0 and 1) how much of the earth rotation is taken in to account in the interpolation step., by default 1
- get_rmsbool, optional
use rms values instead of tec values
Returns
- NDArray[np.float64]
electron density values at two TOMION_HEIGHTS, shape (2,)