Package edu.gsu.cs.dmlab.databases
Class HelioviewerPullingAIAImageDBConnection
- java.lang.Object
-
- edu.gsu.cs.dmlab.databases.NonCacheImageDBConnection
-
- edu.gsu.cs.dmlab.databases.ImageDBConnection
-
- edu.gsu.cs.dmlab.databases.HelioviewerPullingAIAImageDBConnection
-
- All Implemented Interfaces:
ISTImageDBConnection
public class HelioviewerPullingAIAImageDBConnection extends ImageDBConnection
This class extends theImageDBConnection
to pull images that are not in the database already, from the Helioviewer API. It then converts the downloaded image from the JP2 format that is provided by the Helioviewer API to a JPEG format that is stored in the database that this class is connected to.- Author:
- Dustin Kempton, Data Mining Lab, Georgia State University
-
-
Field Summary
Fields Modifier and Type Field Description static String
certificateString
-
Constructor Summary
Constructors Constructor Description HelioviewerPullingAIAImageDBConnection(DataSource dsourc, IImageDBCreator creator, IImgParamNormalizer normalizer, org.slf4j.Logger logger, int maxCacheSize)
Constructor that assumes default values for parameter down sample and the number of parameters for each image cell.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finalize()
BufferedImage
getFirstFullImage(org.joda.time.Interval period, Waveband wavelength)
Gets the first full resolution image in the database that happens after the start time of the input interval, at a given wavelength.BufferedImage
getFullImgForId(org.joda.time.Interval period, int id)
Gets the full resolution image in the month that the period begins that has the passed in id value.boolean
readFileTypeBox(byte[] byteBuffer, int pos)
This method reads the File Type box.int
readInt(byte[] byteBuffer, int pos)
Reads a signed int (i.e., 32 bit) from the input.-
Methods inherited from class edu.gsu.cs.dmlab.databases.ImageDBConnection
getImageParamForWave
-
Methods inherited from class edu.gsu.cs.dmlab.databases.NonCacheImageDBConnection
getFirstImage, getFirstImageSparseVectForId, getHeaderForId, getImageIdsForInterval, getImageParamForEv, getImageParamForId, getImageSparseVectForId, getImgForId
-
-
-
-
Field Detail
-
certificateString
public static String certificateString
-
-
Constructor Detail
-
HelioviewerPullingAIAImageDBConnection
public HelioviewerPullingAIAImageDBConnection(DataSource dsourc, IImageDBCreator creator, IImgParamNormalizer normalizer, org.slf4j.Logger logger, int maxCacheSize)
Constructor that assumes default values for parameter down sample and the number of parameters for each image cell. Those values are a division by 64 for all coordinates of input events, and 10 image parameters per cell location.- Parameters:
dsourc
- The data source connection that is used to connect to the database.creator
- The image DB creator object used to insert images and metadata into the tables used to store this information.normalizer
- The image parameter normalizer, can be null, and if it is, then no normalization is performed on the parameters before return. Else, parameters are normalized prior to return using this object.logger
- Logger used to report errors that occurred while processing data requests.maxCacheSize
- The number of input event and wavelength pairs to cache the image parameter cube for before replacing with LRU ordering.
-
-
Method Detail
-
finalize
public void finalize() throws Throwable
- Overrides:
finalize
in classImageDBConnection
- Throws:
Throwable
-
getFirstFullImage
public BufferedImage getFirstFullImage(org.joda.time.Interval period, Waveband wavelength) throws SQLException, IOException
Description copied from interface:ISTImageDBConnection
Gets the first full resolution image in the database that happens after the start time of the input interval, at a given wavelength.- Specified by:
getFirstFullImage
in interfaceISTImageDBConnection
- Overrides:
getFirstFullImage
in classNonCacheImageDBConnection
- Parameters:
period
- The period to start the search from.wavelength
- The wavelength of Image we wish to get.- Returns:
- The first image starting after the period begin time.
- Throws:
SQLException
- If something went wrong with the server.IOException
- If something went wrong with the decoding of the image.
-
getFullImgForId
public BufferedImage getFullImgForId(org.joda.time.Interval period, int id) throws SQLException, IOException
Description copied from interface:ISTImageDBConnection
Gets the full resolution image in the month that the period begins that has the passed in id value.- Specified by:
getFullImgForId
in interfaceISTImageDBConnection
- Overrides:
getFullImgForId
in classNonCacheImageDBConnection
- Parameters:
period
- The month in which to get the image.id
- The id associated with the image we wish to get.- Returns:
- The buffered image with the given id from the given month.
- Throws:
SQLException
- If something went wrong with the server.IOException
- If something went wrong with decoding of the image
-
readInt
public final int readInt(byte[] byteBuffer, int pos)
Reads a signed int (i.e., 32 bit) from the input. Prior to reading, the input should be realigned at the byte level.- Returns:
- The next byte-aligned signed int (32 bit) from the input.
-
readFileTypeBox
public boolean readFileTypeBox(byte[] byteBuffer, int pos)
This method reads the File Type box.- Returns:
- false if the File Type box was not found or invalid else true
- Throws:
IOException
- If an I/O error occurred.EOFException
- If the end of file was reached
-
-