io.io_krc — KRC Thermal Model Reader

The io.io_krc`module supports reading KRC thermal model Bin52 and `.tds files for both the floating point and double versions.

New in version 0.1.1.

class plio.io.io_krc.ReadBin52(filename, headerlen=512)[source]

Class to read a bin 52 and organize the output

bin52data

The raw, n-dimensional KRC data

Type

ndarray

casesize

The number of bytes in each KRC case

Type

int

date

The date the read file was created

Type

bytes

ddd

Raw temperature data

Type

ndarray

ddd_pd

A pandas dataframe of surface temperature data

Type

dataframe

filename

The name of the KRC file that was input

Type

str

header

The KRC header unpack to a list of ints

Type

list

headerlength

The length, in bytes, of the KRC header

Type

int

ncases

The number of different cases the model was run for

Type

int

ndim

TBD

Type

int

ndx

The number of indices for a single KRC run

Type

int

nhours

The number of hour bins per 24 Mars hours

Type

int

nlats

The number of valid, non-zero latitude bins

Type

int

nseasons

The number of seasons the model was run for

Type

int

nvariables

The number of variables contained within the KRC lookup table

Type

int

structdtype

Describing endianess and data type

Type

str

temperature_data

A multi-indexed dataframe of surface temperatures

Type

dataframe

transferedlayers

The number of KRC transfered layers

Type

int

version

The krc verison used to create the file in the form [major, minor, release]

Type

list

words_per_krc

The number of bytes per krc entry

Type

int

definekrc(what='KRC', endianness='<')[source]

Defines a custom binary data structure for the KRC files.

readbin5(headerlen)[source]

Reads the type 52 file containing KRC output.

Tested with KRC version 2.2.2. Note that the output format can change

Parameters

(str) Full PATH to the file (filename) –

readcase(case=0)[source]

Read a single dimension (case) from a bin52 file.

Parameters

case (int) – The case to be extracted