saaps.dbt
Class BuildKp
java.lang.Object
|
+--saaps.dbt.BuildKp
- public class BuildKp
- extends java.lang.Object
The BuildKp
application will create the Kp database
from the text files in the directory kpdir
.
The text files have been downloaded from
ftp://ftp.ngdc.noaa.gov/STP/GEOMAGNETIC_DATA/INDICES/KP_AP/ . The
downloaded data starts from 1970. The application is run by typing
java BuildKp < kpdir& gt
where kpdir
is the directory of the Kp data.
- Version:
- 1.0
- Author:
- Peter Wintoft
Field Summary |
private java.util.Calendar |
cal
|
private java.lang.String |
kpDir
|
private java.util.Vector |
kpOneYear
|
Constructor Summary |
BuildKp(java.lang.String kpDir)
Create an object by specifying the base directory
of the Kp data. |
Method Summary |
int |
getFirstYear()
Get the year of the first Kp file. |
static void |
main(java.lang.String[] args)
The uses one argument to locate the directory
where the Kp text files are located. |
void |
parseKpData(java.lang.String text)
Parse a line of text and add Kp objects to the Kp vector. |
boolean |
readOneYearOfData(int year)
Read one year of data for the specified year. |
void |
run()
Run the application. |
void |
storeOneYearData()
Store one year of data into the SAAPS database. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
kpDir
private java.lang.String kpDir
kpOneYear
private java.util.Vector kpOneYear
cal
private java.util.Calendar cal
BuildKp
public BuildKp(java.lang.String kpDir)
- Create an object by specifying the base directory
of the Kp data.
- Parameters:
kpDir
- The base directory
run
public void run()
- Run the application.
getFirstYear
public int getFirstYear()
- Get the year of the first Kp file.
readOneYearOfData
public boolean readOneYearOfData(int year)
- Read one year of data for the specified year. If no file
exist for that year the method returns
false
.
- Parameters:
year
- The year of the data to be read.
parseKpData
public void parseKpData(java.lang.String text)
- Parse a line of text and add Kp objects to the Kp vector.
- Parameters:
text
- The string containing the Kp data.
// @returns The eight Kp objects for one day.
storeOneYearData
public void storeOneYearData()
- Store one year of data into the SAAPS database.
main
public static void main(java.lang.String[] args)
- The uses one argument to locate the directory
where the Kp text files are located. The file
names are assumed to be named according to the
year of the data, e.g. 1970, 1971, and so on.
- Parameters:
args
- A string array with the Kp directory
at the first element.