Skip to content

Commit

Permalink
[api]: Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagohm committed Jan 20, 2025
1 parent ea82bb1 commit 9c01567
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ internal data class FitsHeaderCardParser(private val line: CharSequence) {

if (parsePos > FitsHeaderCard.MAX_KEYWORD_LENGTH) {
// equal sign = after the 9th char -- only supported with hierarch keys...
if (!key.startsWith(FitsKeyword.HIERARCH.key + "")) {
if (!key.startsWith(FitsKeyword.HIERARCH.key)) {
LOG.d { debug("[{}] possibly misplaced '=' (after byte 9)", key) }
// It's not a HIERARCH key
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ object VSOP87EReader {

// All VSOP87E .txt files sum ~6.9 MB
fun readTxtFormat(source: Source): VSOP87ETerms {
val buffer = if (source is BufferedSource) source else source.buffer()
val buffer = source as? BufferedSource ?: source.buffer()

var xyz = 0
var exp = 0
Expand Down Expand Up @@ -49,7 +49,7 @@ object VSOP87EReader {

// All VSOP87E .dat files sum ~1.2 MB
fun readBinaryFormat(source: Source): VSOP87ETerms {
val buffer = if (source is BufferedSource) source else source.buffer()
val buffer = source as? BufferedSource ?: source.buffer()
val terms = Array(6) { Array(3) { DoubleArray(0) } }

for (exp in 0..2) {
Expand All @@ -64,7 +64,7 @@ object VSOP87EReader {

fun convertTxtToBinaryFormat(source: Source, sink: Sink) {
val terms = readTxtFormat(source)
val buffer = if (sink is BufferedSink) sink else sink.buffer()
val buffer = sink as? BufferedSink ?: sink.buffer()

// number of terms: 2 bytes, data: n * 8 bytes]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Nebula : SkyCatalog<NebulaEntry>(94661) {
val redshift = source.readDouble()
source.readDouble() // Redshift error
val parallax = source.readDouble().mas
source.readDouble().mas // Parallax error
source.readDouble() //.mas // Parallax error
source.readDouble() // Distance
source.readDouble() // Distance error
val ngc = source.readInt()
Expand Down Expand Up @@ -112,7 +112,7 @@ class Nebula : SkyCatalog<NebulaEntry>(94661) {
if (vdbha > 0) "VdBHA $vdbha".findNames()

val nebula = NebulaEntry(
id, names,
id, names.clone() as List<String>,
ra, dec, min(mB, mV),
NebulaType.entries[type].type,
majorAxis, minorAxis, orientation,
Expand Down

0 comments on commit 9c01567

Please sign in to comment.