def iso_watch():
    #  Open Master coord sheets

    doc = ezodf.opendoc(_COORD_MASTER_SPREADSHEET_TEST_URI)
    print('***DEBUG***', doc, _COORD_MASTER_SPREADSHEET_TEST_URI)
    sheet = doc.sheets['isocenter_delta']

    # Now fetch the isocenters and display them in the table.
    no_rows = sheet.nrows()

    iso_list = []
    iso__value = []
    ddx = []

    for index in range(0, no_rows):
        row = sheet.row(index)
        ddx.append(ss())
        # get isocenter and present value from mss (master spreadsheet)

        iso = is_none(row[0].value)
        iso_delta = is_none(row[1].value)

        ddx[index].iso = iso
        ddx[index].delta = iso_delta
        ddx[index].loc = index

        if row[0].value != None:
            iso_list.append(iso)
            iso_value.append(iso_delta)

            url = _PI_DATA_ACQIF_ARDUINO
            r = requests.get(url, headers=_ISOSLAVE_headers)

            if r.status_code != 200:
                print("Bad request: status:",r.status_code, r.url)
                ddx[index].new_value = iso_value
                continue

            rj = r.json()
            if rj:

                try:
                  ddx[index].new_value = rj[0]['Last']
                  sheet[index,1].set_value(ddx[index].new_value, 'float')
                except KeyError:
                    print(r.status_code, iso.upper(), "Couldn't get the iso record")
                    ddx[index].new_value = iso_value   # keep old value -- don't update a bad iso delta
                    continue
                except IndexError:
                    print(r.status_code, r.url,  "Badness here: Index Error")
                continue
            else:
                print("RJ has NO stuff.", r.url, index, "Keeping Backup Data" )
                ddx[index].new_value = iso_delta   #keep old data


    # At this point we have a list of present isocenter shifts and their values.  We have displayed the old ones on the form.

    #  We are now going to open a brand new shiny spreadsheet and right the values on the fresh sheet.
    #  If this works, we will try a real run against a copy of the production sheet.

    ods = newdoc(doctype ='ods', filename='/Users/brtc/sw/fl_mf/pvt/test.ods')
    ods.sheets += Sheet('Sheet1')
    mysheet = ods.sheets[0]

    mysheet.append_rows(150)

    print ('Index ', ods.docname, len(ddx), mysheet.name, doc.sheets[0].name)

    # label it
    mysheet[2,0].set_value('Isocenter')
    mysheet[2,1].set_value('Present Delta')
    mysheet[2,2].set_value('Old Delta')
    mysheet[2,3].set_value('Shift Vector')

    for index in range (3, no_rows):
        if ddx[index].ticker != 0:
            tt = ddx[index].iso
            pp = Decimal(ddx[index].value)
            nv = Decimal(ddx[index].new_value)
            mysheet[index, 0].set_value(tt)
            mysheet[index, 2].set_value(pp)
            mysheet[index, 1].set_value(nv)
            print('***Debug*** tt pp nv',tt, pp, ddx[index].value, nv, ddx[index].new_value )
            print('posting ', mysheet[index, 0].value, mysheet[index, 1].value, mysheet[index, 2].value)

        else:
            print('***DEBUG*** ISO is zero, set tt to blank ' )
            tt = ' '
            pp = ''
            nv = ''

        print('posting ', mysheet[index,0].value, mysheet[index,1].value, mysheet[index,2].value)
    ods.save()
    doc.save()



    return render_template('value_query.html',  values=sheet, tiingo = ddx, updatetime=time.asctime(time.localtime(time.time())))


print ('Completed @', time.asctime(time.localtime(time.time())))