Skip to content
Snippets Groups Projects
Commit dbcecd17 authored by Luc Maisonobe's avatar Luc Maisonobe
Browse files

Documentation.

parent 57a675c0
No related branches found
No related tags found
No related merge requests found
......@@ -51,10 +51,12 @@
}
interface DataSource.StreamOpener {
+InputStream openStream()
+InputStream openOnce()
}
note right
allows lazy opening of stream
beware it may fail if called more than once
especially with network-based streams
end note
DataProvider "*" -- "1" DataProvidersManager
......
......@@ -37,7 +37,7 @@ import java.nio.file.Paths;
* with resources} clause so closing is done properly even in case of exception</li>
* <li>if some pre-reading of the first few bytes are needed to decide how to
* load data (as in {@link org.orekit.files.ccsds.utils.lexical.LexicalAnalyzerSelector}),
* the the stream can be opened, buffer and rewound and a fake open method used
* then the stream can be opened, buffered and rewound and a fake open method used
* to return the already open stream so a {@code try with resources} clause
* elsewhere works properly for closing the stream</li>
* </ul>
......@@ -65,9 +65,6 @@ public class DataSource {
private final StreamOpener streamOpener;
/** Complete constructor.
* <p>
* WARNING! The {@code StreamOpener}
* </p>
* @param name data name
* @param streamOpener opener for the data stream
*/
......
......@@ -88,7 +88,7 @@ and by `LazyLoadedTimeScales` (for `UT1`). The `LazyLoadedFrames` also depends o
interface (for `ICRF`).
There are some static methods in the various factories (`TimeScales.of(...)`, `Frames.of(...)`
that create factories with preloaded constant data. These method are useful for
that create factories with preloaded constant data. These methods are useful for
users who need to implement their own data context.
## Using a context
......
......@@ -38,9 +38,14 @@ a way that it should check the `DataSource` passed to it and return its paramete
it should not filter it, or return a new `DataSource` if it considers is should filter it.
Checking is typically done using only the name and looking for files extensions, but it could as
well be made by opening temporarily the stream to read just the first few bytes to look for some
magic number and closing it afterwards, as the `DataSource` passed as a parameter has an `openStream`
method that can be called as many times as one wants.
well be made by opening the stream, wrap it into a `BufferedInputStream`, and read just the first
few bytes to look for some magic number in the buffered stream. If the magic number is found, the
buffered stream is reset to beginninf and a new data source is set p with its `openOnce` method
implemented as just returning the already open (and reset) buffered stream. This ensures that
the stream is really open only once, despite the first few bytes are read twice, once when looking
for the magic number and then by the parsert itself. An example of this process is available in
the `LexicalAnalyzerSelector` class in the `org.orekit.files.ccsds.utils.lexical` package where it
is used to detect XML files and select either the KV or XML parser for CCSDS files.
As `applyAllFilters` restarts its loop from the beginning each time a filter is added to the stack,
some care must be taken to avoid stacking an infinite number of instances of the same filter on top
......
......@@ -224,11 +224,12 @@ into `orekit-data` and add the following lines at the start of users programs:
DataProvidersManager manager = DataContext.getDefault().getDataProvidersManager();
manager.addProvider(new DirectoryCrawler(orekitData));
This zip file contains JPL DE 430 ephemerides from 1990
to 2069, IERS Earth orientation parameters from 1973 (both IAU-1980
This zip file contains JPL DE 440 ephemerides from 1990
to 2149, IERS Earth orientation parameters from 1973 (both IAU-1980
and IAU-2000), UTC-TAI history from 1972,
Marshall Solar Activity Futur Estimation from 1999,
the Eigen 06S gravity field and the FES 2004 ocean tides model.
the Eigen 06S gravity field and the FES 2004 ocean tides model and space weather data with
observed data from 1957 with predicted data up to 22 years in the future.
## Supported data types
......@@ -249,27 +250,26 @@ used up to 2009 and the new format used since 2010 are supported. The supported
for `finals2000A` files for IAU-2006/2000A and the finals files for IAU-1980 are both
the XML format and the columns format.
| default naming pattern | format | data type | source |
|--------------------------------------------------|--------------------|------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
| tai-utc.dat[.gz|.Z] | USNO tai-utc | leap seconds introduction history | [http://maia.usno.navy.mil/ser7/tai-utc.dat](http://maia.usno.navy.mil/ser7/tai-utc.dat) |
| UTC-TAI.history[.gz|.Z] | IERS history | leap seconds introduction history | [http://hpiers.obspm.fr/eoppc/bul/bulc/UTC-TAI.history](http://hpiers.obspm.fr/eoppc/bul/bulc/UTC-TAI.history) |
| bulletina-xxxx-\#\#\#.txt[.gz|.Z] | IERS Bulletin A | weekly Earth Orientation Parameters, IAU-1980 and IAU-2000, rapid service and prediction | [ftp://ftp.iers.org/products/eop/rapid/bulletina/](ftp://ftp.iers.org/products/eop/rapid/bulletina/) |
| bulletinb.\#\#\#[.gz|.Z] | IERS Bulletin B | monthly Earth Orientation Parameters model IAU 2006/2000A, final values | [ftp://ftp.iers.org/products/eop/bulletinb/format_2009/](ftp://ftp.iers.org/products/eop/bulletinb/format_2009/) |
| eopc04\_08\_IAU2000.\#\#[.gz|.Z] | IERS EOP 08 C04 | yearly Earth Orientation Parameters model IAU 2006/2000A for ITRF 2008 | [ftp://ftp.iers.org/products/eop/long-term/c04\_08/iau2000/](ftp://ftp.iers.org/products/eop/long-term/c04_08/iau2000/) |
| eopc04\_08.\#\#[.gz|.Z] | IERS EOP 08 C04 | yearly Earth Orientation Parameters model IAU 1980 for ITRF 2008 | [ftp://ftp.iers.org/products/eop/long-term/c04\_08/iau1980/](ftp://ftp.iers.org/products/eop/long-term/c04_08/iau1980/) |
| eopc04\_14\_IAU2000.\#\#[.gz|.Z] | IERS EOP 14 C04 | yearly Earth Orientation Parameters model IAU 2006/2000A for ITRF 2014 | [ftp://ftp.iers.org/products/eop/long-term/c04\_14/iau2000/](ftp://ftp.iers.org/products/eop/long-term/c04_14/iau2000/) |
| eopc04\_14.\#\#[.gz|.Z] | IERS EOP 14 C04 | yearly Earth Orientation Parameters model IAU 1980 for ITRF 2014 | [ftp://ftp.iers.org/products/eop/long-term/c04\_14/iau1980/](ftp://ftp.iers.org/products/eop/long-term/c04_14/iau1980/) |
| finals2000A.\*.[.gz|.Z] | IERS standard EOP | Earth Orientation Parameters model IAU 2006/2000A | [ftp://ftp.iers.org/products/eop/rapid/standard/finals2000A.all](ftp://ftp.iers.org/products/eop/rapid/standard/finals2000A.all) |
| finals.\*.[.gz|.Z] | IERS standard EOP | Earth Orientation Parameters model IAU 1980 | [ftp://ftp.iers.org/products/eop/rapid/standard/finals.all](ftp://ftp.iers.org/products/eop/rapid/standard/finals.all) |
| finals2000A.\*.xml[.gz|.Z] | IERS standard EOP | Earth Orientation Parameters model IAU 2006/2000A | [ftp://ftp.iers.org/products/eop/rapid/standard/xml/finals2000A.all.xml](ftp://ftp.iers.org/products/eop/rapid/standard/xml/finals2000A.all.xml) |
| finals.\*.xml[.gz|.Z] | IERS standard EOP | Earth Orientation Parameters model IAU 1980 | [ftp://ftp.iers.org/products/eop/rapid/standard/xml/finals.all.xml](ftp://ftp.iers.org/products/eop/rapid/standard/xml/finals.all.xml) |
| (l/u)nx(m/p)\#\#\#\#.4\#\#[.gz|.Z] | DE 4xx binary | JPL DE 4xx planets ephemerides | [ftp://ssd.jpl.nasa.gov/pub/eph/planets/Linux/](ftp://ssd.jpl.nasa.gov/pub/eph/planets/Linux/) |
| inpop\*_m\#\#\#\#_p\#\#\#\#*.dat[.gz|.Z] | DE 4xx binary | IMCCE inpop planets ephemerides | [ftp://ftp.imcce.fr/pub/ephem/planets/](ftp://ftp.imcce.fr/pub/ephem/planets/) |
| eigen\_\*\_coef[.gz|.Z] | SHM format | Eigen gravity field (old format) | [http://op.gfz-potsdam.de/grace/results/main\_RESULTS.html#gravity](http://op.gfz-potsdam.de/grace/results/main_RESULTS.html#gravity) |
| \*.gfc, g\#\#\#\_eigen\_\*\_coef[.gz|.Z] | ICGEM format | gravity fields from International Centre for Global Earth Models | [http://icgem.gfz-potsdam.de/ICGEM/modelstab.html](http://icgem.gfz-potsdam.de/ICGEM/modelstab.html) |
| egm\#\#\_to\#\*[.gz|.Z] | EGM format | EGM gravity field | [ftp://cddis.gsfc.nasa.gov/pub/egm96/general\_info](ftp://cddis.gsfc.nasa.gov/pub/egm96/general_info) |
| jan\#\#\#\#f10.txt to dec\#\#\#\#f10[_prd].txt[.gz|.Z] | MSAFE format | Marshall Solar Activity Future Estimation | [https://www.nasa.gov/msfcsolar/archivedforecast](https://www.nasa.gov/msfcsolar/archivedforecast) |
| CGIM\#\#\#0.\#\#N [.gz|.Z] | Bern Astronomical Institute format | Klobuchar coefficients | [ftp://ftp.aiub.unibe.ch/aiub/CODE/](ftp://ftp.aiub.unibe.ch/aiub/CODE/) |
| \*.blq[.gz|.Z] | Onsala Space Observatory BLQ format | ocean loading coefficients | [http://holt.oso.chalmers.se/loading/](http://holt.oso.chalmers.se/loading/) |
| itrf-versions.conf | Orekit itrf-versions.conf | Maps EOP files to ITRF versions | [Orekit Physical Data Archive](https://gitlab.orekit.org/orekit/orekit-data/-/archive/master/orekit-data-master.zip) |
| default naming pattern | format | data type | source |
|--------------------------------------------------|--------------------|------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
| tai-utc.dat[.gz|.Z] | USNO tai-utc | leap seconds introduction history | [http://maia.usno.navy.mil/ser7/tai-utc.dat](http://maia.usno.navy.mil/ser7/tai-utc.dat) offline as of 2021 |
| UTC-TAI.history[.gz|.Z] | IERS history | leap seconds introduction history | [http://hpiers.obspm.fr/eoppc/bul/bulc/UTC-TAI.history](http://hpiers.obspm.fr/eoppc/bul/bulc/UTC-TAI.history) |
| bulletina-xxxx-\#\#\#.txt[.gz|.Z] | IERS Bulletin A | weekly Earth Orientation Parameters, IAU-1980 and IAU-2000, rapid service and prediction | [https://www.iers.org/IERS/EN/DataProducts/EarthOrientationData/eop.html](https://www.iers.org/IERS/EN/DataProducts/EarthOrientationData/eop.html) |
| bulletinb.\#\#\#[.gz|.Z] | IERS Bulletin B | monthly Earth Orientation Parameters model IAU 2006/2000A, final values | [ftp://ftp.iers.org/products/eop/bulletinb/format_2009/](ftp://ftp.iers.org/products/eop/bulletinb/format_2009/) |
| eopc04\_\#\#\_IAU2000.\#\#[.gz|.Z] | IERS EOP xx C04 | yearly Earth Orientation Parameters model IAU 2006/2000A for ITRF 20xx | [https://hpiers.obspm.fr/eoppc/eop/](https://hpiers.obspm.fr/eoppc/eop/) |
| eopc04\_\#\#.\#\#[.gz|.Z] | IERS EOP xx C04 | yearly Earth Orientation Parameters model IAU 1980 for ITRF 20xx | [https://hpiers.obspm.fr/eoppc/eop/](https://hpiers.obspm.fr/eoppc/eop/) |
| finals2000A.\*.[.gz|.Z] | IERS standard EOP | Earth Orientation Parameters model IAU 2006/2000A | [https://datacenter.iers.org/data/9/finals2000A.all](https://datacenter.iers.org/data/9/finals2000A.all) |
| finals.\*.[.gz|.Z] | IERS standard EOP | Earth Orientation Parameters model IAU 1980 | [https://datacenter.iers.org/data/7/finals.all](https://datacenter.iers.org/data/7/finals.all) |
| finals2000A.\*.xml[.gz|.Z] | IERS standard EOP | Earth Orientation Parameters model IAU 2006/2000A | [ftp://ftp.iers.org/products/eop/rapid/standard/xml/finals2000A.all.xml](ftp://ftp.iers.org/products/eop/rapid/standard/xml/finals2000A.all.xml) |
| finals.\*.xml[.gz|.Z] | IERS standard EOP | Earth Orientation Parameters model IAU 1980 | [ftp://ftp.iers.org/products/eop/rapid/standard/xml/finals.all.xml](ftp://ftp.iers.org/products/eop/rapid/standard/xml/finals.all.xml) |
| (l/u)nx(m/p)\#\#\#\#.4\#\#[.gz|.Z] | DE 4xx binary | JPL DE 4xx planets ephemerides | [ftp://ssd.jpl.nasa.gov/pub/eph/planets/Linux/](ftp://ssd.jpl.nasa.gov/pub/eph/planets/Linux/) |
| inpop\*_m\#\#\#\#_p\#\#\#\#*.dat[.gz|.Z] | DE 4xx binary | IMCCE inpop planets ephemerides | [ftp://ftp.imcce.fr/pub/ephem/planets/](ftp://ftp.imcce.fr/pub/ephem/planets/) |
| eigen\_\*\_coef[.gz|.Z] | SHM format | Eigen gravity field (old format) | [http://op.gfz-potsdam.de/grace/results/main\_RESULTS.html#gravity](http://op.gfz-potsdam.de/grace/results/main_RESULTS.html#gravity) |
| \*.gfc, g\#\#\#\_eigen\_\*\_coef[.gz|.Z] | ICGEM format | gravity fields from International Centre for Global Earth Models | [http://icgem.gfz-potsdam.de/ICGEM/modelstab.html](http://icgem.gfz-potsdam.de/ICGEM/modelstab.html) |
| egm\#\#\_to\#\*[.gz|.Z] | EGM format | EGM gravity field | [ftp://cddis.gsfc.nasa.gov/pub/egm96/general\_info](ftp://cddis.gsfc.nasa.gov/pub/egm96/general_info) |
| jan\#\#\#\#f10.txt to dec\#\#\#\#f10[_prd].txt[.gz|.Z] | MSAFE format | Marshall Solar Activity Future Estimation | [https://www.nasa.gov/msfcsolar/archivedforecast](https://www.nasa.gov/msfcsolar/archivedforecast) |
| CGIM\#\#\#0.\#\#N [.gz|.Z] | Bern Astronomical Institute format | Klobuchar coefficients | [ftp://ftp.aiub.unibe.ch/aiub/CODE/](ftp://ftp.aiub.unibe.ch/aiub/CODE/) |
| \*.blq[.gz|.Z] | Onsala Space Observatory BLQ format | ocean loading coefficients | [http://holt.oso.chalmers.se/loading/](http://holt.oso.chalmers.se/loading/) |
|SpaceWeather-All-v1.2.tx | CSSI format | space weather | [ftp://ftp.agi.com/pub/DynamicEarthData/SpaceWeather-All-v1.2.txt](ftp://ftp.agi.com/pub/DynamicEarthData/SpaceWeather-All-v1.2.txt) |
| itrf-versions.conf | Orekit itrf-versions.conf | Maps EOP files to ITRF versions | [Orekit Physical Data Archive](https://gitlab.orekit.org/orekit/orekit-data/-/archive/master/orekit-data-master.zip) |
Supported data types
......@@ -65,7 +65,7 @@ filters are checked (only one filter shown in the diagram), and all of them decl
on the file, so they all return the same `DataSource` that was created for the raw file.
At the end of the filters loop, the name (which is still `tai-utc.dat`) is checked against the
expected pattern. As it does not match, the stack composed of only one `DataSource` is discarded.
During all checks, the file as not been opened at all, only its name has been considered.
During all checks, the file has not been opened at all, only its name has been considered.
The `DirectoryCrawler` then considers the next directory, and in this directory the next
file which is `may2019f10_prd.txt.gz`. A new `DataSource` is created for it and the filters are
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment