public class OdStoIF
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
BYTE |
static int |
DELETE_ERROR |
static int |
EOF_ABRUPT |
static int |
EOF_NOMINAL |
static int |
FILE_ALREADY_EXISTS |
static int |
FR_NOT_INITIALISED |
static int |
GIGABYTE |
static int |
INVALID_FILTER_IDENTIFIER |
static int |
INVALID_PROPERTY_FORMAT |
static int |
IOEXCEPTION |
static int |
IS_EMPTY |
static int |
IS_NOT_EMPTY |
static int |
KILOBYTE |
static int |
MEGABYTE |
static int |
NIR_FILTER |
static int |
NOT_A_DIRECTORY |
static int |
NOT_A_FILE |
static int |
NOT_FOUND |
static int |
OUT_OF_BOUNDS |
static int |
RED_FILTER |
static int |
SUCCESS |
static int |
TERABYTE |
static int |
UNRESOLVED_ERROR |
static int |
WRONG_INPUT_FORMAT |
| Constructor and Description |
|---|
OdStoIF()
Class constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
CloseFramesReader()
Terminates the access to the chunk
|
TimePoint |
convertTimestampToDateTime(double timestampFreq,
TimePoint timestampZeroPoint,
long timestampZero)
Converts the timestamp from the header into a TimePoint object (date/time).
|
boolean |
createDirectory(java.lang.String dirname)
Creates the directory within the specified path.
|
boolean |
createFile(java.lang.String filename)
Creates the directory with the specified path.
|
int |
deleteDirectory(java.lang.String dirname,
boolean deleteIfNotEmpty)
Deletes a directory from the storage.
|
int |
deleteFile(java.lang.String filename)
Deletes a file from the storage.
|
boolean |
directoryExists(java.lang.String dirname)
Informs whether a directory exists within the specified path.
|
boolean |
fileExists(java.lang.String filename)
Informs whether a file exists within the specified path.
|
java.lang.String |
getCodeStr(int code)
Get a string definition of the provided code.
|
java.util.ArrayList<java.lang.String> |
GetContents(java.lang.String directoryName)
Gets a listing of the contents of a directory
|
java.util.ArrayList<java.lang.String> |
GetContentsByExtension(java.lang.String directoryName,
java.lang.String extension)
Gets a listing of the files with the specified extension.
|
java.util.ArrayList<java.lang.String> |
GetContentsByFilter(java.lang.String directoryName,
int filter)
Gets a listing of the contents of a directory, by applying a filter to get the chunks that correspond to a specific filter
|
double |
getDirectorySize(java.io.File dir,
int unit) |
double |
getDirectorySize(java.lang.String path,
int unit) |
java.lang.String |
getFilenameNoExtension(java.lang.String filename) |
double |
getFileSize(java.lang.String path,
int unit)
Gets the size of the file.
|
java.util.ArrayList<java.lang.String> |
getFitsFilesByFilter(java.lang.String directoryName,
int filter)
Gets a listing of the FITS files that exist in a directory that contain the frames of the specified filter.
|
AndorFrameHeader |
getLastHeader()
Returns the last header that has been read (should also check the hasValidHeader in order to use it)
|
long |
getLastTimestamp()
Returns the ticks that have been read from the camera frame header, or -1 if the header is not valid / has not been read.
|
java.lang.String |
getMessage()
Get a message of the last ReadFrame action.
|
java.lang.String |
getNameFromPath(java.lang.String path)
Extracts the name of the folder or the directory from the specified path.
|
int |
getNumberOfFrames(java.lang.String path)
Gets an approximation of the number of frames contained in the raw chunk of frames, i.e.
|
java.lang.String |
getParentDirectory(java.lang.String path)
Extracts the name of the parent directory.
|
RecordingProperties |
getRecordingProperties() |
RecordingProperties |
getRecordingPropertiesByFilter(int filter)
Returns the properties for the specified filter.
|
long |
GetTimestamp()
Gets the long number representation of the timestamp that exists in the header
|
double |
getVolumeFreeSpace(java.lang.String path,
int unit)
Gets the size of the free (unallocated) space of the volume that the provided path corresponds to.
|
double |
getVolumeTotalSpace(java.lang.String path,
int unit)
Gets the total size of the volume that the provided path corresponds to.
|
double |
getVolumeUsableSpace(java.lang.String path,
int unit)
Gets the size of the usable space of the volume that the provided path corresponds to.
|
boolean |
hasValidHeader()
Checks if the last attempt in reading a frame was successful and the header is valid.
|
int |
loadRecordingProperties(java.lang.String propertyFilename) |
int |
loadRecordingPropertiesByFilter(java.lang.String directoryName,
int filter)
Loads the camera properties for the specified filter in the directory.
|
int |
OpenFramesReader(java.lang.String filename,
int bufferSize,
int imageSize,
int maxMemoryUsageMB)
Initialises access to a chunk for reading frames
|
java.lang.String |
openSelectDirectoryDialog(java.lang.String rootDirectory,
java.lang.String dialogTitle)
Open a dialog for selecting a directory.
|
java.lang.String |
openSelectFileDialog(java.lang.String rootDirectory,
java.lang.String dialogTitle)
Open a dialog for selecting a file.
|
int |
ReadFrame(int[] frame)
Read a single frame from the current open stream, by checking also its header.
|
int |
ReadFrameNoMetadata(int[] frame) |
void |
setReverseVerticalReadDirection(boolean rev)
Set the reading in the vertical direction of the image
|
public static final int FR_NOT_INITIALISED
public static final int SUCCESS
public static final int UNRESOLVED_ERROR
public static final int IOEXCEPTION
public static final int NOT_FOUND
public static final int INVALID_PROPERTY_FORMAT
public static final int OUT_OF_BOUNDS
public static final int INVALID_FILTER_IDENTIFIER
public static final int EOF_NOMINAL
public static final int EOF_ABRUPT
public static final int WRONG_INPUT_FORMAT
public static final int IS_NOT_EMPTY
public static final int IS_EMPTY
public static final int DELETE_ERROR
public static final int NOT_A_FILE
public static final int NOT_A_DIRECTORY
public static final int FILE_ALREADY_EXISTS
public static final int RED_FILTER
public static final int NIR_FILTER
public static final int BYTE
public static final int KILOBYTE
public static final int MEGABYTE
public static final int GIGABYTE
public static final int TERABYTE
public int OpenFramesReader(java.lang.String filename,
int bufferSize,
int imageSize,
int maxMemoryUsageMB)
filename - the crossID of the chunkimageSizeBytes - the size of the buffer to be used for reading a single frame (relates to the size of the frame plus its header)imageSize - the total number of pixels for a framemaxMemoryUsageMB - the maximum size of the memory to be allocated in MB, for loading large parts from the chunkspublic void CloseFramesReader()
public void setReverseVerticalReadDirection(boolean rev)
rev - public int ReadFrame(int[] frame)
frame - the buffer to be filled with the frame datapublic boolean hasValidHeader()
public long getLastTimestamp()
public AndorFrameHeader getLastHeader()
public int ReadFrameNoMetadata(int[] frame)
public long GetTimestamp()
public TimePoint convertTimestampToDateTime(double timestampFreq, TimePoint timestampZeroPoint, long timestampZero)
timestampFreq - the frequency (ticks per second)timestampZeroPoint - the point where the timestamp of the camera was reset to zero (or the timestamp number was noted without resetting)timestampZero - zero, if the camera timestamp was reset successfully, or the number of ticks on the timestampReference pointpublic java.util.ArrayList<java.lang.String> GetContents(java.lang.String directoryName)
directory - the crossID of the directorypublic java.util.ArrayList<java.lang.String> GetContentsByFilter(java.lang.String directoryName,
int filter)
directory - the crossID of the directoryfilter - the crossID of the target filter, RED_FILTER or NIR_FILTERpublic java.util.ArrayList<java.lang.String> GetContentsByExtension(java.lang.String directoryName,
java.lang.String extension)
directoryName - the crossID of the directoryextension - the target extensionpublic java.util.ArrayList<java.lang.String> getFitsFilesByFilter(java.lang.String directoryName,
int filter)
directoryName - the crossID of the directoryfilter - the crossID of the target filter, RED_FILTER or NIR_FILTERpublic int deleteFile(java.lang.String filename)
filename - the crossID of the file to be deletedpublic int deleteDirectory(java.lang.String dirname,
boolean deleteIfNotEmpty)
dirname - the crossID of the directory to be deleteddeleteIfNotEmpty - specifies whether the directory will still be deleted, even if it is not emptypublic int loadRecordingProperties(java.lang.String propertyFilename)
public RecordingProperties getRecordingProperties()
public java.lang.String getFilenameNoExtension(java.lang.String filename)
public int loadRecordingPropertiesByFilter(java.lang.String directoryName,
int filter)
directory - the crossID of the directoryfilter - the crossID of the target filter, RED_FILTER or NIR_FILTERpublic RecordingProperties getRecordingPropertiesByFilter(int filter)
filter - the crossID of the target filter, RED_FILTER or NIR_FILTERpublic java.lang.String openSelectDirectoryDialog(java.lang.String rootDirectory,
java.lang.String dialogTitle)
rootDirectory - the root directory for the selectiondialogTitle - the title to be displayed (may be null)public java.lang.String openSelectFileDialog(java.lang.String rootDirectory,
java.lang.String dialogTitle)
rootDirectory - the root directory for the selectiondialogTitle - the title to be displayed (may be null)public boolean fileExists(java.lang.String filename)
filename - the path to the filepublic boolean directoryExists(java.lang.String dirname)
dirname - the path to the directorypublic boolean createDirectory(java.lang.String dirname)
dirname - the path to the directory to be createdpublic boolean createFile(java.lang.String filename)
filename - the path to the file to be createdpublic java.lang.String getNameFromPath(java.lang.String path)
path - public java.lang.String getParentDirectory(java.lang.String path)
path - public double getVolumeUsableSpace(java.lang.String path,
int unit)
path - unit - Must be one of BYTE, KILOBYTE, MEGABYTE, GIGABYTE, TERABYTEpublic double getVolumeTotalSpace(java.lang.String path,
int unit)
path - unit - Must be one of BYTE, KILOBYTE, MEGABYTE, GIGABYTE, TERABYTEpublic double getVolumeFreeSpace(java.lang.String path,
int unit)
path - unit - Must be one of BYTE, KILOBYTE, MEGABYTE, GIGABYTE, TERABYTEpublic double getFileSize(java.lang.String path,
int unit)
path - unit - Must be one of BYTE, KILOBYTE, MEGABYTE, GIGABYTE, TERABYTEpublic double getDirectorySize(java.lang.String path,
int unit)
public double getDirectorySize(java.io.File dir,
int unit)
public int getNumberOfFrames(java.lang.String path)
path - public java.lang.String getMessage()
public java.lang.String getCodeStr(int code)
code -