sharppy.io package

Submodules

Input/Output routines to read various human-readable text datasets.

sharppy.io.arw_decoder module

class sharppy.io.arw_decoder.ARWDecoder(file_name)[source]

Bases: sharppy.io.decoder.Decoder

sharppy.io.buf_decoder module

class sharppy.io.buf_decoder.BufDecoder(file_name)[source]

Bases: sharppy.io.decoder.Decoder

sharppy.io.csv module

sharppy.io.csv.loadCSV(csv_file_name)[source]

sharppy.io.decoder module

class sharppy.io.decoder.Decoder(file_name)[source]

Bases: object

getProfiles(indexes=None)[source]

Returns a list of profile objects generated from the file that was read in.

Parameters

prof_idxs (list (optional)) – A list of indices corresponding to the profiles to be returned. Default is to return the full list of profiles

getStnId()[source]
class sharppy.io.decoder.abstract(func)[source]

Bases: object

sharppy.io.decoder.findDecoders()[source]
sharppy.io.decoder.getDecoder(dec_name)[source]
sharppy.io.decoder.getDecoders()[source]

sharppy.io.pecan_decoder module

class sharppy.io.pecan_decoder.PECANDecoder(file_name)[source]

Bases: sharppy.io.decoder.Decoder

sharppy.io.qc_tools module

sharppy.io.qc_tools.raiseError(string, errorType)[source]

This function will raise an exception specified by the errorType variable.

Parameters
  • string (str) – the string to be printed out to the user when the exception is thrown

  • errorType (Exception) – the type of exception.

Returns

Return type

None

sharppy.io.qc_tools.numMasked(arr)[source]

This function returns the number of unmasked array elements as well as the length of the array.

Parameters

arr (masked numpy array) – The maksed numpy array

Returns

  • count (number) – the number of unmasked array elements

  • length (number) – the length of the unmasked array

sharppy.io.qc_tools.isPRESValid(pres)[source]

This function checks to see if valid pressure (mb) values are within the pres array that is passed to the Profile object

True If:

1.) pressure array length is > 1 2.) pressure array is not filled with masked values 3.) if the pressure array is decreasing with the index

and there are no repeat values.

Parameters

pres (array) – pressure array (mb)

Returns

value

Return type

bool

sharppy.io.qc_tools.isHGHTValid(hght)[source]

This function checks to see if valid height (m) values are within the hght array that is passed to the Profile object

True/False: True If:

1.) height array length is > 0 2.) height array is not filled with masked values 3.) if the height array is increasing with the index

and there are no repeat values.

Parameters

hght (array) – height array (m)

Returns

value

Return type

bool

sharppy.io.qc_tools.isWSPDValid(wspd)[source]

This function checks to see if valid wind speed (knots) values are within the wspd array that is passed to the Profile object

Parameters

wspd (the wind speed array (knots)) –

Returns

True/False

Return type

True if the wind speeds in the wspd array are all >= 0.

sharppy.io.qc_tools.isDWPCValid(dwpc)[source]

This function checks to see if valid dewpoint (Celsius) values are within the dwpc array that is passed to the Profile object

Parameters

dwpc (the dewpoint array (Celsius)) –

Returns

True/False

Return type

True if the values in the dewpoint array are all above absolute zero.

sharppy.io.qc_tools.isTMPCValid(tmpc)[source]

This function checks to see if valid temperature (Celsius) values are within the tmpc array that is passed to the Profile object

Parameters

tmpc (the temperature array (Celsius)) –

Returns

True/False

Return type

True if the values in the temperature array are all above absolute zero.

sharppy.io.spc_decoder module

class sharppy.io.spc_decoder.SPCDecoder(file_name)[source]

Bases: sharppy.io.decoder.Decoder

sharppy.io.uwyo_decoder module

class sharppy.io.uwyo_decoder.UWYODecoder(file_name)[source]

Bases: sharppy.io.decoder.Decoder

MISSING = -9999.0

Module contents