Return the indices of the first and last bytes of the HDU: hdu_start=header_start, data_start, data_stop, hdu_stop
Return the indices of the first and last bytes of the HDU: hdu_start=header_start, data_start, data_stop, hdu_stop
(Long, Long, Long, Long), the split of the HDU.
Return the types of elements for each column as a list.
Return the types of elements for each column as a list.
: (Int) Column index used for the recursion.
(List[String]), list with the types of elements for each column as given by the header.
Get the name of a column with index colIndex
of a HDU.
Get the name of a column with index colIndex
of a HDU.
: (Array[String]) The header of the HDU.
: (Int) Index (zero-based) of a column.
(String), the name of the column.
Get the type of the elements of a column with index colIndex
of a HDU.
Get the type of the elements of a column with index colIndex
of a HDU.
: (Array[String]) The header of the HDU.
: (Int) Index (zero-based) of a column.
(String), the type (FITS convention) of the elements of the column.
Companion to readLineFromBuffer.
Companion to readLineFromBuffer. Convert one array of bytes corresponding to one element of the table into its primitive type.
: (Array[Byte]) Array of byte describing one element of the table.
: (String) The type of this table element according to the header.
the table element converted from binary.
Get the comments of the header.
Get the comments of the header. We assume the comments are written after a backslash (\).
: (Array[String]) The header of the HDU.
(HashMap[String, String]), a map of keyword/comment.
Return the KEYWORDS of the header.
Return the KEYWORDS of the header.
(Array[String]), array with the KEYWORDS of the HDU header.
Get the names of the header.
Get the names of the header. We assume that the names are inside quotes 'my_name'.
: (Array[String]) The header of the HDU.
(HashMap[String, String]), a map of keyword/name.
Return the (KEYWORDS, VALUES) of the header
Return the (KEYWORDS, VALUES) of the header
(HashMap[String, Int]), map array with (keys, values_as_int).
Get the number of column of a HDU.
Get the number of column of a HDU. We rely on what's written in the header, meaning here we do not access the data directly.
: (Array[String]) The header of the HDU.
(Long), the number of rows as written in KEYWORD=TFIELDS.
Return the number of HDUs in the file.
Return the number of HDUs in the file.
(Int) the number of HDU.
Get the number of row of a HDU.
Get the number of row of a HDU. We rely on what's written in the header, meaning here we do not access the data directly.
: (Array[String]) The header of the HDU.
(Long), the number of rows as written in KEYWORD=NAXIS2.
Get the size (bytes) of each row of a HDU.
Get the size (bytes) of each row of a HDU. We rely on what's written in the header, meaning here we do not access the data directly.
: (Array[String]) The header of the HDU.
(Int), the size (bytes) of one row as written in KEYWORD=NAXIS1.
Companion routine to rowSplitLocations.
Companion routine to rowSplitLocations. Returns the size of a primitive according to its type from the FITS header.
: (String) Element type according to FITS standards (I, J, K, E, D, L, A, etc)
(Int), the size (bytes) of the element.
Read the header of a HDU.
Read the header of a HDU. The cursor needs to be at the start of the header. We assume that each header row has a standard size of 80 Bytes, and the total size of the header is 2880 Bytes.
(Array[String) the header is an array of Strings, each String being one line of the header.
Read a header at a given position
Read a header at a given position
: (Long) The byte index to seek in the file. Need to correspond to a valid header position. Use in combination with BlockBoundaries._1 for example.
(Array[String) the header is an array of Strings, each String being one line of the header.
Convert binary row into row.
Convert binary row into row. You need to have the cursor at the beginning of a row. Example
// Set the cursor at the beginning of the data block setCursor(BlockBoundaries._2) // Initialise your binary row val buffer = Array[Byte](size_of_one_row_in_bytes) // Read the first binary row into buffer data.read(buffer, 0, size_of_one_row_in_bytes) // Convert buffer val myrow = readLineFromBuffer(buffer)
: (Array[Byte]) Row of byte read from the data block.
: (Int=0) Index of the column (used for the recursion).
(List[_]) The row as list of elements (float, int, string, etc.) as given by the header.
Register the boundaries of the HDU in the Hadoop configuration.
Register the boundaries of the HDU in the Hadoop configuration. By doing this, we broadcast the values to the executors. It is sent as a long String, and can be read properly afterwards using retrieveBlockBoundaries. Make sure you use the same separators.
: (String) Line separator used to form the String. Default is ;;
Register the header in the Hadoop configuration.
Register the header in the Hadoop configuration. By doing this, we broadcast the header to the executors. The header is sent as a long String, and can be read properly afterwards using retrieveHeader. Make sure you use the same separators.
: (String) Line separator used to form the String. Default is ;;
Place the cursor at the beginning of the data of the block
Place the cursor at the beginning of the header of the block
Retrieve the blockboundaries from the Hadoop configuration.
Retrieve the blockboundaries from the Hadoop configuration. Make sure you use the same separators as in registerBlockBoundaries.
: (String) Line separator used to split the String. Default is ;;
the block boundaries as Tuple4 of Long. See BlockBoundaries.
Retrieve the header from the Hadoop configuration.
Retrieve the header from the Hadoop configuration. Make sure you use the same separators as in registerHeader.
: (String) Line separator used to split the String. Default is ;;
the header as Array[String]. See readHeader.
Description of a row in terms of bytes indices.
Description of a row in terms of bytes indices. rowSplitLocations returns an array containing the position of elements (byte index) in a row. Example if we have a row with [20A, E, E], one will have rowSplitLocations -> [0, 20, 24, 28] that is a string on 20 Bytes, followed by 2 floats on 4 bytes each.
: (Int) Column position used for the recursion. Should be left at 0.
(List[Int]), the position of elements (byte index) in a row.
Set the cursor at the position
(byte index, Long).
Set the cursor at the position
(byte index, Long).
: (Long) The byte index to seek in the file.
Main class to handle a HDU of a fits file. Main features are