Changeset 25310


Ignore:
Timestamp:
07/29/20 03:26:25 (5 years ago)
Author:
bdef
Message:

BUG: Write data fix (perhaps)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/solve/WriteData.py

    r25307 r25310  
    4242    #       end
    4343
    44     # Make a copy of the the data so that we do not accidently overwrite any 
     44    # Make a copy of the the data so that we do not accidently overwrite any
    4545    # model fields.
    4646    #
    47     # NOTE: This is a temporary fix to get builds green in Jenkins: without it, 
    48     #       there still exists a bug wherein model fields are being modified 
     47    # NOTE: This is a temporary fix to get builds green in Jenkins: without it,
     48    #       there still exists a bug wherein model fields are being modified
    4949    #       (see https://ross.ics.uci.edu/jenkins/view/All/job/Debian_Linux-Python/1036).
    5050    #
     
    5353    #Scale data if necessary
    5454    if datatype == 'MatArray':
     55        #if it is a matrix array we loop over the matrixes
    5556        for i in range(np.size(data)):
    5657            if options.exist('scale'):
    5758                scale = options.getfieldvalue('scale')
    5859                if np.ndim(data[i]) > 1 and data[i].shape[0] == timeserieslength:
    59                     data[i][:-2, :] = scale * data[i][:-2, :]
     60                    #We scale everything but the last line that holds time
     61                    data[i][:-1, :] = scale * data[i][:-1, :]
    6062                else:
    6163                    data[i] = scale * data[i]
    62             if np.ndim(data) > 1 and data[i].shape[0] == timeserieslength:
     64            if np.ndim(data[i]) > 1 and data[i].shape[0] == timeserieslength:
     65                #no scaling given, use yts instead
    6366                yts = options.getfieldvalue('yts')
     67                #We scale everything but the last line that holds time
    6468                data[i][-1, :] = yts * data[i][-1, :]
    6569    else:
     
    6771            scale = options.getfieldvalue('scale')
    6872            if np.ndim(data) > 1 and data.shape[0] == timeserieslength:
    69                 data[:-2, :] = scale * data[:-2, :]
     73                #We scale everything but the last line that holds time
     74                data[:-1, :] = scale * data[:-1, :]
    7075            else:
    7176                data = scale * data
Note: See TracChangeset for help on using the changeset viewer.