easysnowdata.climate.indices.parse#

easysnowdata.climate.indices.parse(text: str, layout: str, *, name: str | None = None) → Series[source]#

Parse one index file into a monthly pandas.Series.

Parameters:
  • text – The file’s contents.

  • layout – "columns" — one row per month, year month … value with the value in the last column (CPC’s monthly files, NCEI’s AMO; header lines are skipped). "seasons" — SEAS YEAR … value with a 3-letter season label (CPC’s RONI and ONI). "wide" — one row per year with twelve monthly values (NCEI’s PDO and every PSL file; the PSL first line of two years, the sentinel line and the notes are skipped because they do not have thirteen numbers). A line holding a single number after the table is PSL’s missing-value sentinel, and values equal to it are dropped.

  • name – Name for the returned series.

Returns:

pandas.Series – Float values on a month-start DatetimeIndex, missing-value sentinels dropped, sorted.