コード例 #1
0
## Author: Charles Doutriaux
## The units created bellow
## have absolutely no meaning
## They are just used to test that the features exposed
## work properly

unidata.udunits_wrap.init()

## Create a new baseunits called eq
unidata.addBaseUnit("eq")

## Create a dimensionless units named dimless
unidata.addDimensionlessUnit("dimless")

## Created a scaled units for dimless
unidata.addScaledUnit("pourcent",.01,"dimless")

## Create an offsetted units for dimless
unidata.addOffsettedUnit("fakeCelsius",273.15,"dimless")

## Create mutliplied units
unidata.addMultipliedUnits("efC","eq","fakeCelsius")
unidata.addMultipliedUnits("efP","eq","pourcent")

## Create divded units
unidata.addDividedUnits("defC","eq","fakeCelsius")
unidata.addDividedUnits("defP","eq","pourcent")

## Create inverted unit
unidata.addInvertedUnit("iefC","defC")
コード例 #2
0
import collections
import cdat_info
import unidata

# Statistical tracker
cdat_info.pingPCMDIdb("pcmdi_metrics", "pcmdi_metrics_driver")

# Before we do anything else we need to create some units
# Salinity Units
unidata.udunits_wrap.init()

# Create a dimensionless units named dimless
unidata.addDimensionlessUnit("dimless")

# Created scaled units for dimless
unidata.addScaledUnit("psu", .001, "dimless")
unidata.addScaledUnit("PSS-78", .001, "dimless")
unidata.addScaledUnit("Practical Salinity Scale 78", .001, "dimless")

# Following are actually created in excfile bit, this is to make flae8 happy
regions_specs = {}
default_regions = []
execfile(sys.prefix + "/share/pmp/default_regions.py")

# Load the obs dictionary
fjson = open(
    os.path.join(
        sys.prefix,
        "share",
        "pmp",
        "obs_info_dictionary.json"))
コード例 #3
0
import collections
import cdat_info
import unidata

# Statistical tracker
cdat_info.pingPCMDIdb("pcmdi_metrics", "pcmdi_metrics_driver")

# Before we do anything else we need to create some units
# Salinity Units
unidata.udunits_wrap.init()

# Create a dimensionless units named dimless
unidata.addDimensionlessUnit("dimless")

# Created scaled units for dimless
unidata.addScaledUnit("psu", .001, "dimless")
unidata.addScaledUnit("PSS-78", .001, "dimless")
unidata.addScaledUnit("Practical Salinity Scale 78", .001, "dimless")

# Following are actually created in excfile bit, this is to make flae8 happy
regions_specs = {}
default_regions = []
execfile(sys.prefix + "/share/pmp/default_regions.py")

# Load the obs dictionary
fjson = open(
    os.path.join(sys.prefix, "share", "pmp", "obs_info_dictionary.json"))
obs_dic = json.loads(fjson.read())
fjson.close()