示例#1
0
def load(h):

    h.add(_.Constant('domain', "g"))
    h.add(_.Constant('levtype', "sfc"))
    h.add(_.Constant('param', "128.128"))
    h.alias('mars.param', 'param')
    h.alias('mars.levtype', 'levtype')
示例#2
0
def load(h):

    h.add(_.Position('offsetBeforeData'))
    h.add(_.Constant('orderOfSpatialDifferencing', 0))
    h.add(_.Constant('numberOfOctetsExtraDescriptors', 0))
    h.add(
        _.Data_g22order_packing('codedValues', _.Get('section7Length'),
                                _.Get('offsetBeforeData'),
                                _.Get('offsetSection7'),
                                _.Get('numberOfValues'), _.Get('bitsPerValue'),
                                _.Get('referenceValue'),
                                _.Get('binaryScaleFactor'),
                                _.Get('decimalScaleFactor'),
                                _.Get('typeOfOriginalFieldValues'),
                                _.Get('groupSplittingMethodUsed'),
                                _.Get('missingValueManagementUsed'),
                                _.Get('primaryMissingValueSubstitute'),
                                _.Get('secondaryMissingValueSubstitute'),
                                _.Get('numberOfGroupsOfDataValues'),
                                _.Get('referenceForGroupWidths'),
                                _.Get('numberOfBitsUsedForTheGroupWidths'),
                                _.Get('referenceForGroupLengths'),
                                _.Get('lengthIncrementForTheGroupLengths'),
                                _.Get('trueLengthOfLastGroup'),
                                _.Get('numberOfBitsForScaledGroupLengths'),
                                _.Get('orderOfSpatialDifferencing'),
                                _.Get('numberOfOctetsExtraDescriptors')))
    h.add(
        _.Data_apply_bitmap('values', _.Get('codedValues'), _.Get('bitmap'),
                            _.Get('missingValue'), _.Get('binaryScaleFactor'),
                            _.Get('numberOfDataPoints'),
                            _.Get('numberOfValues')))
    h.alias('data.packedValues', 'codedValues')
    _.Template('common/statistics_grid.def').load(h)
示例#3
0
def load(h):

    h.add(_.Constant('GRIBEXSection1Problem', (60 - _.Get('section1Length'))))
    h.add(_.Transient('localFlag', 1))
    _.Template('grib1/mars_labeling.def').load(h)
    h.alias('grib2LocalSectionPresent', 'present')
    h.add(_.Constant('grib2LocalSectionNumber', 15))

    if (h.get_s('stepType') == "instant"):
        h.alias('productDefinitionTemplateNumber', 'one')
    else:
        h.alias('productDefinitionTemplateNumber', 'eleven')

    h.add(_.Unsigned('perturbationNumber', 2))
    h.alias('number', 'perturbationNumber')
    h.add(_.Unsigned('systemNumber', 2))
    h.add(_.Unsigned('methodNumber', 2))
    h.add(_.Unsigned('numberOfForecastsInEnsemble', 2))
    h.alias('totalNumber', 'numberOfForecastsInEnsemble')
    h.add(_.Pad('padding_loc15_1', 3))
    h.alias('origin', 'centre')
    h.alias('number', 'perturbationNumber')
    h.alias('total', 'numberOfForecastsInEnsemble')
    h.alias('system', 'systemNumber')
    h.alias('method', 'methodNumber')
    h.alias('local.perturbationNumber', 'perturbationNumber')
    h.alias('local.systemNumber', 'systemNumber')
    h.alias('local.methodNumber', 'methodNumber')
示例#4
0
def load(h):

    h.add(_.Constant('GRIBEXSection1Problem', (120 - _.Get('section1Length'))))
    h.alias('grib2LocalSectionPresent', 'present')
    h.add(_.Constant('grib2LocalSectionNumber', 18))

    if (h.get_s('stepType') == "instant"):
        h.alias('productDefinitionTemplateNumber', 'epsPoint')
    else:
        h.alias('productDefinitionTemplateNumber', 'epsContinous')

    _.Template('grib1/mars_labeling.def').load(h)
    h.add(_.Unsigned('perturbationNumber', 1))
    h.alias('number', 'perturbationNumber')
    h.add(_.Unsigned('numberOfForecastsInEnsemble', 1))
    h.alias('totalNumber', 'numberOfForecastsInEnsemble')
    h.add(_.Codetable('dataOrigin', 1, "common/c-1.table"))
    h.alias('origin', 'dataOrigin')
    h.add(_.Ascii('modelIdentifier', 4))
    h.add(_.Unsigned('consensusCount', 1))
    h.add(_.Pad('padding_loc18_1', 3))

    with h.list('consensus'):
        for i in range(0, h.get_l('consensusCount')):
            h.add(_.Ascii('ccccIdentifiers', 4))
    h.add(_.Padto('padding_loc18_2', (_.Get('offsetSection1') + 120)))
    h.alias('local.dataOrigin', 'dataOrigin')
    h.alias('local.modelIdentifier', 'modelIdentifier')
    h.alias('local.consensusCount', 'consensusCount')
示例#5
0
def load(h):

    h.add(_.Constant('GRIBEXSection1Problem', (328 - _.Get('section1Length'))))
    _.Template('grib1/mars_labeling.def').load(h)
    h.add(_.Unsigned('clusterNumber', 1))
    h.alias('number', 'clusterNumber')
    h.add(_.Unsigned('totalNumberOfClusters', 1))
    h.alias('totalNumber', 'totalNumberOfClusters')
    h.add(_.Pad('padding_loc2_1', 1))
    h.add(_.Unsigned('clusteringMethod', 1))
    h.add(_.Unsigned('startTimeStep', 2))
    h.add(_.Unsigned('endTimeStep', 2))
    h.add(_.Signed('northernLatitudeOfDomain', 3))
    h.add(_.Signed('westernLongitudeOfDomain', 3))
    h.add(_.Signed('southernLatitudeOfDomain', 3))
    h.add(_.Signed('easternLongitudeOfDomain', 3))
    h.add(_.Unsigned('operationalForecastCluster', 1))
    h.add(_.Unsigned('controlForecastCluster', 1))
    h.add(_.Unsigned('numberOfForecastsInCluster', 1))

    if (h.get_l('numberOfForecastsInCluster') > 0):
        h.add(
            _.Unsigned('ensembleForecastNumbers', 1,
                       _.Get('numberOfForecastsInCluster')))

    h.add(_.Padto('padding_loc2_2', (_.Get('offsetSection1') + 328)))
    h.add(_.Constant('unknown', "-"))
    h.add(
        _.Concept('clusteringDomain', 'unknown', 'cluster_domain.def',
                  'conceptsMasterDir', 'conceptsLocalDirAll', True))
    h.alias('number', 'clusterNumber')
    h.alias('domain', 'clusteringDomain')
示例#6
0
def load(h):

    h.add(_.Constant('GRIBEXSection1Problem', (69 - _.Get('section1Length'))))
    h.add(_.Transient('localFlag', 2))
    _.Template('grib1/mars_labeling.def').load(h)
    h.alias('grib2LocalSectionPresent', 'present')
    h.add(_.Constant('grib2LocalSectionNumber', 26))

    if (h.get_s('stepType') == "instant"):
        h.alias('productDefinitionTemplateNumber', 'epsPoint')
    else:
        h.alias('productDefinitionTemplateNumber', 'epsContinous')

    h.add(_.Constant('wrongPadding', 1))
    h.add(_.Unsigned('number', 1))
    h.add(_.Unsigned('numberOfForecastsInEnsemble', 1))
    h.alias('totalNumber', 'numberOfForecastsInEnsemble')
    h.add(_.Unsigned('referenceDate', 4))
    h.add(_.Unsigned('climateDateFrom', 4))
    h.add(_.Unsigned('climateDateTo', 4))
    h.add(_.Pad('padding_loc26_1', 6))
    h.alias('perturbationNumber', 'number')
    h.alias('local.referenceDate', 'referenceDate')
    h.alias('local.climateDateFrom', 'climateDateFrom')
    h.alias('local.climateDateTo', 'climateDateTo')
示例#7
0
def load(h):

    h.add(_.Constant('GRIBEXSection1Problem', (62 - _.Get('section1Length'))))
    _.Template('grib1/mars_labeling.def').load(h)
    h.add(_.Unsigned('intervalBetweenTimes', 1))
    h.add(_.Constant('numberOfIntegers', 12))
    h.add(_.Unsigned('unsignedIntegers', 1, _.Get('numberOfIntegers')))
示例#8
0
def load(h):

    h.add(_.Constant('GRIBEXSection1Problem', (72 - _.Get('section1Length'))))
    _.Template('grib1/mars_labeling.def').load(h)
    h.add(_.Unsigned('classOfAnalysis', 1))
    h.add(_.Unsigned('typeOfAnalysis', 1))
    h.add(_.Unsigned('streamOfAnalysis', 2))
    h.add(_.Ksec1expver('experimentVersionNumberOfAnalysis', 4))
    h.add(_.Unsigned('yearOfAnalysis', 1))
    h.add(_.Unsigned('monthOfAnalysis', 1))
    h.add(_.Unsigned('dayOfAnalysis', 1))
    h.add(_.Unsigned('hourOfAnalysis', 1))
    h.add(_.Unsigned('minuteOfAnalysis', 1))
    h.add(_.Unsigned('centuryOfAnalysis', 1))
    h.add(_.Unsigned('originatingCentreOfAnalysis', 1))
    h.add(_.Unsigned('subcentreOfAnalysis', 1))
    h.add(_.Pad('padding_local11_1', 7))
    h.add(_.Constant('secondsOfAnalysis', 0))
    h.add(
        _.G1date('dateOfAnalysis', _.Get('centuryOfAnalysis'),
                 _.Get('yearOfAnalysis'), _.Get('monthOfAnalysis'),
                 _.Get('dayOfAnalysis')))
    h.add(
        _.Time('timeOfAnalysis', _.Get('hourOfAnalysis'),
               _.Get('minuteOfAnalysis'), _.Get('secondsOfAnalysis')))
    h.alias('date', 'dateOfAnalysis')
    h.alias('time', 'timeOfAnalysis')
示例#9
0
def load(h):

    h.add(_.Ieeefloat('referenceValue', 4))
    h.add(
        _.Reference_value_error('referenceValueError', _.Get('referenceValue'),
                                _.Get('ieee')))
    h.add(_.Signed('binaryScaleFactor', 2))
    h.add(_.Signed('decimalScaleFactor', 2))
    h.add(_.Transient('optimizeScaleFactor', 0))
    h.add(_.Unsigned('bitsPerValue', 1))
    h.alias('numberOfBits', 'bitsPerValue')
    h.alias('numberOfBitsContainingEachPackedValue', 'bitsPerValue')
    h.add(_.Unsigned('matrixBitmapsPresent', 1))
    h.alias('secondaryBitmapPresent', 'matrixBitmapsPresent')
    h.add(_.Unsigned('numberOfCodedValues', 4))
    h.add(_.Unsigned('firstDimension', 2))
    h.alias('NR', 'firstDimension')
    h.add(_.Unsigned('secondDimension', 2))
    h.alias('NC', 'secondDimension')
    h.add(_.Unsigned('firstDimensionCoordinateValueDefinition', 1))
    h.add(_.Unsigned('NC1', 1))
    h.alias(
        'numberOfCoefficientsOrValuesUsedToSpecifyFirstDimensionCoordinateFunction',
        'NC1')
    h.add(_.Unsigned('secondDimensionCoordinateValueDefinition', 1))
    h.add(_.Unsigned('NC2', 1))
    h.alias(
        'numberOfCoefficientsOrValuesUsedToSpecifySecondDimensionCoordinateFunction',
        'NC2')
    h.add(_.Unsigned('firstDimensionPhysicalSignificance', 1))
    h.add(_.Unsigned('secondDimensionPhysicalSignificance', 1))
    h.add(_.Ieeefloat('coefsFirst', 4, _.Get('NC1')))
    h.add(_.Ieeefloat('coefsSecond', 4, _.Get('NC2')))
    h.alias('data.coefsFirst', 'coefsFirst')
    h.alias('data.coefsSecond', 'coefsSecond')

    if (h.get_l('matrixBitmapsPresent') == 1):
        h.add(_.Constant('datumSize', (_.Get('NC') * _.Get('NR'))))
        h.add(
            _.Constant('secondaryBitmapsCount', (_.Get('numberOfValues') + 0)))
        h.add(
            _.Constant('secondaryBitmapsSize',
                       (_.Get('secondaryBitmapsCount') / 8)))
        h.add(
            _.Transient('numberOfDataMatrices',
                        (_.Get('numberOfDataPoints') / _.Get('datumSize'))))
        h.add(_.Position('offsetBBitmap'))
        h.add(
            _.G2bitmap('secondaryBitmaps', _.Get('dummy'),
                       _.Get('missingValue'), _.Get('offsetBSection5'),
                       _.Get('section5Length'), _.Get('numberOfCodedValues'),
                       _.Get('dummy')))
        h.add(
            _.Data_g2secondary_bitmap('bitmap', _.Get('primaryBitmap'),
                                      _.Get('secondaryBitmaps'),
                                      _.Get('missingValue'),
                                      _.Get('datumSize'),
                                      _.Get('numberOfDataPoints')))
示例#10
0
def load(h):

    h.add(_.Constant('GRIBEXSection1Problem', (52 - _.Get('section1Length'))))
    _.Template('grib1/mars_labeling.def').load(h)
    h.add(_.Constant('operStream', "oper"))
    h.alias('mars.stream', 'operStream')
    h.add(_.Unsigned('band', 1))
    h.alias('mars.obstype', 'band')
    h.add(_.Sprintf('marsIdent', "%d", _.Get('indicatorOfTypeOfLevel')))
    h.alias('mars.ident', 'marsIdent')
    h.add(_.Unsigned('functionCode', 1))
    h.add(_.Pad('padding_loc3_1', 1))
示例#11
0
def load(h):

    h.add(_.Position('startOfHeaders'))
    h.add(_.Ascii('identifier', 4))
    h.alias('ls.identifier', 'identifier')
    h.add(_.Transient('missingValue', 9999))
    h.add(_.Constant('ieeeFloats', 0))
    h.add(_.Constant('zero', 0))
    _.Template('diag/section.1.def').load(h)
    _.Template('diag/section.4.def').load(h)
    h.add(_.Ascii('endMark', 4))
    h.add(_.Position('totalLength'))
示例#12
0
def load(h):

    h.add(_.Constant('Ni', 91))
    h.add(_.Constant('Nj', 46))
    h.add(_.Constant('longitudeOfFirstGridPoint', 0))
    h.add(_.Constant('longitudeOfLastGridPoint', 180000))
    h.add(_.Constant('latitudeOfFirstGridPoint', -90000))
    h.add(_.Constant('latitudeOfLastGridPoint', 0))
    h.add(_.Constant('iDirectionIncrement', 2000))
    h.add(_.Constant('jDirectionIncrement', 2000))
    h.add(_.Constant('numberOfDataPoints', 4186))
    h.add(_.Constant('numberOfValues', 4096))
示例#13
0
def load(h):

    h.add(_.Constant('Ni', 72))
    h.add(_.Constant('Nj', 19))
    h.add(_.Constant('longitudeOfFirstGridPoint', 0))
    h.add(_.Constant('longitudeOfLastGridPoint', 355000))
    h.add(_.Constant('latitudeOfFirstGridPoint', 0))
    h.add(_.Constant('latitudeOfLastGridPoint', 90000))
    h.add(_.Constant('iDirectionIncrement', 5000))
    h.add(_.Constant('jDirectionIncrement', 5000))
    h.add(_.Constant('numberOfDataPoints', 1368))
    h.add(_.Constant('numberOfValues', 1297))
示例#14
0
def load(h):

    h.add(_.Constant('GRIBEXSection1Problem', (52 - _.Get('section1Length'))))
    h.alias('grib2LocalSectionPresent', 'present')
    h.add(_.Constant('grib2LocalSectionNumber', 20))
    _.Template('grib1/mars_labeling.def').load(h)
    h.add(_.Unsigned('iterationNumber', 1))
    h.add(_.Unsigned('totalNumberOfIterations', 1))
    h.alias('iteration', 'iterationNumber')
    h.alias('local.iterationNumber', 'iterationNumber')
    h.alias('local.totalNumberOfIterations', 'totalNumberOfIterations')
    h.add(_.Pad('padding_loc20_1', 1))
示例#15
0
def load(h):

    h.add(_.Constant('GRIBEXSection1Problem', (58 - _.Get('section1Length'))))
    h.add(_.Constant('probPoint', 5))
    h.add(_.Constant('probContinous', 9))

    if (((h.get_l('timeRangeIndicator') == 3) or
         (h.get_l('timeRangeIndicator') == 4))
            or (h.get_l('timeRangeIndicator') == 5)):
        h.alias('productDefinitionTemplateNumber', 'probContinous')
    else:
        h.alias('productDefinitionTemplateNumber', 'probPoint')

    _.Template('grib1/mars_labeling.def').load(h)
    h.add(_.Unsigned('forecastProbabilityNumber', 1))
    h.add(_.Unsigned('totalNumberOfForecastProbabilities', 1))
    h.add(_.Signed('localDecimalScaleFactor', 1))
    h.add(_.Unsigned('thresholdIndicator', 1))
    h.add(_.Signed('lowerThreshold', 2))
    h.add(_.Signed('upperThreshold', 2))

    if (h.get_l('thresholdIndicator') == 1):
        h.add(_.Transient('probabilityType', 3))
        h.add(
            _.Transient('scaleFactorOfLowerLimit',
                        _.Get('localDecimalScaleFactor')))
        h.add(_.Transient('scaledValueOfLowerLimit', _.Get('lowerThreshold')))
        h.add(_.Transient('scaleFactorOfUpperLimit', h._missing()))
        h.add(_.Transient('scaledValueOfUpperLimit', h._missing()))

    if (h.get_l('thresholdIndicator') == 2):
        h.add(_.Transient('probabilityType', 4))
        h.add(_.Transient('scaleFactorOfLowerLimit', h._missing()))
        h.add(_.Transient('scaledValueOfLowerLimit', h._missing()))
        h.add(
            _.Transient('scaleFactorOfUpperLimit',
                        _.Get('localDecimalScaleFactor')))
        h.add(_.Transient('scaledValueOfUpperLimit', _.Get('upperThreshold')))

    if (h.get_l('thresholdIndicator') == 3):
        h.add(_.Transient('probabilityType', 2))
        h.add(
            _.Transient('scaleFactorOfLowerLimit',
                        _.Get('localDecimalScaleFactor')))
        h.add(_.Transient('scaledValueOfLowerLimit', _.Get('lowerThreshold')))
        h.add(
            _.Transient('scaleFactorOfUpperLimit',
                        _.Get('localDecimalScaleFactor')))
        h.add(_.Transient('scaledValueOfUpperLimit', _.Get('upperThreshold')))

    h.add(_.Pad('padding_loc5_1', 1))
    h.alias('number', 'forecastProbabilityNumber')
    h.alias('totalNumber', 'totalNumberOfForecastProbabilities')
示例#16
0
def load(h):

    h.add(_.Constant('Ni', 37))
    h.add(_.Constant('Nj', 37))
    h.add(_.Constant('longitudeOfFirstGridPoint', -180000))
    h.add(_.Constant('longitudeOfLastGridPoint', 0))
    h.add(_.Constant('latitudeOfFirstGridPoint', -90000))
    h.add(_.Constant('latitudeOfLastGridPoint', 0))
    h.add(_.Constant('iDirectionIncrement', 5000))
    h.add(_.Constant('jDirectionIncrement', 2500))
    h.add(_.Constant('numberOfDataPoints', 1369))
    h.add(_.Constant('numberOfValues', 1333))
示例#17
0
def load(h):

    h.add(_.Transient('dummyc', 0))
    h.add(_.Constant('conceptsMasterDir', "grib2"))
    h.add(_.Constant('conceptsLocalDirAll', "grib2/localConcepts/[centre:s]"))
    h.add(_.Constant('conceptsLocalDirECMF', "grib2/localConcepts/ecmf"))
    h.add(
        _.Concept('paramIdECMF', 'defaultParameter', 'paramId.def',
                  'conceptsMasterDir', 'conceptsLocalDirECMF', False))
    h.add(
        _.Concept('paramId', 'paramIdECMF', 'paramId.def', 'conceptsMasterDir',
                  'conceptsLocalDirAll', False))
    h.add(
        _.Concept('shortNameECMF', 'defaultShortName', 'shortName.def',
                  'conceptsMasterDir', 'conceptsLocalDirECMF', False))
    h.add(
        _.Concept('shortName', 'shortNameECMF', 'shortName.def',
                  'conceptsMasterDir', 'conceptsLocalDirAll', False))
    h.alias('ls.shortName', 'shortName')
    h.add(
        _.Concept('unitsECMF', 'defaultName', 'units.def', 'conceptsMasterDir',
                  'conceptsLocalDirECMF', False))
    h.add(
        _.Concept('units', 'unitsECMF', 'units.def', 'conceptsMasterDir',
                  'conceptsLocalDirAll', False))
    h.add(
        _.Concept('nameECMF', 'defaultName', 'name.def', 'conceptsMasterDir',
                  'conceptsLocalDirECMF', False))
    h.add(
        _.Concept('name', 'nameECMF', 'name.def', 'conceptsMasterDir',
                  'conceptsLocalDirAll', False))
    h.add(
        _.Concept('cfNameECMF', 'defaultShortName', 'cfName.def',
                  'conceptsMasterDir', 'conceptsLocalDirECMF', False))
    h.add(
        _.Concept('cfName', 'cfNameECMF', 'cfName.def', 'conceptsMasterDir',
                  'conceptsLocalDirAll', False))
    h.add(
        _.Concept('cfVarNameECMF', 'defaultShortName', 'cfVarName.def',
                  'conceptsMasterDir', 'conceptsLocalDirECMF', False))
    h.add(
        _.Concept('cfVarName', 'cfVarNameECMF', 'cfVarName.def',
                  'conceptsMasterDir', 'conceptsLocalDirAll', False))
    h.add(
        _.Concept('modelName', 'defaultName', 'modelName.def',
                  'conceptsMasterDir', 'conceptsLocalDirAll', False))
    _.Template('grib2/products_[productionStatusOfProcessedData].def',
               True).load(h)
    h.add(_.Ifs_param('ifsParam', _.Get('paramId'), _.Get('type')))
示例#18
0
def load(h):

    h.add(_.Constant('g1conceptsMasterDir', "grib1"))
    h.add(_.Constant('g1conceptsLocalDirAll', "grib1/localConcepts/[centre:s]"))
    h.alias('ls.dataType', 'marsType')

    if (h.get_l('localDefinitionNumber') == 83):
        h.add(_.Concept('timerepres', 'unknown', 'timeRepresConcept.def', 'g1conceptsLocalDirAll', 'g1conceptsMasterDir', True))
        h.alias('ls.timerepres', 'timerepres')
        h.add(_.Concept('sort', 'unknown', 'sortConcept.def', 'g1conceptsLocalDirAll', 'g1conceptsMasterDir', True))
        h.alias('ls.sort', 'sort')
        h.add(_.Concept('landtype', 'unknown', 'landTypeConcept.def', 'g1conceptsLocalDirAll', 'g1conceptsMasterDir', True))
        h.alias('ls.landtype', 'landtype')
        h.add(_.Concept('aerosolbinnumber', 'unknown', 'aerosolConcept.def', 'g1conceptsLocalDirAll', 'g1conceptsMasterDir', True))
        h.alias('ls.aerosolbinnumber', 'aerosolbinnumber')
示例#19
0
def load(h):

    h.add(_.Constant('GRIBEXSection1Problem', (56 - _.Get('section1Length'))))
    _.Template('grib1/mars_labeling.def').load(h)
    h.add(_.Unsigned('perturbationNumber', 1))
    h.alias('number', 'perturbationNumber')
    h.add(_.Unsigned('numberOfForecastsInEnsemble', 1))
    h.alias('totalNumber', 'numberOfForecastsInEnsemble')
    h.alias('grib2LocalSectionPresent', 'present')
    h.add(_.Constant('grib2LocalSectionNumber', 1))
    h.add(_.Codetable('marsModel', 2, "mars/model.[centre:l].table"))
    h.alias('mars.model', 'marsModel')
    h.add(_.Codetable('marsDomain', 2, "mars/domain.[centre:l].table"))
    h.alias('mars.domain', 'marsDomain')
    h.add(_.Pad('padding_local40_1', 1))
示例#20
0
def load(h):

    h.add(_.Constant('GRIBEXSection1Problem', (79 - _.Get('section1Length'))))
    _.Template('grib1/mars_labeling.def').load(h)
    h.add(_.Constant('wrongPadding', 1))
    h.add(_.Unsigned('perturbationNumber', 1))
    h.alias('number', 'perturbationNumber')
    h.add(_.Unsigned('numberOfForecastsInEnsemble', 1))
    h.alias('totalNumber', 'numberOfForecastsInEnsemble')
    h.add(_.Unsigned('baseDateEPS', 4))
    h.add(_.Unsigned('baseTimeEPS', 2))
    h.add(_.Unsigned('numberOfRepresentativeMember', 1))
    h.add(_.Unsigned('numberOfMembersInCluster', 1))
    h.add(_.Unsigned('totalInitialConditions', 1))
    h.add(_.Pad('padding_loc28_1', 19))
示例#21
0
def load(h):

    h.add(_.Constant('GRIBEXSection1Problem', (56 - _.Get('section1Length'))))
    h.alias('grib2LocalSectionPresent', 'present')
    h.add(_.Constant('grib2LocalSectionNumber', 38))
    _.Template('grib1/mars_labeling.def').load(h)
    h.add(_.Unsigned('iterationNumber', 1))
    h.add(_.Unsigned('totalNumberOfIterations', 1))
    h.alias('iteration', 'iterationNumber')
    h.alias('local.iterationNumber', 'iterationNumber')
    h.alias('local.totalNumberOfIterations', 'totalNumberOfIterations')
    h.add(_.Unsigned('offsetToEndOf4DvarWindow', 2))
    h.add(_.Unsigned('lengthOf4DvarWindow', 2))
    h.alias('anoffset', 'offsetToEndOf4DvarWindow')
    h.add(_.Pad('padding_loc38_1', 1))
示例#22
0
def load(h):

    h.add(_.Constant('GRIBEXSection1Problem', (52 - _.Get('section1Length'))))
    _.Template('grib1/mars_labeling.def').load(h)
    h.add(_.Unsigned('perturbationNumber', 1))
    h.alias('number', 'perturbationNumber')
    h.add(_.Unsigned('numberOfForecastsInEnsemble', 1))
    h.alias('totalNumber', 'numberOfForecastsInEnsemble')
    h.add(_.Pad('padding_local1_1', 1))
    h.alias('grib2LocalSectionPresent', 'present')
    h.add(_.Constant('grib2LocalSectionNumber', 1))

    if (h.get_s('stepType') == "instant"):

        if ((h.get_s('type') == "em") or (h.get_s('type') == "es")):
            h.alias('productDefinitionTemplateNumber', 'epsStatisticsPoint')
        else:

            if (h.get_l('numberOfForecastsInEnsemble') != 0):

                if (((h.get_l('perturbationNumber') / 2) *
                     2) == h.get_l('perturbationNumber')):
                    h.alias('typeOfEnsembleForecast', 'two')
                else:
                    h.alias('typeOfEnsembleForecast', 'three')

                h.alias('productDefinitionTemplateNumber', 'epsPoint')
            else:
                h.alias('productDefinitionTemplateNumber', 'zero')

    else:

        if ((h.get_s('type') == "em") or (h.get_s('type') == "es")):
            h.alias('productDefinitionTemplateNumber',
                    'epsStatisticsContinous')
        else:

            if (h.get_l('numberOfForecastsInEnsemble') != 0):

                if (((h.get_l('perturbationNumber') / 2) *
                     2) == h.get_l('perturbationNumber')):
                    h.alias('typeOfEnsembleForecast', 'two')
                else:
                    h.alias('typeOfEnsembleForecast', 'three')

                h.alias('productDefinitionTemplateNumber', 'epsContinous')
            else:
                h.alias('productDefinitionTemplateNumber', 'eight')
示例#23
0
def load(h):

    h.add(_.Constant('GRIBEXSection1Problem', (120 - _.Get('section1Length'))))
    _.Template('grib1/mars_labeling.def').load(h)
    h.add(_.Unsigned('yearOfReference', 1))
    h.add(_.Unsigned('monthOfReference', 1))
    h.add(_.Unsigned('dayOfReference', 1))
    h.add(_.Unsigned('hourOfReference', 1))
    h.add(_.Unsigned('minuteOfReference', 1))
    h.add(_.Unsigned('centuryOfReference', 1))
    h.add(_.Transient('secondsOfReference', 0))
    h.add(_.Unsigned('numberOfForcasts', 1))
    h.add(_.Unsigned('numberOfAnalysis', 1))

    if h.get_l('numberOfForcasts'):
        h.add(_.Unsigned('forecastSteps', 3, _.Get('numberOfForcasts')))

    if h.get_l('numberOfAnalysis'):
        h.add(_.Signed('analysisOffsets', 3, _.Get('numberOfAnalysis')))

    h.add(_.Padto('padding_local_35', (_.Get('offsetSection1') + 120)))
    h.add(
        _.G1date('dateOfReference', _.Get('centuryOfReference'),
                 _.Get('yearOfReference'), _.Get('monthOfReference'),
                 _.Get('dayOfReference')))
    h.add(
        _.Time('timeOfReference', _.Get('hourOfReference'),
               _.Get('minuteOfReference'), _.Get('secondsOfReference')))

    if (h.get_l('indicatorOfTypeOfLevel') == 160):
        h.alias('mars.levelist', 'level')
示例#24
0
def load(h):

    _.Template('grib1/mars_labeling.def').load(h)
    h.add(_.Constant('GRIBEXSection1Problem', (80 - _.Get('section1Length'))))
    h.add(_.Unsigned('number', 1))
    h.alias('perturbationNumber', 'number')
    h.add(_.Unsigned('ensembleSize', 1))
    h.alias('totalNumber', 'ensembleSize')
    h.add(
        _.Sprintf('quantile', "%s:%s", _.Get('number'), _.Get('ensembleSize')))
    h.add(_.Unsigned('versionNumberOfExperimentalSuite', 1))
    h.alias('powerOfTenUsedToScaleClimateWeight',
            'versionNumberOfExperimentalSuite')
    h.add(_.Unsigned('implementationDateOfModelCycle', 4))
    h.alias('weightAppliedToClimateMonth1', 'implementationDateOfModelCycle')
    h.add(_.Unsigned('numberOfReforecastYearsInModelClimate', 3))
    h.alias('firstMonthUsedToBuildClimateMonth1',
            'numberOfReforecastYearsInModelClimate')
    h.add(_.Unsigned('numberOfDaysInClimateSamplingWindow', 3))
    h.alias('lastMonthUsedToBuildClimateMonth1',
            'numberOfDaysInClimateSamplingWindow')
    h.add(_.Unsigned('sampleSizeOfModelClimate', 3))
    h.alias('firstMonthUsedToBuildClimateMonth2', 'sampleSizeOfModelClimate')
    h.add(_.Unsigned('versionOfModelClimate', 3))
    h.alias('lastMonthUsedToBuildClimateMonth2', 'versionOfModelClimate')
    h.add(_.Unsigned('efiOrder', 1))
    h.add(_.Pad('padding_loc19_2', 11))
示例#25
0
def load(h):

    h.add(_.Constant('GRIBEXSection1Problem', (100 - _.Get('section1Length'))))
    _.Template('grib1/mars_labeling.def').load(h)
    h.add(_.Unsigned('forecastOrSingularVectorNumber', 2))
    h.add(_.Unsigned('numberOfIterations', 2))
    h.add(_.Unsigned('numberOfSingularVectorsComputed', 2))
    h.add(_.Unsigned('normAtInitialTime', 1))
    h.add(_.Unsigned('normAtFinalTime', 1))
    h.add(_.Unsigned('multiplicationFactorForLatLong', 4))
    h.add(_.Signed('northWestLatitudeOfVerficationArea', 4))
    h.add(_.Signed('northWestLongitudeOfVerficationArea', 4))
    h.add(_.Signed('southEastLatitudeOfVerficationArea', 4))
    h.add(_.Signed('southEastLongitudeOfVerficationArea', 4))
    h.add(_.Unsigned('accuracyMultipliedByFactor', 4))
    h.add(_.Unsigned('numberOfSingularVectorsEvolved', 2))
    h.add(_.Signed('NINT_LOG10_RITZ', 4))
    h.add(_.Signed('NINT_RITZ_EXP', 4))
    h.add(_.Unsigned('optimisationTime', 1))
    h.alias('mars.opttime', 'optimisationTime')
    h.add(_.Unsigned('forecastLeadTime', 1))
    h.alias('mars.leadtime', 'forecastLeadTime')
    h.add(_.Ascii('marsDomain', 1))
    h.add(_.Unsigned('methodNumber', 2))
    h.add(_.Unsigned('numberOfForecastsInEnsemble', 2))
    h.add(_.Unsigned('shapeOfVerificationArea', 1))
    h.add(_.Pad('padding_loc21_1', 1))
    h.alias('mars.domain', 'marsDomain')
示例#26
0
def load(h):

    h.add(_.Constant('sphericalHarmonics', 1))
    h.add(_.Unsigned('J', 4))
    h.alias('pentagonalResolutionParameterJ', 'J')
    h.alias('geography.J', 'J')
    h.add(_.Unsigned('K', 4))
    h.alias('pentagonalResolutionParameterK', 'K')
    h.alias('geography.K', 'K')
    h.add(_.Unsigned('M', 4))
    h.alias('pentagonalResolutionParameterM', 'M')
    h.alias('geography.M', 'M')
    h.add(_.Codetable('spectralType', 1, "3.6.table", _.Get('masterDir'), _.Get('localDir')))
    h.alias('spectralDataRepresentationType', 'spectralType')
    h.add(_.Codetable('spectralMode', 1, "3.7.table", _.Get('masterDir'), _.Get('localDir')))
    h.alias('spectralDataRepresentationMode', 'spectralMode')
    h.add(_.Signed('latitudeOfSouthernPole', 4))
    h.alias('latitudeOfTheSouthernPoleOfProjection', 'latitudeOfSouthernPole')
    h.add(_.Unsigned('longitudeOfSouthernPole', 4))
    h.alias('longitudeOfTheSouthernPoleOfProjection', 'longitudeOfSouthernPole')
    h.add(_.Scale('latitudeOfSouthernPoleInDegrees', _.Get('latitudeOfSouthernPole'), _.Get('one'), _.Get('grib2divider'), _.Get('truncateDegrees')))
    h.alias('geography.latitudeOfSouthernPoleInDegrees', 'latitudeOfSouthernPoleInDegrees')
    h.add(_.G2lon('longitudeOfSouthernPoleInDegrees', _.Get('longitudeOfSouthernPole')))
    h.alias('geography.longitudeOfSouthernPoleInDegrees', 'longitudeOfSouthernPoleInDegrees')
    h.add(_.Ieeefloat('angleOfRotation', 4))
    h.alias('geography.angleOfRotationInDegrees', 'angleOfRotation')
    h.alias('angleOfRotationOfProjection', 'angleOfRotation')
    h.alias('isRotatedGrid', 'one')
示例#27
0
def load(h):

    h.add(_.Constant('GRIBEXSection1Problem', (960 - _.Get('section1Length'))))
    _.Template('grib1/mars_labeling.def').load(h)
    h.add(_.Unsigned('clusterNumber', 1))
    h.alias('number', 'clusterNumber')
    h.add(_.Unsigned('totalNumberOfClusters', 1))
    h.alias('totalNumber', 'totalNumberOfClusters')
    h.add(_.Pad('padding_loc29_1', 1))
    h.add(_.Unsigned('clusteringMethod', 1))
    h.add(_.Signed('northernLatitudeOfDomain', 3))
    h.add(_.Signed('westernLongitudeOfDomain', 3))
    h.add(_.Signed('southernLatitudeOfDomain', 3))
    h.add(_.Signed('easternLongitudeOfDomain', 3))
    h.add(_.Unsigned('numberOfForecastsInCluster', 1))
    h.add(_.Unsigned('numberOfParametersUsedForClustering', 1))
    h.add(_.Unsigned('numberOfPressureLevelsUsedForClustering', 1))
    h.add(_.Unsigned('numberOfStepsUsedForClustering', 1))
    h.add(_.Pad('padding_loc29_2', 10))

    with h.list('listOfEnsembleForecastNumbers'):
        for i in range(0, h.get_l('numberOfForecastsInCluster')):
            h.add(_.Unsigned('baseDateEPS', 4))
            h.add(_.Unsigned('baseTimeEPS', 2))
            h.add(_.Unsigned('number', 1))

    with h.list('listOfParametersUsedForClustering'):
        for i in range(0, h.get_l('numberOfParametersUsedForClustering')):
            h.add(_.Unsigned('parameterCode', 1))
            h.add(_.Unsigned('tableCode', 1))
    h.add(_.Unsigned('pressureLevel', 2, _.Get('numberOfPressureLevelsUsedForClustering')))
    h.add(_.Unsigned('stepForClustering', 2, _.Get('numberOfStepsUsedForClustering')))
    h.add(_.Padto('padding_loc29_3', (_.Get('offsetSection1') + 960)))
    h.alias('number', 'clusterNumber')
示例#28
0
def load(h):

    h.add(_.Constant('GRIBEXSection1Problem', (334 - _.Get('section1Length'))))
    _.Template('grib1/mars_labeling.def').load(h)
    h.add(_.Unsigned('tubeNumber', 1))
    h.add(_.Unsigned('totalNumberOfTubes', 1))
    h.add(_.Unsigned('centralClusterDefinition', 1))
    h.add(_.Unsigned('parameterIndicator', 1))
    h.add(_.Unsigned('levelIndicator', 1))
    h.add(_.Signed('northLatitudeOfDomainOfTubing', 3))
    h.add(_.Signed('westLongitudeOfDomainOfTubing', 3))
    h.add(_.Signed('southLatitudeOfDomainOfTubing', 3))
    h.add(_.Signed('eastLongitudeOfDomainOfTubing', 3))
    h.add(_.Unsigned('numberOfOperationalForecastTube', 1))
    h.add(_.Unsigned('numberOfControlForecastTube', 1))
    h.add(_.Unsigned('heightOrPressureOfLevel', 2))
    h.add(_.Unsigned('referenceStep', 2))
    h.add(_.Unsigned('radiusOfCentralCluster', 2))
    h.add(_.Unsigned('ensembleStandardDeviation', 2))
    h.add(_.Unsigned('distanceFromTubeToEnsembleMean', 2))
    h.add(_.Unsigned('numberOfForecastsInTube', 1))
    h.add(_.Unsigned('ensembleForecastNumbers', 1, _.Get('numberOfForecastsInTube')))
    h.add(_.Padto('padding_loc10_1', (_.Get('offsetSection1') + 334)))
    h.add(_.Concept('tubeDomain', 'unknown', 'tube_domain.def', 'conceptsMasterDir', 'conceptsLocalDirAll', False))
    h.alias('number', 'tubeNumber')
    h.alias('totalNumber', 'totalNumberOfTubes')
    h.alias('reference', 'referenceStep')
    h.alias('domain', 'tubeDomain')
示例#29
0
def load(h):

    h.add(_.Constant('dataRepresentationType', 90))
    h.add(
        _.Codetable('parameterCategory', 1, "4.1.[discipline:l].table",
                    _.Get('masterDir'), _.Get('localDir')))
    h.add(
        _.Codetable('parameterNumber', 1,
                    "4.2.[discipline:l].[parameterCategory:l].table",
                    _.Get('masterDir'), _.Get('localDir')))
    h.add(_.Codetable_units('parameterUnits', _.Get('parameterNumber')))
    h.add(_.Codetable_title('parameterName', _.Get('parameterNumber')))
    h.add(
        _.Codetable('typeOfGeneratingProcess', 1, "4.3.table",
                    _.Get('masterDir'), _.Get('localDir')))
    h.add(_.Unsigned('observationGeneratingProcessIdentifier', 1))
    h.alias('generatingProcessIdentifier',
            'observationGeneratingProcessIdentifier')
    h.add(_.Unsigned('NB', 1))
    h.alias('numberOfContributingSpectralBands', 'NB')

    with h.list('listOfContributingSpectralBands'):
        for i in range(0, h.get_l('numberOfContributingSpectralBands')):
            h.add(_.Unsigned('satelliteSeries', 2))
            h.add(_.Unsigned('satelliteNumber', 2))
            h.add(_.Unsigned('instrumentType', 2))
            h.add(_.Unsigned('scaleFactorOfCentralWaveNumber', 1))
            h.add(_.Unsigned('scaledValueOfCentralWaveNumber', 4))
示例#30
0
def load(h):

    h.add(_.Constant('GRIBEXSection1Problem', (328 - _.Get('section1Length'))))
    _.Template('grib1/mars_labeling.def').load(h)
    h.add(_.Unsigned('clusterNumber', 1))
    h.alias('number', 'clusterNumber')
    h.add(_.Unsigned('totalNumberOfClusters', 1))
    h.alias('totalNumber', 'totalNumberOfClusters')
    h.add(_.Pad('padding_loc2_1', 1))
    h.add(_.Unsigned('clusteringMethod', 1))
    h.add(_.Unsigned('startTimeStep', 2))
    h.add(_.Unsigned('endTimeStep', 2))
    h.add(_.Signed('northernLatitudeOfDomain', 3))
    h.add(_.Signed('westernLongitudeOfDomain', 3))
    h.add(_.Signed('southernLatitudeOfDomain', 3))
    h.add(_.Signed('easternLongitudeOfDomain', 3))
    h.add(_.Ascii('clusteringDomain', 1))
    h.add(_.Unsigned('operationalForecastCluster', 1))
    h.add(_.Unsigned('controlForecastCluster', 1))
    h.add(_.Unsigned('representativeMember', 1))
    h.add(_.Codetable('climatologicalRegime', 1, "grib1/regime.table"))
    h.add(_.Unsigned('numberOfForecastsInCluster', 1))

    if (h.get_l('numberOfForecastsInCluster') > 0):
        h.add(
            _.Unsigned('ensembleForecastNumbers', 1,
                       _.Get('numberOfForecastsInCluster')))

    h.add(_.Padto('padding_loc2_2', (_.Get('offsetSection1') + 328)))
    h.alias('mars.number', 'clusterNumber')
    h.alias('mars.domain', 'clusteringDomain')