org.orekit.forces.atmospheres.solarActivity
Class SolarActivityDataReader

java.lang.Object
  extended by org.orekit.forces.atmospheres.solarActivity.SolarActivityDataReader
All Implemented Interfaces:
DataLoader, SolarActivityDataProvider
Direct Known Subclasses:
ACSOLFormatReader, NOAAFormatReader

public abstract class SolarActivityDataReader
extends Object
implements DataLoader, SolarActivityDataProvider

Represents a basic solar activity file reader. This class puts in common the same methods used by solar activity file readers, and defines a common abstract class.

Since:
1.2
Version:
$Id: SolarActivityDataReader.java 17582 2017-05-10 12:58:16Z bignon $
Author:
Rami Houdroge
Concurrency :
not thread-safe
Concurrency comment :
instance is mutable

Field Summary
protected  boolean readCompleted
          Indicator for completed read.
 
Constructor Summary
protected SolarActivityDataReader(String supportedNames, TimeScale timescaleIn)
          Constructor.
 
Method Summary
protected  void addApKp(AbsoluteDate date, Double[][] apkp)
          Add a flux value
protected  void addF107(AbsoluteDate date, double f107)
          Add a flux value
 double getAp(AbsoluteDate date)
          Get Ap value at given user date
 AbsoluteDate getApKpMaxDate()
          Get maximum date of ap / kp values
 AbsoluteDate getApKpMinDate()
          Get minimum date of ap / kp values
 SortedMap<AbsoluteDate,Double[]> getApKpValues(AbsoluteDate date1, AbsoluteDate date2)
          Get ap / kp values between the given dates
 AbsoluteDate getFluxMaxDate()
          Get maximum date of flux values
 AbsoluteDate getFluxMinDate()
          Get minimum date of flux values
 double getInstantFluxValue(AbsoluteDate date)
          Get instant flux values at the given dates (possibly interpolated)
 SortedMap<AbsoluteDate,Double> getInstantFluxValues(AbsoluteDate date1, AbsoluteDate date2)
          Get raw instant flux values between the given dates
 double getKp(AbsoluteDate date)
          Get Kp value at given user date
 AbsoluteDate getMaxDate()
          Get maximum date at which both flux and ap values are available
 AbsoluteDate getMinDate()
          Get minimum date at which both flux and ap values are available
 String getSupportedNames()
          Get the regular expression for supported files names.
protected  boolean isEmpty()
          Chech if data map is empty
abstract  void loadData(InputStream input, String name)
          Load data from a stream.
 boolean stillAcceptsData()
          Check if the loader still accepts new data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

readCompleted

protected boolean readCompleted
Indicator for completed read.

Constructor Detail

SolarActivityDataReader

protected SolarActivityDataReader(String supportedNames,
                                  TimeScale timescaleIn)
Constructor.

Build an uninitialized reader.

Parameters:
supportedNames - regular expression for supported files names
timescaleIn - timescale used to compute time span between solar data. It should match time scale used in solar data definition
Method Detail

getApKpValues

public SortedMap<AbsoluteDate,Double[]> getApKpValues(AbsoluteDate date1,
                                                      AbsoluteDate date2)
Get ap / kp values between the given dates

Specified by:
getApKpValues in interface SolarActivityDataProvider
Parameters:
date1 - first date
date2 - second date
Returns:
submap of instant flux values sorted according to date

getInstantFluxValues

public SortedMap<AbsoluteDate,Double> getInstantFluxValues(AbsoluteDate date1,
                                                           AbsoluteDate date2)
Get raw instant flux values between the given dates

Specified by:
getInstantFluxValues in interface SolarActivityDataProvider
Parameters:
date1 - first date
date2 - second date
Returns:
submap of instant flux values sorted according to date

getInstantFluxValue

public double getInstantFluxValue(AbsoluteDate date)
Get instant flux values at the given dates (possibly interpolated) This is the default implementation for this method : it interpolates the flux values before or after

Specified by:
getInstantFluxValue in interface SolarActivityDataProvider
Parameters:
date - user date
Returns:
instant flux values

getAp

public double getAp(AbsoluteDate date)
Get Ap value at given user date

Specified by:
getAp in interface SolarActivityDataProvider
Parameters:
date - user date
Returns:
Ap value

getKp

public double getKp(AbsoluteDate date)
Get Kp value at given user date

Specified by:
getKp in interface SolarActivityDataProvider
Parameters:
date - user date
Returns:
Kp value

getMinDate

public AbsoluteDate getMinDate()
Get minimum date at which both flux and ap values are available

Specified by:
getMinDate in interface SolarActivityDataProvider
Returns:
a date

getMaxDate

public AbsoluteDate getMaxDate()
Get maximum date at which both flux and ap values are available

Specified by:
getMaxDate in interface SolarActivityDataProvider
Returns:
a date

getFluxMinDate

public AbsoluteDate getFluxMinDate()
Get minimum date of flux values

Specified by:
getFluxMinDate in interface SolarActivityDataProvider
Returns:
a date

getFluxMaxDate

public AbsoluteDate getFluxMaxDate()
Get maximum date of flux values

Specified by:
getFluxMaxDate in interface SolarActivityDataProvider
Returns:
a date

getApKpMinDate

public AbsoluteDate getApKpMinDate()
Get minimum date of ap / kp values

Specified by:
getApKpMinDate in interface SolarActivityDataProvider
Returns:
a date

getApKpMaxDate

public AbsoluteDate getApKpMaxDate()
Get maximum date of ap / kp values

Specified by:
getApKpMaxDate in interface SolarActivityDataProvider
Returns:
a date

stillAcceptsData

public boolean stillAcceptsData()
Check if the loader still accepts new data.

This method is used to speed up data loading by interrupting crawling the data sets as soon as a loader has found the data it was waiting for. For loaders that can merge data from any number of sources (for example JPL ephemerides or Earth Orientation Parameters that are split among several files), this method should always return true to make sure no data is left over.

Specified by:
stillAcceptsData in interface DataLoader
Returns:
true while the loader still accepts new data

loadData

public abstract void loadData(InputStream input,
                              String name)
                       throws IOException,
                              ParseException,
                              OrekitException
Load data from a stream.

Specified by:
loadData in interface DataLoader
Parameters:
input - data input stream
name - name of the file (or zip entry)
Throws:
IOException - if data can't be read
ParseException - if data can't be parsed
OrekitException - if some data is missing or if some loader specific error occurs

getSupportedNames

public String getSupportedNames()
Get the regular expression for supported files names.

Returns:
regular expression for supported files names

addF107

protected void addF107(AbsoluteDate date,
                       double f107)
Add a flux value

Parameters:
date - date of flux value
f107 - value of flux at date

addApKp

protected void addApKp(AbsoluteDate date,
                       Double[][] apkp)
Add a flux value

Parameters:
date - date of flux value
apkp - coefficients at date : double[2][8]

isEmpty

protected boolean isEmpty()
Chech if data map is empty

Returns:
true if it is


Copyright © 2017 CNES. All Rights Reserved.