Documentation ¶
Index ¶
- func ArrayToPNG(fp string, v []float64, nr, nc int)
- func BitArray(b []byte) []bool
- func BitArray1(b byte) []bool
- func BitArray1Rev(b []bool) byte
- func BitArrayRev(b []bool) []byte
- func CallResponse(done chan interface{}) <-chan string
- func CompressTarGZ(path string) (string, error)
- func CompressTarGZext(path, ext string) (string, error)
- func CopyFile(src, dst string) (int64, error)
- func CopyMapIF(originalMap map[int]float64) (newMap map[int]float64)
- func CreateEmpty(filepath string) error
- func DeleteAllInDirectory(dir, ext string)
- func DeleteAllSubdirectories(dir string)
- func DeleteDir(dir string)
- func DeleteFile(fp string)
- func DirExists(path string) bool
- func DirList(root string) ([]string, error)
- func EndPprof()
- func EndTrace()
- func ExtractTarGZ(fp string) (string, error)
- func FileExists(path string) (int64, bool)
- func FileList(path string) ([]string, error)
- func FileListExt(dir, ext string) ([]string, error)
- func FileName(fp string, withExtension bool) string
- func FileRename(oldName, newName string, overwrite bool)
- func GetExtension(fp string) string
- func GetFileDir(fp string) string
- func GetInstance(fnam string) *logger
- func HeapDump(fp string)
- func InterfaceToFloat(d []interface{}) []float64
- func IsDir(path string) bool
- func LineSegmentsToGeojson(lns map[int]mmaths.LineSegment, outfp string)
- func LinesToAscii(fp string, s []string) error
- func LoadCSV(rc io.Reader, nHeaderLines int) (ch chan []string)
- func LoadCsvArray(fp string, nHeaderLines int) [][]string
- func LoadGOB(fp string) (map[int]int, error)
- func MMdate(d time.Time) string
- func MMtime(d time.Time) string
- func MakeDir(path string) string
- func MinMaxTime() (_, _ time.Time)
- func MinMaxTimeseries(ts TimeSeries) (_, _ time.Time)
- func MonthDays(year Yr, month Mo) int
- func MoveFile(sourcePath, destPath string) error
- func NewPprof() error
- func NewTrace()
- func OpenBinary(filepath string) *bytes.Reader
- func ParseHexColor(s string) (c color.RGBA, err error)
- func PrintMemUsage()
- func ReachedEOF(b *bytes.Reader) bool
- func ReadBinary(filepath string, data ...interface{}) error
- func ReadBinaryBytes(filepath string, d int) ([][]uint8, int, error)
- func ReadBinaryFloat32s(filepath string, d int) ([][]float32, int, error)
- func ReadBinaryFloat64s(filepath string, d int) ([][]float64, int, error)
- func ReadBinaryFloats(filepath string) ([]float64, error)
- func ReadBinaryIMAP(filepath string) (map[int]int, error)
- func ReadBinaryInts(filepath string, d int) ([][]int32, int, error)
- func ReadBinaryRMAP(filepath string) (map[int]float64, error)
- func ReadBinaryShorts(filepath string, d int) ([][]int16, int, error)
- func ReadBytes(b *bytes.Reader, n int) []byte
- func ReadCSV(filepath string, nHeaderLines int) ([][]float64, error)
- func ReadCsvDateFloat(csvfp string) (map[int64]float64, error)
- func ReadCsvDateFloats(csvfp string) (map[time.Time][]float64, error)
- func ReadCsvStringFloat(csvfp string) (map[string]float64, error)
- func ReadCsvStringInt(csvfp string) (map[string]int, error)
- func ReadFloat32(b *bytes.Reader) float32
- func ReadFloat64(b *bytes.Reader) float64
- func ReadFloats(fp string) ([]float64, error)
- func ReadGeojsonLines(fp string) [][][]float64
- func ReadInt32(b *bytes.Reader) int32
- func ReadInt32check(b *bytes.Reader) (int32, bool)
- func ReadInt64(b *bytes.Reader) int64
- func ReadInt8(b *bytes.Reader) int8
- func ReadInts(fp string) ([]int, error)
- func ReadLines(b *bytes.Reader) []string
- func ReadString(b *bytes.Reader) string
- func ReadTextLines(fp string) ([]string, error)
- func ReadUInt16(b *bytes.Reader) uint16
- func ReadUInt32(b *bytes.Reader) uint32
- func ReadUInt64(b *bytes.Reader) uint64
- func ReadUInt8(b *bytes.Reader) uint8
- func RemoveBOM(r *bufio.Reader) error
- func RemoveExtension(fp string) string
- func RemoveWhiteSpaces(s string) string
- func SaveGOB(fp string, d map[int]int) error
- func Thousands(n int64) string
- func WriteBinary(filepath string, data ...interface{}) error
- func WriteCSV(fp, h string, d ...[]interface{})
- func WriteCSV2d(fp, h string, dat [][]interface{})
- func WriteCsvDateFloats(csvfp, header string, t []time.Time, d ...[]float64) error
- func WriteCsvFloats(csvfp, header string, d ...[]float64) error
- func WriteCsvFloats32(csvfp, header string, d ...[]float32) error
- func WriteCsvIntInts(csvfp, header string, ii map[int]int) error
- func WriteFloats(fp string, d []float64) error
- func WriteIMAP(filepath string, data map[int]int) error
- func WriteInts(fp string, d []int) error
- func WriteLines(fp string, s []string) error
- func WriteRMAP(filepath string, data map[int]float64, append bool) error
- func WriteString(fp, content string) error
- func WriteStrings(fp string, s []string) error
- type CSVwriter
- type Instruct
- type Mo
- type TXTwriter
- type TimeSeries
- type TimeSeriesMonthly
- type Timer
- type Yr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArrayToPNG ¶
ArrayToPNG prints a 2D array (as row-major 1D array) to a png
func BitArray1Rev ¶
BitArray1Rev converts a slice of boolean to a byte https://stackoverflow.com/questions/73710132/golang-convert-8bool-to-byte
func BitArrayRev ¶
BitArrayRev converts a slice of boolean to a slice of bytes
func CallResponse ¶
func CallResponse(done chan interface{}) <-chan string
CallResponse is a pipeline that takes in a user's entry, and return it as a channel. ctrl-c ends the program modified from: https://www.reddit.com/r/golang/comments/4hktbe/read_user_input_until_he_press_ctrlc/
func CompressTarGZ ¶
CompressTarGZ converts a path to a *.tar.gz
func CompressTarGZext ¶
CompressTarGZext converts files (with a given extension) in a path to a *.tar.gz
func CopyFile ¶
CopyFile copies a file (modified from https://opensource.com/article/18/6/copying-files-go)
func CreateEmpty ¶
func DeleteAllInDirectory ¶
func DeleteAllInDirectory(dir, ext string)
DeleteAllInDirectory deletes all files of a given extension in a specified directory exension format: ".***"
func DeleteAllSubdirectories ¶
func DeleteAllSubdirectories(dir string)
DeleteAllSubdirectories deletes all subdirectories within a specified directory
func ExtractTarGZ ¶
ExtractTarGZ extracts a *.tar.gz file to a directory from https://gist.github.com/indraniel/1a91458984179ab4cf80
func FileExists ¶
FileExists checks if a file exists and returns its size
func FileListExt ¶
FileListExt returns a list of files of a given extension from a directory. directories should end with "/" and extensions start with ".". exension format: ".***"
func FileRename ¶
FileRename renames a file
func GetExtension ¶
GetExtension returns the file path extension returns with dot following extension
func GetFileDir ¶
GetFileDir returns the directory that contains the given filepath
func GetInstance ¶
func GetInstance(fnam string) *logger
GetInstance start log file outputting to ./mm.log
func InterfaceToFloat ¶
func InterfaceToFloat(d []interface{}) []float64
InterfaceToFloat converts a slice of interface, and converts to float (assuming possible)
func LineSegmentsToGeojson ¶
func LineSegmentsToGeojson(lns map[int]mmaths.LineSegment, outfp string)
func LinesToAscii ¶
func LoadCsvArray ¶
func MinMaxTime ¶
MinMaxTime returns the limits of time.Time (see https://stackoverflow.com/questions/25065055/what-is-the-maximum-time-time-in-go/32620397#32620397)
func MinMaxTimeseries ¶
func MinMaxTimeseries(ts TimeSeries) (_, _ time.Time)
MinMaxTimeseries returns the range of a Timeseries
func MoveFile ¶
MoveFile moves a file (https://stackoverflow.com/questions/50740902/move-a-file-to-a-different-drive-with-go)
func OpenBinary ¶
OpenBinary creates reader from filepath
func PrintMemUsage ¶
func PrintMemUsage()
PrintMemUsage outputs the current, total and OS memory being used. As well as the number of garage collection cycles completed. from: https://golangcode.com/print-the-current-memory-usage/
func ReachedEOF ¶
ReachedEOF tests to see if all reader data has been read
func ReadBinary ¶
ReadBinary general binary reader
func ReadBinaryBytes ¶
ReadBinaryBytes reads an entire file and returns a slice of d dimensions
func ReadBinaryFloat32s ¶
ReadBinaryFloat32s reads an entire file and returns a slice of d dimensions
func ReadBinaryFloat64s ¶
ReadBinaryFloats reads an entire file and returns a slice of d dimensions
func ReadBinaryFloats ¶
ReadBinaryFloats reads an entire file and returns a slice of floats
func ReadBinaryIMAP ¶
ReadBinaryIMAP reads a map[int]int for an entire file
func ReadBinaryInts ¶
ReadBinaryInts reads an entire file and returns a slice of d dimensions
func ReadBinaryRMAP ¶
ReadBinaryRMAP reads a map[int]float64 for an entire file
func ReadBinaryShorts ¶
ReadBinaryShorts reads an entire file and returns a slice of d dimensions
func ReadCsvDateFloat ¶
ReadCsvDateFloat reads temporal csv file "date,value,flag,..."
func ReadCsvDateFloats ¶
ReadCsvDateFloat reads temporal csv file "date,value,flag,..."
func ReadCsvStringFloat ¶
ReadCsvStringFloat reads temporal csv file ith column type "<str>,<float>"
func ReadCsvStringInt ¶
ReadCsvStringInt reads temporal csv file ith column type "<str>,<int>"
func ReadFloat32 ¶
ReadFloat32 reads next float32 from buffer
func ReadFloat64 ¶
ReadFloat64 reads next float64 from buffer
func ReadFloats ¶
ReadFloats is a simple routine that reads an float slice to an ascii file
func ReadGeojsonLines ¶
func ReadInt32check ¶
ReadInt32check reads next int32 from buffer
func ReadString ¶
ReadString reads and returns string from binary file
func ReadTextLines ¶
ReadTextLines reads and returns string lines from binary file
func RemoveExtension ¶
RemoveExtension returns the file path without its extension
func RemoveWhiteSpaces ¶
removes tabs, duplicate spaces, returns (\n) from: https://gosamples.dev/remove-duplicate-spaces/
func Thousands ¶
Thousands returns a string integer with thousand separators from: https://stackoverflow.com/questions/13020308/how-to-fmt-printf-an-integer-with-thousands-comma
func WriteBinary ¶
WriteBinary general binary writer
func WriteCSV ¶
func WriteCSV(fp, h string, d ...[]interface{})
WriteCSV writes csv from a complete dataset
func WriteCSV2d ¶
func WriteCSV2d(fp, h string, dat [][]interface{})
WriteCSV2d writes csv from a complete dataset dat[row][col]
func WriteCsvDateFloats ¶
func WriteCsvFloats ¶
func WriteCsvFloats32 ¶
func WriteFloats ¶
WriteFloats is a simple routine that writes an float slice to an ascii file
func WriteLines ¶
func WriteString ¶
func WriteStrings ¶
WriteStrings is a simple routine that writes a slice of strings to an ascii file
Types ¶
type CSVwriter ¶
type CSVwriter struct {
// contains filtered or unexported fields
}
CSVwriter general CSV writer
type Instruct ¶
func NewInstruct ¶
type TXTwriter ¶
TXTwriter general text writer
func (*TXTwriter) WriteBytes ¶
WriteBytes general textfile line writer method for TXTwriter
type TimeSeriesMonthly ¶
TimeSeriesMonthly returns a monthly timeseries
func MonthlySumCount ¶
func MonthlySumCount(ts TimeSeries) (_, _ TimeSeriesMonthly)
MonthlySumCount converts a timeseries to a sum TimeSeriesMonthly and a count TimeSeriesMonthly
type Timer ¶
type Timer struct {
// contains filtered or unexported fields
}
Timer is a common timer used for profiling
func (*Timer) PrintAndReset ¶
Source Files ¶
- ascii.go
- binary.go
- bitarray.go
- callresponse.go
- colour-linearL.go
- colour.go
- copy.go
- csv-specialReaders.go
- csv-specialWriters.go
- csv.go
- date.go
- diagnostic.go
- files.go
- geojson.go
- gob.go
- instruct.go
- interface.go
- lines.go
- logger.go
- png.go
- profile.go
- targz.go
- thousands.go
- time.go
- timer.go
- timeseries.go
- txt.go