wdmtoolbox.wdmtoolbox.createnewdsn

wdmtoolbox.wdmtoolbox.createnewdsn(wdmpath, dsn, tstype='', base_year=1900, tcode=4, tsstep=1, statid='', scenario='', location='', description='', constituent='', tsfill=-999.0)

Create a new DSN.

Parameters:
  • wdmpath (str) – Path and WDM filename.

  • dsn (int) – The Data Set Number (DSN) for the time series in the WDM file. This number must be greater or equal to 1 and less than or equal to 32000. HSPF can only use for input or output DSNs of 1 to 9999, inclusive.

  • tstype (str) –

    [optional, default to first 4 characters of ‘constituent’]

    Time series type. Can be any 4 character string, but if not specified defaults to first 4 characters of ‘constituent’. Must match what is used in HSPF UCI file.

    Limited to 4 characters.

  • base_year (int) –

    [optional, defaults to 1900]

    Base year of time series. The DSN will not accept any time-series before this date and with the default settings of TGROUP=6 (i.e. yearly) would allow time-series up to 2199.

  • tcode (int) –

    [optional, defaults to 4=daily time series]

    Time series code, (1=second, 2=minute, 3=hour, 4=day, 5=month, 6=year)

  • tsstep (int) –

    [optional, defaults to 1]

    Time series steps, defaults (and almost always is) 1.

  • statid (str) –

    [optional, defaults to ‘’]

    The station name, limited to 16 characters.

  • scenario (str) –

    [optional defaults to ‘’]

    The name of the scenario. Can be anything, but typically, ‘OBSERVED’ for calibration and input time-series and ‘SIMULATE’ for model results.

    Limited to 8 characters.

  • location (str) –

    [optional defaults to ‘’]

    The location name.

    Limited to 8 characters.

  • description (str) –

    [optional, defaults to ‘’]

    Descriptive text.

    Limited to 48 characters.

  • constituent (str) –

    [optional, defaults to ‘’]

    The constituent that the time series represents.

    Limited to 8 characters.

  • tsfill (int) –

    [optional, defaults to -999]

    A time-series in a WDM file must have a value for every time interval. The “tsfill” number is used as a placeholder for missing values.

    Change to a number that is guaranteed to not be a valid number in your time-series.