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')
def load(h): _.Template('grib1/mars_labeling.def').load(h) h.alias('grib2LocalSectionPresent', 'present') h.add(_.Constant('grib2LocalSectionNumber', 25)) if (h.get_s('stepType') == "instant"): h.alias('productDefinitionTemplateNumber', 'zero') else: h.alias('productDefinitionTemplateNumber', 'eight') h.add(_.Constant('GRIBEXSection1Problem', (52 - _.Get('section1Length')))) h.add(_.Unsigned('componentIndex', 1)) h.alias('mars.number', 'componentIndex') h.add(_.Unsigned('numberOfComponents', 1)) h.add(_.Unsigned('modelErrorType', 1)) h.alias('local.componentIndex', 'componentIndex') h.alias('local.numberOfComponents', 'numberOfComponents') h.alias('local.modelErrorType', 'modelErrorType')
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')
def load(h): h.add(_.Constant('GRIBEXSection1Problem', (240 - _.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(_.Unsigned('forecastMonth', 2)) h.add(_.Unsigned('dateOfForecastRun', 4)) h.alias('referenceDate', 'dateOfForecastRun') h.add(_.Unsigned('numberOfModels', 1)) h.add(_.Pad('padding_local1_31', 42)) with h.list('listOfModelIdentifiers'): for i in range(0, h.get_l('numberOfModels')): h.add(_.Codetable('modelIdentifier', 2, "common/c-1.table")) h.add(_.Padto('padding_sec1_loc', (_.Get('offsetSection1') + 240))) h.alias('number', 'perturbationNumber') h.alias('total', 'numberOfForecastsInEnsemble')
def load(h): _.Template('grib1/mars_labeling.def').load(h) h.add(_.Pad('padding_loc191_1', 2)) h.add(_.Unsigned('formatVersionMajorNumber', 1)) h.add(_.Unsigned('formatVersionMinorNumber', 1)) h.add(_.Unsigned('originalSubCentreIdentifier', 1)) h.alias('mars.levelist', 'level') h.add(_.Pad('padding_loc191_2', 4)) h.add(_.Unsigned('numberOfBytesOfFreeFormatData', 2)) h.add(_.Position('offsetFreeFormData')) h.add(_.Unsigned('freeFormData', 1, _.Get('numberOfBytesOfFreeFormatData'))) h.add(_.Padtomultiple('padding_loc191_3', _.Get('offsetFreeFormData'), 80)) h.add(_.Position('offsetAfterPadding')) h.add( _.Constant( 'GRIBEXSection1Problem', ((_.Get('offsetAfterPadding') - _.Get('offsetFreeFormData')) % 80)))
def load(h): h.add(_.Unsigned('forecastProbabilityNumber', 1)) h.add(_.Unsigned('totalNumberOfForecastProbabilities', 1)) h.add( _.Codetable('probabilityType', 1, "4.9.table", _.Get('masterDir'), _.Get('localDir'))) h.add(_.Codetable_title('probabilityTypeName', _.Get('probabilityType'))) h.add(_.Signed('scaleFactorOfLowerLimit', 1)) h.add(_.Signed('scaledValueOfLowerLimit', 4)) h.add( _.From_scale_factor_scaled_value('lowerLimit', _.Get('scaleFactorOfLowerLimit'), _.Get('scaledValueOfLowerLimit'))) h.add(_.Signed('scaleFactorOfUpperLimit', 1)) h.add(_.Signed('scaledValueOfUpperLimit', 4)) h.add( _.From_scale_factor_scaled_value('upperLimit', _.Get('scaleFactorOfUpperLimit'), _.Get('scaledValueOfUpperLimit')))
def load(h): h.add(_.Constant('ieeeFloats', 0)) h.add(_.Transient('eps', 0)) h.add(_.Constant('two', 1)) h.add(_.Constant('three', 1)) h.add(_.Constant('eight', 8)) h.add(_.Constant('eleven', 11)) h.add(_.Constant('epsPoint', 1)) h.add(_.Constant('epsContinous', 11)) h.add(_.Constant('epsStatisticsPoint', 2)) h.add(_.Constant('epsStatisticsContinous', 12)) h.add(_.Headers_only('headersOnly')) h.add(_.Gts_header('gts_header')) h.add(_.Gts_header('gts_TTAAii', 20, 6)) h.add(_.Gts_header('gts_CCCC', 27, 4)) h.add(_.Gts_header('gts_ddhh00', 32, 6)) h.add(_.Ascii('identifier', 4)) h.add(_.Constant('offsetSection0', 0)) h.add(_.Constant('section0Length', 8)) h.add(_.Section_pointer('section0Pointer', _.Get('offsetSection0'), _.Get('section0Length'), 0)) h.add(_.G1_message_length('totalLength', 3, _.Get('section4Length'))) h.add(_.Position('startOfHeaders')) h.add(_.Unsigned('editionNumber', 1)) _.Template('grib1/section.1.def').load(h) h.alias('ls.edition', 'editionNumber') h.add(_.Bit('gridDescriptionSectionPresent', _.Get('section1Flags'), 7)) h.add(_.Gds_is_present('GDSPresent', _.Get('gridDescriptionSectionPresent'), _.Get('gridDefinition'), _.Get('bitmapPresent'), _.Get('values'))) h.add(_.Bit('bitmapPresent', _.Get('section1Flags'), 6)) h.alias('bitmapSectionPresent', 'bitmapPresent') h.alias('geography.bitmapPresent', 'bitmapPresent') h.alias('missingValuesPresent', 'bitmapPresent') h.add(_.Transient('angleSubdivisions', 1000)) if h.get_l('gridDescriptionSectionPresent'): _.Template('grib1/section.2.def').load(h) else: _.Template('grib1/predefined_grid.def').load(h) h.add(_.Position('endOfHeadersMarker')) h.add(_.Evaluate('lengthOfHeaders', (_.Get('endOfHeadersMarker') - _.Get('startOfHeaders')))) h.add(_.Md5('md5Headers', _.Get('startOfHeaders'), _.Get('lengthOfHeaders'))) if not (h.get_l('headersOnly')): h.add(_.Transient('missingValue', 9999)) if h.get_l('bitmapPresent'): _.Template('grib1/section.3.def').load(h) else: h.add(_.Constant('tableReference', 0)) _.Template('grib1/section.4.def').load(h) _.Template('grib1/section.5.def').load(h)
def load(h): h.add(_.Unsigned('J', 2)) h.alias('pentagonalResolutionParameterJ', 'J') h.alias('geography.J', 'J') h.add(_.Unsigned('K', 2)) h.alias('pentagonalResolutionParameterK', 'K') h.alias('geography.K', 'K') h.add(_.Unsigned('M', 2)) h.alias('pentagonalResolutionParameterM', 'M') h.alias('geography.M', 'M') h.add(_.Constant('_T', -1)) h.add( _.Spectral_truncation('numberOfValues', _.Get('J'), _.Get('K'), _.Get('M'), _.Get('_T'))) h.alias('numberOfPoints', 'numberOfValues') h.alias('numberOfDataPoints', 'numberOfValues') h.add(_.Codetable('representationType', 1, "grib1/9.table")) h.add(_.Codetable('representationMode', 1, "grib1/10.table")) h.add(_.Pad('padding_grid50_1', 18)) h.add(_.Constant('Nj', 0))
def load(h): 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('aerosolType', 2, "4.233.table", _.Get('masterDir'), _.Get('localDir'))) h.add( _.Codetable('typeOfSizeInterval', 1, "4.91.table", _.Get('masterDir'), _.Get('localDir'))) h.alias('typeOfIntervalForFirstAndSecondSize', 'typeOfSizeInterval') h.add(_.Signed('scaleFactorOfFirstSize', 1)) h.add(_.Signed('scaledValueOfFirstSize', 4)) h.add(_.Signed('scaleFactorOfSecondSize', 1)) h.add(_.Signed('scaledValueOfSecondSize', 4)) h.add( _.Codetable('typeOfGeneratingProcess', 1, "4.3.table", _.Get('masterDir'), _.Get('localDir'))) h.add(_.Unsigned('backgroundProcess', 1)) h.alias('backgroundGeneratingProcessIdentifier', 'backgroundProcess') h.add(_.Unsigned('generatingProcessIdentifier', 1)) h.add(_.Unsigned('hoursAfterDataCutoff', 2)) h.alias('hoursAfterReferenceTimeOfDataCutoff', 'hoursAfterDataCutoff') h.add(_.Unsigned('minutesAfterDataCutoff', 1)) h.alias('minutesAfterReferenceTimeOfDataCutoff', 'minutesAfterDataCutoff') h.add( _.Codetable('indicatorOfUnitOfTimeRange', 1, "4.4.table", _.Get('masterDir'), _.Get('localDir'))) h.alias('defaultStepUnits', 'one') _.Template('grib2/localConcepts/[centre:s]/default_step_units.def', True).load(h) h.add(_.TransientCodetable('stepUnits', 1, "stepUnits.table")) h.add(_.Signed('forecastTime', 4))
def load(h): 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(_.Unsigned('inputProcessIdentifier', 2)) h.add(_.StringCodetable('inputOriginatingCentre', 2, "common/c-11.table")) h.add(_.Unsigned('typeOfPostProcessing', 1)) h.add( _.Codetable('typeOfGeneratingProcess', 1, "4.3.table", _.Get('masterDir'), _.Get('localDir'))) h.add(_.Unsigned('backgroundProcess', 1)) h.alias('backgroundGeneratingProcessIdentifier', 'backgroundProcess') h.add(_.Unsigned('generatingProcessIdentifier', 1)) h.add(_.Unsigned('hoursAfterDataCutoff', 2)) h.alias('hoursAfterReferenceTimeOfDataCutoff', 'hoursAfterDataCutoff') h.add(_.Unsigned('minutesAfterDataCutoff', 1)) h.alias('minutesAfterReferenceTimeOfDataCutoff', 'minutesAfterDataCutoff') h.add( _.Codetable('indicatorOfUnitOfTimeRange', 1, "4.4.table", _.Get('masterDir'), _.Get('localDir'))) h.alias('defaultStepUnits', 'one') _.Template('grib2/localConcepts/[centre:s]/default_step_units.def', True).load(h) h.add(_.TransientCodetable('stepUnits', 1, "stepUnits.table")) h.add(_.Signed('forecastTime', 4))
def load(h): h.add( _.Codetable('groupSplitting', 1, "5.4.table", _.Get('masterDir'), _.Get('localDir'))) h.add( _.Codetable('missingValueManagement', 1, "5.5.table", _.Get('masterDir'), _.Get('localDir'))) h.add(_.Unsigned('primaryMissingValue', 4)) h.add(_.Unsigned('secondaryMissingValue', 4)) h.add(_.Unsigned('numberOfGroups', 4)) h.alias('NG', 'numberOfGroups') h.add(_.Unsigned('referenceOfWidths', 1)) h.add(_.Unsigned('widthOfWidths', 1)) h.add(_.Unsigned('referenceOfLengths', 4)) h.add(_.Unsigned('incrementOfLengths', 1)) h.add(_.Unsigned('trueLengthOfLastGroup', 4)) h.add(_.Unsigned('widthOfLengths', 1))
def load(h): _.Template('grib1/mars_labeling.def').load(h) h.alias('grib2LocalSectionPresent', 'present') h.add(_.Constant('grib2LocalSectionNumber', 49)) if (h.get_s('stepType') == "instant"): h.alias('productDefinitionTemplateNumber', 'zero') else: h.alias('productDefinitionTemplateNumber', 'eight') h.add(_.Constant('GRIBEXSection1Problem', (56 - _.Get('section1Length')))) h.add(_.Unsigned('perturbationNumber', 1)) h.alias('mars.number', 'perturbationNumber') h.add(_.Unsigned('numberOfForecastsInEnsemble', 1)) h.add(_.Unsigned('modelErrorType', 1)) h.add(_.Unsigned('offsetToEndOf4DvarWindow', 2)) h.add(_.Unsigned('lengthOf4DvarWindow', 2)) h.alias('anoffset', 'offsetToEndOf4DvarWindow') h.alias('local.perturbationNumber', 'perturbationNumber') h.alias('local.numberOfForecastsInEnsemble', 'numberOfForecastsInEnsemble') h.alias('local.modelErrorType', 'modelErrorType')
def load(h): h.add(_.Codetable('dataOrigin', 1, "common/c-1.table")) h.alias('mars.origin', 'dataOrigin') h.add(_.Ascii('modelIdentifier', 4)) h.add(_.Unsigned('consensusCount', 1)) with h.list('consensus'): for i in range(0, h.get_l('consensusCount')): h.add(_.Ascii('ccccIdentifiers', 4)) h.alias('local.dataOrigin', 'dataOrigin') h.alias('local.modelIdentifier', 'modelIdentifier') h.alias('local.consensusCount', 'consensusCount')
def load(h): h.add(_.StringCodetable('marsClass', 1, "mars/eswi/class.table")) h.add(_.StringCodetable('marsType', 1, "mars/eswi/type.table")) h.add(_.StringCodetable('marsStream', 2, "mars/eswi/stream.table")) h.add(_.Ksec1expver('experimentVersionNumber', 4)) h.add(_.Pad('reservedNeedNotBePresent', 2)) h.add(_.StringCodetable('marsModel', 1, "mars/eswi/model.table")) h.add(_.Codetable('matchSort', 1, "grib1/localConcepts/eswi/sort.table")) h.add(_.Codetable('matchTimeRepres', 1, "grib1/localConcepts/eswi/timerepres.table")) h.add(_.Codetable('matchLandType', 1, "grib1/localConcepts/eswi/landtype.table")) h.add(_.Codetable('matchAerosolBinNumber', 2, "grib1/localConcepts/eswi/aerosolbinnumber.table")) h.add(_.Unsigned('meanSize', 2))
def load(h): h.add(_.Constant('GRIBEXSection1Problem', (106 - _.Get('section1Length')))) h.add(_.Transient('localFlag', 3)) h.alias('grib2LocalSectionPresent', 'present') h.add(_.Constant('grib2LocalSectionNumber', 30)) _.Template('grib1/mars_labeling.def').load(h) if (h.get_s('stepType') == "instant"): if ((h.get_s('type') == "em") or (h.get_s('type') == "es")): h.alias('productDefinitionTemplateNumber', 'epsStatisticsPoint') else: h.alias('productDefinitionTemplateNumber', 'epsPoint') else: if ((h.get_s('type') == "em") or (h.get_s('type') == "es")): h.alias('productDefinitionTemplateNumber', 'epsStatisticsContinous') else: h.alias('productDefinitionTemplateNumber', 'epsContinous') h.add(_.Unsigned('perturbationNumber', 1)) h.alias('number', 'perturbationNumber') h.add(_.Unsigned('numberOfForecastsInEnsemble', 1)) h.alias('totalNumber', 'numberOfForecastsInEnsemble') h.add(_.Unsigned('oceanAtmosphereCoupling', 1)) h.add(_.Pad('padding_loc30_1', 3)) h.add(_.Unsigned('legBaseDate', 4)) h.add(_.Unsigned('legBaseTime', 2)) h.add(_.Unsigned('legNumber', 1)) h.add(_.Unsigned('referenceDate', 4)) h.add(_.Unsigned('climateDateFrom', 4)) h.add(_.Unsigned('climateDateTo', 4)) h.alias('local.oceanAtmosphereCoupling', 'oceanAtmosphereCoupling') h.alias('local.legBaseDate', 'legBaseDate') h.alias('local.legBaseTime', 'legBaseTime') h.alias('local.legNumber', 'legNumber') h.alias('local.referenceDate', 'referenceDate') h.alias('local.climateDateFrom', 'climateDateFrom') h.alias('local.climateDateTo', 'climateDateTo') h.alias('mars._leg_number', 'legNumber') h.add(_.Pad('padding_loc30_2', 32))
def load(h): _.Template('grib1/mars_labeling.def').load(h) h.add(_.Unsigned('perturbationNumber', 1)) if (h.get_l('perturbationNumber') != 0): h.alias('number', 'perturbationNumber') h.add(_.Unsigned('numberOfForecastsInEnsemble', 1)) 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_l('numberOfForecastsInEnsemble') != 0): h.alias('productDefinitionTemplateNumber', 'epsPoint') else: if (h.get_l('numberOfForecastsInEnsemble') != 0): h.alias('productDefinitionTemplateNumber', 'epsContinous')
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(_.Transient('computeLaplacianOperator', 1)) h.add( _.Codetable('biFourierSubTruncationType', 1, "5.25.table", _.Get('masterDir'), _.Get('localDir'))) h.add( _.Codetable('biFourierPackingModeForAxes', 1, "5.26.table", _.Get('masterDir'), _.Get('localDir'))) h.add(_.Constant('laplacianScalingFactorUnset', -2147483647)) h.add(_.Signed('laplacianScalingFactor', 4)) h.add( _.Scale('laplacianOperator', _.Get('laplacianScalingFactor'), _.Get('one'), _.Get('million'), _.Get('truncateLaplacian'))) h.alias('data.laplacianOperator', 'laplacianOperator') h.add( _.Evaluate( 'laplacianOperatorIsSet', _.And((_.Get('laplacianScalingFactor') != _.Get('laplacianScalingFactorUnset')), _.Not(_.Get('computeLaplacianOperator'))))) h.add(_.Unsigned('biFourierResolutionSubSetParameterN', 2)) h.add(_.Unsigned('biFourierResolutionSubSetParameterM', 2)) h.add(_.Unsigned('totalNumberOfValuesInUnpackedSubset', 4)) h.add( _.Codetable('unpackedSubsetPrecision', 1, "5.7.table", _.Get('masterDir'), _.Get('localDir'))) h.alias('precisionOfTheUnpackedSubset', 'unpackedSubsetPrecision')
def load(h): 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')
def load(h): h.add(_.Transient('defaultFaFieldName', "")) h.add(_.Transient('defaultFaLevelName', "")) h.add(_.Transient('defaultFaModelName', "")) h.add( _.Concept('faFieldName', 'defaultFaFieldName', 'faFieldName.def', 'conceptsMasterDir', 'conceptsLocalDirAll', False)) h.add( _.Concept('faLevelName', 'defaultFaLevelName', 'faLevelName.def', 'conceptsMasterDir', 'conceptsLocalDirAll', False)) h.add( _.Concept('faModelName', 'defaultFaModelName', 'faModelName.def', 'conceptsMasterDir', 'conceptsLocalDirAll', False)) h.add(_.Transient('LSTCUM', 0)) h.add(_.Transient('ZLMULT', 1)) h.add(_.Transient('ZLBASE', 0)) h.add(_.Ascii('CLNOMA', 16)) h.add(_.Unsigned('INGRIB', 8)) h.add(_.Unsigned('LLCOSP', 8)) h.add(_.Unsigned('INBITS', 8)) h.add(_.Signed('FMULTM', 8)) h.add(_.Signed('FMULTE', 8))
def load(h): h.add(_.Label('CMC local definition (Canada)')) h.add(_.Unsigned('applicationIdentifier', 1)) h.add(_.Unsigned('type', 1)) h.add(_.Unsigned('identificationNumber', 1)) h.add(_.Unsigned('productIdentifier', 1)) h.add(_.Unsigned('spatialSmoothingOfProduct', 1)) h.add(_.Unsigned('isotopeIdentificationNumber', 2))
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') h.add(_.Signed('latitudeOfThePoleOfStretching', 4)) h.add(_.Signed('longitudeOfThePoleOfStretching', 4)) h.add(_.Scale('latitudeOfStretchingPoleInDegrees', _.Get('latitudeOfThePoleOfStretching'), _.Get('oneConstant'), _.Get('grib2divider'), _.Get('truncateDegrees'))) h.alias('geography.latitudeOfStretchingPoleInDegrees', 'latitudeOfStretchingPoleInDegrees') h.add(_.Scale('longitudeOfStretchingPoleInDegrees', _.Get('longitudeOfThePoleOfStretching'), _.Get('oneConstant'), _.Get('grib2divider'), _.Get('truncateDegrees'))) h.alias('geography.longitudeOfStretchingPoleInDegrees', 'longitudeOfStretchingPoleInDegrees') h.add(_.Unsigned('stretchingFactorScaled', 4)) h.add(_.Scale('stretchingFactor', _.Get('stretchingFactorScaled'), _.Get('oneConstant'), _.Get('grib2divider'))) h.alias('geography.stretchingFactor', 'stretchingFactor')
def load(h): h.add(_.Constant('GRIBEXSection1Problem', (107 - _.Get('section1Length')))) h.add(_.Transient('grib2LocalSectionNumber', 30)) _.Template('grib1/mars_labeling.def').load(h) h.add(_.Constant('wrongPadding', 1)) h.add(_.Unsigned('perturbationNumber', 1)) h.add(_.Unsigned('numberOfForecastsInEnsemble', 1)) h.alias('totalNumber', 'numberOfForecastsInEnsemble') h.alias('number', 'perturbationNumber') h.add(_.Unsigned('oceanAtmosphereCoupling', 1)) h.add(_.Pad('padding_loc27_1', 3)) h.add(_.Unsigned('legBaseDate', 4)) h.add(_.Unsigned('legBaseTime', 2)) h.add(_.Unsigned('legNumber', 1)) h.add(_.Unsigned('referenceDate', 4)) h.add(_.Unsigned('climateDateFrom', 4)) h.add(_.Unsigned('climateDateTo', 4)) h.alias('mars._leg_number', 'legNumber') h.add(_.Pad('padding_loc27_2', 33))
def load(h): h.add(_.Section_length('section1Length', 3)) h.add(_.Unsigned('gribTablesVersionNo', 1)) h.add(_.Codetable('centre', 1, "common/c-1.table")) h.alias('ls.centre', 'centre') h.add(_.Unsigned('generatingProcessIdentifier', 1)) h.add(_.Unsigned('gridDefinition', 1)) h.add(_.Codeflag('flag', 1, "grib1/1.table")) h.add( _.Codetable('indicatorOfParameter', 1, "grib1/2.[centre:l].[gribTablesVersionNo:l].table")) h.add(_.StringCodetable('indicatorOfTypeOfLevel', 1, "grib1/3.table")) h.alias('ls.levelType', 'indicatorOfTypeOfLevel') h.add(_.Codetable('heightPressureEtcOfLevels', 2, "grib1/3.table")) h.add(_.Unsigned('yearOfCentury', 1)) h.add(_.Unsigned('month', 1)) h.add(_.Unsigned('day', 1)) h.add(_.Unsigned('hour', 1)) h.add(_.Unsigned('minute', 1)) h.add(_.Codetable('indicatorOfUnitOfTimeRange', 1, "grib1/4.table")) h.add(_.Unsigned('periodOfTime', 1)) h.alias('P1', 'periodOfTime') h.add(_.Unsigned('periodOfTimeIntervals', 1))
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( _.Codetable('typeOfOriginalFieldValues', 1, "5.1.table", _.Get('masterDir'), _.Get('localDir')))
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))
def load(h): h.add(_.Unsigned('numberOfCategories', 1)) with h.list('categories'): for i in range(0, h.get_l('numberOfCategories')): h.add(_.Codetable('categoryType', 1, "4.91.table", _.Get('masterDir'), _.Get('localDir'))) h.add(_.Unsigned('codeFigure', 1)) h.add(_.Unsigned('scaleFactorOfLowerLimit', 1)) h.add(_.Unsigned('scaledValueOfLowerLimit', 4)) h.add(_.Unsigned('scaleFactorOfUpperLimit', 1)) h.add(_.Unsigned('scaledValueOfUpperLimit', 4))
def load(h): 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('tileClassification', 1, "4.242.table", _.Get('masterDir'), _.Get('localDir'))) h.add(_.Unsigned('totalNumberOfTileAttributePairs', 1)) h.add(_.Unsigned('numberOfUsedSpatialTiles', 1)) h.add(_.Unsigned('tileIndex', 1)) h.add(_.Unsigned('numberOfUsedTileAttributes', 1)) h.add( _.Codetable('attributeOfTile', 1, "4.241.table", _.Get('masterDir'), _.Get('localDir'))) h.alias('NT', 'totalNumberOfTileAttributePairs') h.alias('NUT', 'numberOfUsedSpatialTiles') h.alias('ITN', 'tileIndex') h.alias('NAT', 'numberOfUsedTileAttributes') h.add( _.Codetable('typeOfGeneratingProcess', 1, "4.3.table", _.Get('masterDir'), _.Get('localDir'))) h.add(_.Unsigned('backgroundProcess', 1)) h.alias('backgroundGeneratingProcessIdentifier', 'backgroundProcess') h.add(_.Unsigned('generatingProcessIdentifier', 1)) h.add(_.Unsigned('hoursAfterDataCutoff', 2)) h.alias('hoursAfterReferenceTimeOfDataCutoff', 'hoursAfterDataCutoff') h.add(_.Unsigned('minutesAfterDataCutoff', 1)) h.alias('minutesAfterReferenceTimeOfDataCutoff', 'minutesAfterDataCutoff') h.add( _.Codetable('indicatorOfUnitOfTimeRange', 1, "4.4.table", _.Get('masterDir'), _.Get('localDir'))) h.alias('defaultStepUnits', 'one') _.Template('grib2/localConcepts/[centre:s]/default_step_units.def', True).load(h) h.add(_.TransientCodetable('stepUnits', 1, "stepUnits.table")) h.add(_.Signed('forecastTime', 4))
def load(h): h.add(_.Position('offsetSection2')) h.add(_.Section_length('section2Length', 4)) h.add( _.Section_pointer('section2Pointer', _.Get('offsetSection2'), _.Get('section2Length'), 2)) h.add(_.Unsigned('numberOfSection', 1)) h.alias('tiggeSuiteID', 'zero') h.add(_.Transient('addEmptySection2', 0)) if (h.get_l('addEmptySection2') == 0): if ((h.get_l('grib2LocalSectionPresent') == 1) or ((h.get_l('section2Length') > 5) or h._new())): h.alias('section2Used', 'one') if ((h.get_l('productionStatusOfProcessedData') == 4) or (h.get_l('productionStatusOfProcessedData') == 5)): h.add( _.Codetable('tiggeLocalVersion', 2, "grib2/tiggeLocalVersion.table")) _.Template('grib2/local.tigge.[tiggeLocalVersion:l].def').load( h) if ((h.get_l('productionStatusOfProcessedData') == 10) or (h.get_l('productionStatusOfProcessedData') == 11)): h.add( _.Codetable('crraLocalVersion', 2, "grib2/crraLocalVersion.table")) _.Template('grib2/local.crra.[crraLocalVersion:l].def').load(h) h.add( _.Codetable( 'grib2LocalSectionNumber', 2, "grib2/grib2LocalSectionNumber.[centreForLocal:l].table")) if (h.get_l('grib2LocalSectionNumber') != 0): _.Template('grib2/local.[centreForLocal:l].def', True).load(h) else: h.add(_.Constant('deleteLocalDefinition', 1)) h.add(_.Position('offsetAfterCentreLocalSection')) h.add(_.Section_padding('section2Padding'))
def load(h): h.add(_.Constant('GRIBEXSection1Problem', (80 - _.Get('section1Length')))) h.add(_.Transient('localFlag', 1)) _.Template('grib1/mars_labeling.def').load(h) h.add(_.Unsigned('perturbationNumber', 2)) h.add(_.Unsigned('systemNumber', 2)) h.add(_.Unsigned('methodNumber', 2)) h.add(_.Unsigned('verifyingMonth', 4)) h.add(_.G1end_of_interval_monthly('endOfInterval', _.Get('verifyingMonth'))) h.add(_.Vector('yearOfEndOfOverallTimeInterval', _.Get('endOfInterval'), 0)) h.add( _.Vector('monthOfEndOfOverallTimeInterval', _.Get('endOfInterval'), 1)) h.add(_.Vector('dayOfEndOfOverallTimeInterval', _.Get('endOfInterval'), 2)) h.add(_.Vector('hourOfEndOfOverallTimeInterval', _.Get('endOfInterval'), 3)) h.add( _.Vector('minuteOfEndOfOverallTimeInterval', _.Get('endOfInterval'), 4)) h.add( _.Vector('secondOfEndOfOverallTimeInterval', _.Get('endOfInterval'), 5)) h.add(_.Transient('hourOfEndOfOverallTimeInterval', 23)) h.add(_.Transient('minuteOfEndOfOverallTimeInterval', 59)) h.add(_.Transient('secondOfEndOfOverallTimeInterval', 59)) h.add(_.Transient('indicatorOfUnitForTimeRange', 3)) h.add(_.Transient('lengthOfTimeRange', 1)) h.add(_.Unsigned('averagingPeriod', 1)) h.add(_.Transient('typeOfStatisticalProcessing', 0)) h.add(_.Transient('indicatorOfUnitForTimeIncrement', 1)) h.add(_.Transient('timeIncrement', _.Get('averagingPeriod'))) h.add(_.Unsigned('forecastMonth', 2)) h.add(_.Transient('forecastTime', (_.Get('forecastMonth') - 1))) h.add(_.Transient('typeOfTimeIncrement', 3)) h.add( _.G1forecastmonth('marsForecastMonth', _.Get('verifyingMonth'), _.Get('dataDate'), _.Get('day'), _.Get('hour'), _.Get('forecastMonth'), _.Get('one'))) h.alias('origin', 'centre') h.alias('number', 'perturbationNumber') h.alias('system', 'systemNumber') h.alias('method', 'methodNumber') h.add(_.Unsigned('numberOfForecastsInEnsemble', 2)) h.alias('totalNumber', 'numberOfForecastsInEnsemble') h.add(_.Pad('padding_loc16_1', 16))
def load(h): h.add(_.Constant('GRIBEXSection1Problem', 0)) _.Template('grib1/mars_labeling.def').load(h) h.add(_.Pad('padding_loc190_1', 2)) h.add(_.Unsigned('numberOfLocalDefinitions', 1)) if (h.get_l('numberOfLocalDefinitions') == 1): h.add(_.Unsigned('localDefNumberOne', 1)) h.add(_.Unsigned('numberOfBytesInLocalDefinition', 2)) _.Template('grib1/local.[centre:l].[localDefNumberOne:l].def').load(h) if (h.get_l('numberOfLocalDefinitions') == 2): h.add(_.Unsigned('localDefNumberOne', 1)) h.add(_.Unsigned('numberOfBytesInLocalDefinition', 2)) h.add(_.Unsigned('localDefNumberTwo', 1)) h.add(_.Unsigned('numberOfBytesInLocalDefinition', 2)) _.Template('grib1/local.[centre:l].[localDefNumberOne:l].def').load(h) h.add(_.Unsigned('spare2', 4)) _.Template('grib1/local.[centre:l].[localDefNumberTwo:l].def').load(h)