Class NsgfV00Filter
- java.lang.Object
-
- org.orekit.files.sp3.NsgfV00Filter
-
- All Implemented Interfaces:
DataFilter
public class NsgfV00Filter extends Object implements DataFilter
Filter for some non-official files from CDDIS.Some files produced by UKRI/NERC/British Geological Survey Space Geodesy Facility (SGF) claim to be SP3c but are really SP3d since they have more than 4 comments lines. This filter can be used to parse them.
- Since:
- 12.1
- See Also:
- SP3 precise orbit file is not compliant with SP3 format c (extra comment line)
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_V00_PATTERN
Default regular expression for NSGF V00 files.
-
Constructor Summary
Constructors Constructor Description NsgfV00Filter()
Simple constructor.NsgfV00Filter(String nameRegexp, Function<String,String> renaming)
Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataSource
filter(DataSource original)
Filter the data source.
-
-
-
Field Detail
-
DEFAULT_V00_PATTERN
public static final String DEFAULT_V00_PATTERN
Default regular expression for NSGF V00 files.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NsgfV00Filter
public NsgfV00Filter(String nameRegexp, Function<String,String> renaming)
Simple constructor.- Parameters:
nameRegexp
- regular expression matching file names to which filtering should be appliedrenaming
- function to apply for renaming files (and avoid the filter to be applied in infinite recursion)
-
NsgfV00Filter
public NsgfV00Filter()
Simple constructor.This uses
DEFAULT_V00_PATTERN
as the regular expression matching files that must be filtered, and replaces "v00" by "v70" to generate the filtered name.
-
-
Method Detail
-
filter
public DataSource filter(DataSource original) throws IOException
Filter the data source.Filtering is often based on suffix. For example a gzip compressed file will have an original name of the form base.ext.gz when the corresponding uncompressed file will have a filtered name base.ext.
A filter must never
open
theDataSource
by itself, regardless of the fact it will return the original instance or a filtered instance. The rationale is that it is the upper layer that will decide to open (or not) the returned value and that aDataSource
can be opened only once; this is the core principle of lazy-opening provided byDataSource
.Beware that as the
data providers manager
will attempt to pile all filters in a stack as long as their implementation of this method returns a value different from theoriginal
parameter. This implies that the filter, must perform some checks to see if it must be applied or not. If for example there is a need for a deciphering filter to be applied once to all data, then the filter should for example check for a suffix in thename
and create a new filteredDataSource
instance only if the suffix is present, removing the suffix from the filtered instance. Failing to do so and simply creating a filtered instance with one deciphering layer without changing the name would result in an infinite stack of deciphering filters being built, until a stack overflow or memory exhaustion exception occurs.- Specified by:
filter
in interfaceDataFilter
- Parameters:
original
- original data source- Returns:
- filtered data source, or
original
if this filter does not apply to this data source - Throws:
IOException
- if filtered stream cannot be created
-
-