diff --git a/examples/python/binary_message.py b/examples/python/binary_message.py index 9c85d1094..d020c842a 100644 --- a/examples/python/binary_message.py +++ b/examples/python/binary_message.py @@ -4,8 +4,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # import traceback diff --git a/examples/python/bufr_attributes.py b/examples/python/bufr_attributes.py index 967a77ea1..630947a99 100644 --- a/examples/python/bufr_attributes.py +++ b/examples/python/bufr_attributes.py @@ -3,8 +3,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # # Python implementation: bufr_attributes @@ -51,10 +52,10 @@ def example(): # i.e. unpack the data values codes_set(gid, 'unpack', 1) - #--------------------------------------------------------------- + # -------------------------------------------------------------- # We will read the value and all the attributes available for # the 2m temperature. - #--------------------------------------------------------------- + # -------------------------------------------------------------- # get the value key = 'airTemperatureAt2M' try: @@ -72,11 +73,11 @@ def example(): except CodesInternalError, err: print 'Error with key="%s" : %s' % (key, err.msg) - #-------------------------------------------------------------------- + # ------------------------------------------------------------------ # The 2m temperature data element in this message has an associated # field: percentConfidence. Its value and attributes can be accessed # in a similar manner as was shown above for 2m temperature. - #------------------------------------------------------------------- + # ------------------------------------------------------------------ # get the value key = 'airTemperatureAt2M->percentConfidence' diff --git a/examples/python/bufr_clone.py b/examples/python/bufr_clone.py index f4e61e91c..fdc476107 100644 --- a/examples/python/bufr_clone.py +++ b/examples/python/bufr_clone.py @@ -3,8 +3,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # # @@ -63,7 +64,7 @@ def example(): def main(): try: example() - except CodesInternalError, err: + except CodesInternalError as err: if VERBOSE: traceback.print_exc(file=sys.stderr) else: diff --git a/examples/python/bufr_encode_flight.py b/examples/python/bufr_encode_flight.py index b5871e63f..51706675c 100644 --- a/examples/python/bufr_encode_flight.py +++ b/examples/python/bufr_encode_flight.py @@ -18,7 +18,7 @@ from eccodes import * def example(csvfile, input_filename, output_filename): - fbufrin = open(input_filename, 'rb') + fbufrin = open(input_filename, 'rb') fbufrout = open(output_filename, 'wb') print 'Using ecCodes version: ', codes_get_api_version() diff --git a/examples/python/bufr_expanded.py b/examples/python/bufr_expanded.py index fdc8ca6cd..0abdf5992 100644 --- a/examples/python/bufr_expanded.py +++ b/examples/python/bufr_expanded.py @@ -3,8 +3,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # # Python implementation: bufr_get_keys @@ -42,9 +43,9 @@ def example(): # i.e. unpack the data values codes_set(gid, 'unpack', 1) - #----------------------------------- + # ---------------------------------- # get all the expanded data values - #----------------------------------- + # ---------------------------------- key = 'numericValues' # get size diff --git a/examples/python/bufr_get_keys.py b/examples/python/bufr_get_keys.py index 7c2b8f325..4410e313a 100644 --- a/examples/python/bufr_get_keys.py +++ b/examples/python/bufr_get_keys.py @@ -3,8 +3,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # # Python implementation: bufr_get_keys @@ -42,9 +43,9 @@ def example(): # i.e. unpack the data values codes_set(gid, 'unpack', 1) - #---------------------------------------------- + # --------------------------------------------- # get values for keys holding a single value - #---------------------------------------------- + # --------------------------------------------- # Native type integer key = 'blockNumber' @@ -74,9 +75,9 @@ def example(): except CodesInternalError, err: print 'Error with key="%s" : %s' % (key, err.msg) - #--------------------------------- + # -------------------------------- # get values for an array - #--------------------------------- + # -------------------------------- # Native type integer key = 'bufrdcExpandedDescriptors' diff --git a/examples/python/bufr_keys_iterator.py b/examples/python/bufr_keys_iterator.py index 5c8b52e10..d0d87168b 100644 --- a/examples/python/bufr_keys_iterator.py +++ b/examples/python/bufr_keys_iterator.py @@ -3,8 +3,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # # Python implementation: bufr_keys_iterator @@ -59,8 +60,6 @@ def example(): # print key name keyname = codes_keys_iterator_get_name(iterid) - #keyval = codes_get_string(iterid,keyname) - # print "%s = %s" % (keyname,keyval) print " %s" % keyname # delete the key iterator diff --git a/examples/python/bufr_read_header.py b/examples/python/bufr_read_header.py index 6fa7f3b4f..9b606cd20 100644 --- a/examples/python/bufr_read_header.py +++ b/examples/python/bufr_read_header.py @@ -3,8 +3,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # diff --git a/examples/python/bufr_read_scatterometer.py b/examples/python/bufr_read_scatterometer.py index 7eb26d77e..51c9e369f 100644 --- a/examples/python/bufr_read_scatterometer.py +++ b/examples/python/bufr_read_scatterometer.py @@ -3,17 +3,20 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # # Python implementation: bufr_read_scatterometer # -# Description: how to read data for a given beam from scatterometer BUFR messages. +# Description: how to read data for a given beam from scatterometer BUFR +# messages. # -# Please note that scatterometer data can be encoded in various ways in BUFR. Therefore the code -# below might not work directly for other types of messages than the one used in the -# example. It is advised to use bufr_dump first to understand the structure of these messages. +# Please note that scatterometer data can be encoded in various ways in BUFR. +# Therefore the code below might not work directly for other types of messages +# than the one used in the example. It is advised to use bufr_dump first to +# understand the structure of these messages. # @@ -46,12 +49,13 @@ def example(): # i.e. unpack the data values codes_set(gid, 'unpack', 1) - # The BUFR file contains a single message with 2016 subsets in a compressed form. - # It means each subset has exactly the same structure: they store one location with - # several beams and one backscatter value in each beam. + # The BUFR file contains a single message with 2016 subsets in a + # compressed form. It means each subset has exactly the same structure: + # they store one location with several beams and one backscatter value + # in each beam. # - # To print the backScatter values for beamIdentifier=2 from all the subsets - # we will simply access the key by condition (see below) + # To print the backScatter values for beamIdentifier=2 from all the + # subsets we will simply access the key by condition (see below) # Get the total number of subsets. numObs = codes_get(gid, "numberOfSubsets") @@ -64,8 +68,8 @@ def example(): # Get longitude (for all the subsets) lon = codes_get_array(gid, "longitude") - # Get backScatter for beam two. We use an access by condition for this key. - #(for all the subsets) + # Get backScatter for beam two. We use an access by condition for this + # key (for all the subsets). bscat = codes_get_array(gid, "/beamIdentifier=2/backscatter") # Check that all arrays are same size diff --git a/examples/python/bufr_read_synop.py b/examples/python/bufr_read_synop.py index 6f5620cb4..7d9b5d17e 100644 --- a/examples/python/bufr_read_synop.py +++ b/examples/python/bufr_read_synop.py @@ -3,8 +3,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # # Python implementation: bufr_read_synop @@ -12,11 +13,10 @@ # Description: how to read data values from BUFR messages. # -# -# Please note that SYNOP reports can be encoded in various ways in BUFR. Therefore the code -# below might not work directly for other types of SYNOP messages than the one used in the -# example. It is advised to use bufr_dump to understand the structure of the messages. -# +# Please note that SYNOP reports can be encoded in various ways in BUFR. +# Therefore the code below might not work directly for other types of SYNOP +# messages than the one used in the example. It is advised to use bufr_dump to +# understand the structure of the messages. import traceback import sys @@ -55,7 +55,8 @@ def example(): # cloud block introduced by the key # verticalSignificanceSurfaceObservations=1. # We know that this is the first occurrence of the keys we want to - # read so in the list above we used the # (occurrence) operator accordingly. + # read so in the list above we used the # (occurrence) operator + # accordingly. cnt = 0 diff --git a/examples/python/bufr_read_temp.py b/examples/python/bufr_read_temp.py index 4cb769911..cc45e1360 100644 --- a/examples/python/bufr_read_temp.py +++ b/examples/python/bufr_read_temp.py @@ -3,18 +3,21 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # # Python implementation: bufr_read_temp # -# Description: how to read temperature significant levels from TEMP BUFR messages. +# Description: how to read temperature significant levels from TEMP BUFR +# messages. # # -# Please note that TEMP reports can be encoded in various ways in BUFR. Therefore the code -# below might not work directly for other types of TEMP messages than the one used in the -# example. It is advised to use bufr_dump to understand the structure of the messages. +# Please note that TEMP reports can be encoded in various ways in BUFR. +# Therefore the code below might not work directly for other types of TEMP +# messages than the one used in the example. It is advised to use bufr_dump to +# understand the structure of the messages. # import traceback @@ -60,23 +63,29 @@ def example(): # We find out the number of temperature significant levels by # counting how many pressure values we have on these levels. - numSigT = codes_get_size(gid, "/verticalSoundingSignificance=4/pressure") + numSigT = codes_get_size( + gid, "/verticalSoundingSignificance=4/pressure") print ' Number of temperature significant levels %ld' % (numSigT) # Get pressure - sigt_pres = codes_get_array(gid, "/verticalSoundingSignificance=4/pressure") + sigt_pres = codes_get_array( + gid, "/verticalSoundingSignificance=4/pressure") # Get gepotential - sigt_geo = codes_get_array(gid, "/verticalSoundingSignificance=4/geopotential") + sigt_geo = codes_get_array( + gid, "/verticalSoundingSignificance=4/geopotential") # Get temperature - sigt_t = codes_get_array(gid, "/verticalSoundingSignificance=4/airTemperature") + sigt_t = codes_get_array( + gid, "/verticalSoundingSignificance=4/airTemperature") # Get dew point - sigt_td = codes_get_array(gid, "/verticalSoundingSignificance=4/dewpointTemperature") + sigt_td = codes_get_array( + gid, "/verticalSoundingSignificance=4/dewpointTemperature") # Check that all arrays are same size - if len(sigt_pres) != numSigT or len(sigt_geo) != numSigT or len(sigt_t) != numSigT or len(sigt_td) != numSigT: + if len(sigt_pres) != numSigT or len(sigt_geo) != numSigT or \ + len(sigt_t) != numSigT or len(sigt_td) != numSigT: print 'inconsistent array dimension' return 1 @@ -85,7 +94,9 @@ def example(): print "-------------------------------" for i in xrange(numSigT): - print "%3d %6.0f %6.0f %.1f %.1f" % (i + 1, sigt_pres[i], sigt_geo[i], sigt_t[i], sigt_td[i]) + print "%3d %6.0f %6.0f %.1f %.1f" % (i + 1, sigt_pres[i], + sigt_geo[i], sigt_t[i], + sigt_td[i]) cnt += 1 diff --git a/examples/python/bufr_read_tropical_cyclone.py b/examples/python/bufr_read_tropical_cyclone.py index f27ba3c4d..f2dd1fcb3 100644 --- a/examples/python/bufr_read_tropical_cyclone.py +++ b/examples/python/bufr_read_tropical_cyclone.py @@ -3,8 +3,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # diff --git a/examples/python/bufr_set_keys.py b/examples/python/bufr_set_keys.py index 92401b346..003984cf5 100644 --- a/examples/python/bufr_set_keys.py +++ b/examples/python/bufr_set_keys.py @@ -3,8 +3,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # # Python implementation: bufr_set_keys diff --git a/examples/python/bufr_subset.py b/examples/python/bufr_subset.py index eb189d5d0..065240e8d 100644 --- a/examples/python/bufr_subset.py +++ b/examples/python/bufr_subset.py @@ -3,8 +3,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # # Python implementation: bufr_subset diff --git a/examples/python/count_messages.py b/examples/python/count_messages.py index 0b15111eb..6ee389404 100644 --- a/examples/python/count_messages.py +++ b/examples/python/count_messages.py @@ -4,8 +4,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # import traceback diff --git a/examples/python/get_product_kind.py b/examples/python/get_product_kind.py index a5055661b..6209adf96 100644 --- a/examples/python/get_product_kind.py +++ b/examples/python/get_product_kind.py @@ -4,8 +4,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # # Python implementation: get_product_kind diff --git a/examples/python/grib_clone.py b/examples/python/grib_clone.py index 61016ddc2..6b10f84df 100644 --- a/examples/python/grib_clone.py +++ b/examples/python/grib_clone.py @@ -4,8 +4,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # import traceback diff --git a/examples/python/grib_get_keys.py b/examples/python/grib_get_keys.py index 96733eea1..cec66239e 100644 --- a/examples/python/grib_get_keys.py +++ b/examples/python/grib_get_keys.py @@ -3,8 +3,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. import traceback import sys diff --git a/examples/python/grib_index.py b/examples/python/grib_index.py index 9b80a6457..24accf52e 100644 --- a/examples/python/grib_index.py +++ b/examples/python/grib_index.py @@ -4,11 +4,13 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # -# Description: How to create and use an index to access GRIB messages from a file +# Description: How to create and use an index to access GRIB messages from +# a file import traceback import sys @@ -68,7 +70,8 @@ def example(): gid = codes_new_from_index(iid) if gid is None: break - print " ".join(["%s=%s" % (key, codes_get(gid, key)) for key in index_keys]) + print " ".join(["%s=%s" % (key, codes_get(gid, key)) + for key in index_keys]) codes_release(gid) codes_index_release(iid) diff --git a/examples/python/grib_iterator.py b/examples/python/grib_iterator.py index 9fc1e31d8..8f179054b 100644 --- a/examples/python/grib_iterator.py +++ b/examples/python/grib_iterator.py @@ -4,8 +4,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # import traceback diff --git a/examples/python/grib_keys_iterator.py b/examples/python/grib_keys_iterator.py index e3a494694..d798be119 100644 --- a/examples/python/grib_keys_iterator.py +++ b/examples/python/grib_keys_iterator.py @@ -4,8 +4,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # import traceback diff --git a/examples/python/grib_multi_write.py b/examples/python/grib_multi_write.py index b22dd1356..65439cc59 100644 --- a/examples/python/grib_multi_write.py +++ b/examples/python/grib_multi_write.py @@ -4,8 +4,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # import traceback diff --git a/examples/python/grib_nearest.py b/examples/python/grib_nearest.py index f87afc1c8..14c16901b 100644 --- a/examples/python/grib_nearest.py +++ b/examples/python/grib_nearest.py @@ -4,8 +4,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # import traceback @@ -26,7 +27,8 @@ def example(): for lat, lon in points: nearest = codes_grib_find_nearest(gid, lat, lon)[0] print lat, lon - print nearest.lat, nearest.lon, nearest.value, nearest.distance, nearest.index + print nearest.lat, nearest.lon, nearest.value, nearest.distance, \ + nearest.index four = codes_grib_find_nearest(gid, lat, lon, is_lsm=False, npoints=4) for i in range(len(four)): diff --git a/examples/python/grib_print_data.py b/examples/python/grib_print_data.py index 98b62868a..44302bc35 100644 --- a/examples/python/grib_print_data.py +++ b/examples/python/grib_print_data.py @@ -4,8 +4,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # import traceback diff --git a/examples/python/grib_set_bitmap.py b/examples/python/grib_set_bitmap.py index dfff5e86e..72dee5bb7 100644 --- a/examples/python/grib_set_bitmap.py +++ b/examples/python/grib_set_bitmap.py @@ -3,8 +3,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. import traceback import sys @@ -34,7 +35,8 @@ def example(): # Check counts of missing and non-missing values num_data = codes_get(gid, 'numberOfDataPoints', int) - assert(codes_get(gid, 'numberOfCodedValues', int) == num_data - num_missing) + assert(codes_get(gid, 'numberOfCodedValues', int) + == num_data - num_missing) assert(codes_get(gid, 'numberOfMissing', int) == num_missing) codes_write(gid, fout) diff --git a/examples/python/grib_set_keys.py b/examples/python/grib_set_keys.py index 8ec90ae5d..0e05c8684 100644 --- a/examples/python/grib_set_keys.py +++ b/examples/python/grib_set_keys.py @@ -3,8 +3,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. import traceback import sys diff --git a/examples/python/grib_set_pv.py b/examples/python/grib_set_pv.py index 8b433f279..9fbe0ca14 100644 --- a/examples/python/grib_set_pv.py +++ b/examples/python/grib_set_pv.py @@ -4,8 +4,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # import traceback diff --git a/examples/python/gts_get_keys.py b/examples/python/gts_get_keys.py index 9b87563ba..05631d7b3 100644 --- a/examples/python/gts_get_keys.py +++ b/examples/python/gts_get_keys.py @@ -3,8 +3,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # # Python implementation: bufr_get_keys @@ -38,9 +39,9 @@ def example(): print "message: %s" % cnt - #---------------------------------------------- + # --------------------------------------------- # get values for keys holding a single value - #---------------------------------------------- + # --------------------------------------------- keys = ['TT', 'AA', 'II', 'CCCC', 'YY', 'GG', 'gg', 'BBB'] for key in keys: diff --git a/examples/python/keys_iterator_bufr.py b/examples/python/keys_iterator_bufr.py index 29f72ab7d..260020d05 100644 --- a/examples/python/keys_iterator_bufr.py +++ b/examples/python/keys_iterator_bufr.py @@ -4,8 +4,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # import traceback diff --git a/examples/python/keys_iterator_gts.py b/examples/python/keys_iterator_gts.py index ef6a29508..901c892c7 100644 --- a/examples/python/keys_iterator_gts.py +++ b/examples/python/keys_iterator_gts.py @@ -4,8 +4,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # import traceback diff --git a/examples/python/metar_get_keys.py b/examples/python/metar_get_keys.py index 8fce48d83..2cacf20cb 100644 --- a/examples/python/metar_get_keys.py +++ b/examples/python/metar_get_keys.py @@ -3,13 +3,14 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # # Python implementation: metar_get_keys # -# Description: how to read values of different type of keys from METAR messages. +# Description: how to read values of different type of keys from METAR messages # # @@ -38,9 +39,9 @@ def example(): print "message: %s" % cnt - #---------------------------------------------- + # --------------------------------------------- # get values for keys holding a single value - #---------------------------------------------- + # --------------------------------------------- keys = ['CCCC', 'latitude', 'longitude', 'dateTime', 'elevation', 'temperature', 'dewPointTemperature', 'qnh'] diff --git a/examples/python/samples.py b/examples/python/samples.py index d87d70c27..8d43d8fe7 100644 --- a/examples/python/samples.py +++ b/examples/python/samples.py @@ -4,8 +4,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # import traceback diff --git a/examples/python/set_missing.py b/examples/python/set_missing.py index edb8cc239..4c00c15f8 100644 --- a/examples/python/set_missing.py +++ b/examples/python/set_missing.py @@ -4,8 +4,9 @@ # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # -# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by -# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. # import traceback