Skip to content

Commit

Permalink
Fixing compile errors for date/time to test Sol string conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Nemere committed Nov 13, 2024
1 parent 86942ea commit d16cd5e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions api/dataimport/internal/converters/pixlem/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,7 @@ func importEMData(creatorId string, rtt string, beamLocPath string, hkPath strin
product := "???"

// Use current date encoded as a test sol
// A=2016, 'A' is 65 ascii
sol := fmt.Sprintf("%v%v", string(65+time.Now().Year()-2016), time.Now().YearDay())
sol := timeToTestSol(time.Now())

ftype := "??" // PE
producer := "J"
Expand Down Expand Up @@ -303,3 +302,13 @@ func importEMData(creatorId string, rtt string, beamLocPath string, hkPath strin
outData.CreatorUserId = creatorId
return outData, err
}

func timeToTestSol(t time.Time) string {
// A=2016, 'A' is 65 ascii
var result string

var asciiDate = rune('A' + t.Year() - 2016)
result += string(asciiDate)
result += strconv.Itoa(t.YearDay())
return result
}
1 change: 1 addition & 0 deletions api/dataimport/sdfToRSI/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ func readNumBetween(line string, prefix string, suffix string, readType int) (in
return val, 0, lastPos, nil
}

// Expected SCLK format: 2006-002T15:04:05
func makeWriteSCLInt(readSCLK string) int64 {
unixSec := readTimestamp(readSCLK)

Expand Down

0 comments on commit d16cd5e

Please sign in to comment.