<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def save_array(self, array, name=None, partname=None, rootpath='.', raw=False, as_int=True):
 """ Standard array saving routine Parameters array : array Array to save to file name : str, optional Default 'array.tif'. Filename of array to save. Over-writes partname. partname : str, optional Part of the filename to save (with the coordinates appended) rootpath : str, optional Default '.'. Which directory to save file raw : bool, optional Default False. If true will save a .npz of the array. If false, will save a geotiff as_int : bool, optional Default True. If true will save array as an integer array ( excellent compression). If false will save as float array. """

        if name is None and partname is not None:
            fnl_file = self.get_full_fn(partname, rootpath)
            tmp_file = os.path.join(rootpath, partname,
                                    self.get_fn(partname + '_tmp'))
        elif name is not None:
            fnl_file = name
            tmp_file = fnl_file + '_tmp.tiff'
        else:
            fnl_file = 'array.tif'
        if not raw:
            s_file = self.elev.clone_traits()
            s_file.raster_data = np.ma.masked_array(array)
            count = 10
            while count > 0 and (s_file.raster_data.mask.sum() > 0 \
                    or np.isnan(s_file.raster_data).sum() > 0):
                s_file.inpaint()
                count -= 1

            s_file.export_to_geotiff(tmp_file)

            if as_int:
                cmd = "gdalwarp -multi -wm 2000 -co BIGTIFF=YES -of GTiff -co compress=lzw -ot Int16 -co TILED=YES -wo OPTIMIZE_SIZE=YES -r near -t_srs %s %s %s" \
                    % (self.save_projection, tmp_file, fnl_file)
            else:
                cmd = "gdalwarp -multi -wm 2000 -co BIGTIFF=YES -of GTiff -co compress=lzw -co TILED=YES -wo OPTIMIZE_SIZE=YES -r near -t_srs %s %s %s" \
                    % (self.save_projection, tmp_file, fnl_file)
            print "<<"*4, cmd, ">>"*4
            subprocess.call(cmd)
            os.remove(tmp_file)
        else:
            np.savez_compressed(fnl_file, array)