Skip to content

Commit

Permalink
Merge pull request #12 from observerly/feature/fits/getFITSHeader
Browse files Browse the repository at this point in the history
feat: extended getFITSBlocks() to return parsed status.
  • Loading branch information
michealroberts authored Jan 14, 2022
2 parents eb356c5 + f3cecc3 commit 0b8af45
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/fits/getFITSBlocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const getFITSBlocks = (size: number): { blocks: FITSBlock[] } => {
const blocks = i.map((_value, index: number) => {
return {
buffer: '-&1',
parsed: false,
offsetStart: index + FITS_BLOCK_LENGTH * index,
offsetEnd: index + FITS_BLOCK_LENGTH + FITS_BLOCK_LENGTH * index
}
Expand Down
19 changes: 13 additions & 6 deletions src/types/block.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
export interface FITSBlock {
/**
*
* Some offset value giving the offset start in bytes of the current block
* ArrayBuffer of the block being read-in
*
*/
offsetStart: number
buffer: string | ArrayBuffer
/**
*
* Some offset value giving the offset end in bytes of the current block
*
* Have we parsed the current block?
*
*/
offsetEnd: number
parsed?: boolean
/**
*
* ArrayBuffer of the block being read-in
* Some offset value giving the offset start in bytes of the current block
*
*/
buffer: string | ArrayBuffer
offsetStart: number
/**
*
* Some offset value giving the offset end in bytes of the current block
*
*/
offsetEnd: number
}

0 comments on commit 0b8af45

Please sign in to comment.