Changeset d2febd4 in flex_extract.git


Ignore:
Timestamp:
Dec 7, 2018, 3:28:01 PM (6 months ago)
Author:
Anne Philipp <anne.philipp@…>
Branches:
dev
Children:
c274d9a
Parents:
095dc73
Message:

fixed grid area check for negative values

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/python/mods/checks.py

    r3f36e42 rd2febd4  
    6969
    7070    # determine area format
    71     if (float(upper) / 1000. >= 0.05 and
    72         float(lower) / 1000. >= 0.05 and
    73         float(left) / 1000. >= 0.05 and
    74         float(right) / 1000. >= 0.05):
     71    if (abs(float(upper) / 1000.) >= 0.05 and
     72        abs(float(lower) / 1000.) >= 0.05 and
     73        abs(float(left) / 1000.) >= 0.05 and
     74        abs(float(right) / 1000.) >= 0.05):
    7575        # area is defined in 1/1000 degrees; old format
    7676        area = '{}/{}/{}/{}'.format(float(upper) / 1000.,
     
    7878                                    float(lower) / 1000.,
    7979                                    float(right) / 1000.)
    80     elif (float(upper) / 1000. < 0.05 and
    81           float(lower) / 1000. < 0.05 and
    82           float(left) / 1000. < 0.05 and
    83           float(right) / 1000. < 0.05):
     80    elif (abs(float(upper) / 1000.) < 0.05 and
     81          abs(float(lower) / 1000.) < 0.05 and
     82          abs(float(left) / 1000.) < 0.05 and
     83          abs(float(right) / 1000.) < 0.05):
    8484        # area is already in new format
    8585        area = '{}/{}/{}/{}'.format(float(upper),
     
    8989    else:
    9090        raise ValueError('The area components have different '
    91                          'formats: %s ' (area))
     91                         'formats (upper, lower, left, right): '
     92                         '{}/{}/{}/{}'.format(str(upper), str(lower),
     93                                              str(left) , str(right)))
    9294
    9395    return area
     
    153155    return
    154156
    155 
    156157def check_():
    157158    '''
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG