How to use the cdflib.epochs.CDFepoch._EPOCHbreakdownTT2000 function in cdflib

To help you get started, we’ve selected a few cdflib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MAVENSDC / cdflib / cdflib / epochs.py View on Github external
xdate1.append(0)
                    xdate1.append(nansec)
                    tmpNanosecs = CDFepoch.compute_tt2000(xdate1)
                    if tmpNanosecs != t3:
                        dat0 = CDFepoch._LeapSecondsfromYMD(xdate1[0],
                                                   xdate1[1],
                                                   xdate1[2])
                        tmpx = t2 - int(dat0 * CDFepoch.SECinNanoSecs)
                        tmpy = int((1.0 * tmpx) / CDFepoch.SECinNanoSecsD)
                        nansec = int(tmpx - tmpy * CDFepoch.SECinNanoSecs)
                        if nansec < 0:
                            nansec = CDFepoch.SECinNanoSecs + nansec
                            tmpy = tmpy - 1
                        epoch = tmpy + CDFepoch.J2000Since0AD12hSec
                        # One more determination
                        xdate1 = CDFepoch._EPOCHbreakdownTT2000(epoch)
                ye1 = int(xdate1[0])
                mo1 = int(xdate1[1])
                da1 = int(xdate1[2])
                ho1 = int(xdate1[3])
                mi1 = int(xdate1[4])
                se1 = int(xdate1[5])
            ml1 = int(nansec / 1000000)
            tmp1 = nansec - 1000000 * ml1
            if ml1 > 1000:
                ml1 = ml1 - 1000
                se1 = se1 + 1
            ma1 = int(tmp1 / 1000)
            na1 = int(tmp1 - 1000 * ma1)
            datetime = list()
            datetime.append(ye1)
            datetime.append(mo1)
github MAVENSDC / cdflib / cdflib / epochs.py View on Github external
date1 = CDFepoch._EPOCHbreakdownTT2000(epoch)
                    date1[5] = date1[5] + 1
                ye1 = date1[0]
                mo1 = date1[1]
                da1 = date1[2]
                ho1 = date1[3]
                mi1 = date1[4]
                se1 = date1[5]
                if encoding:
                    return epoch, nansec
            else:
                # pre-1972...
                epoch = secSinceJ2000 + CDFepoch.J2000Since0AD12hSec
                if encoding:
                    return epoch, nansec
                xdate1 = CDFepoch._EPOCHbreakdownTT2000(epoch)
                xdate1.append(0)
                xdate1.append(0)
                xdate1.append(nansec)
                tmpNanosecs = CDFepoch.compute_tt2000(xdate1)
                if tmpNanosecs != t3:
                    dat0 = CDFepoch._LeapSecondsfromYMD(xdate1[0],
                                               xdate1[1], xdate1[2])
                    tmpx = t2 - int(dat0 * CDFepoch.SECinNanoSecs)
                    tmpy = int(float(tmpx / CDFepoch.SECinNanoSecsD))
                    nansec = int(tmpx - tmpy * CDFepoch.SECinNanoSecs)
                if nansec < 0:
                    nansec = CDFepoch.SECinNanoSecs + nansec
                    tmpy -= 1
                    epoch = tmpy + CDFepoch.J2000Since0AD12hSec
                    xdate1 = CDFepoch._EPOCHbreakdownTT2000(epoch)
                    xdate1.append(0)
github MAVENSDC / cdflib / cdflib / epochs.py View on Github external
xdate1 = CDFepoch._EPOCHbreakdownTT2000(epoch)
                    xdate1.append(0)
                    xdate1.append(0)
                    xdate1.append(nansec)
                    tmpNanosecs = CDFepoch.compute_tt2000(xdate1)
                if tmpNanosecs != t3:
                    dat0 = CDFepoch._LeapSecondsfromYMD(xdate1[0],
                                               xdate1[1], xdate1[2])
                    tmpx = t2 - int(dat0 * CDFepoch.SECinNanoSecs)
                    tmpy = int((1.0 * tmpx) / CDFepoch.SECinNanoSecsD)
                    nansec = int(tmpx - tmpy * CDFepoch.SECinNanoSecs)
                    if nansec < 0:
                        nansec = CDFepoch.SECinNanoSecs + nansec
                        tmpy = tmpy - 1
                    epoch = tmpy + CDFepoch.J2000Since0AD12hSec
                    xdate1 = CDFepoch._EPOCHbreakdownTT2000(epoch)
                    xdate1.append(0)
                    xdate1.append(0)
                    xdate1.append(nansec)
                    tmpNanosecs = CDFepoch.compute_tt2000(xdate1)
                    if tmpNanosecs != t3:
                        dat0 = CDFepoch._LeapSecondsfromYMD(xdate1[0],
                                                   xdate1[1],
                                                   xdate1[2])
                        tmpx = t2 - int(dat0 * CDFepoch.SECinNanoSecs)
                        tmpy = int((1.0 * tmpx) / CDFepoch.SECinNanoSecsD)
                        nansec = int(tmpx - tmpy * CDFepoch.SECinNanoSecs)
                        if nansec < 0:
                            nansec = CDFepoch.SECinNanoSecs + nansec
                            tmpy = tmpy - 1
                        epoch = tmpy + CDFepoch.J2000Since0AD12hSec
                        # One more determination
github MAVENSDC / cdflib / cdflib / epochs.py View on Github external
nanoSecSinceJ2000 = nanoSecSinceJ2000 - CDFepoch.dTinNanoSecs
                secSinceJ2000 = int(nanoSecSinceJ2000 / CDFepoch.SECinNanoSecsD)
                nansec = int(nanoSecSinceJ2000 - secSinceJ2000 * CDFepoch.SECinNanoSecs)
            if nansec < 0:
                nansec = CDFepoch.SECinNanoSecs + nansec
                secSinceJ2000 = secSinceJ2000 - 1
            t2 = secSinceJ2000 * CDFepoch.SECinNanoSecs + nansec
            if datx[0] > 0.0:
                # post-1972...
                secSinceJ2000 = secSinceJ2000 - int(datx[0])
                epoch = CDFepoch.J2000Since0AD12hSec + secSinceJ2000
                if datx[1] == 0.0:
                    date1 = CDFepoch._EPOCHbreakdownTT2000(epoch)
                else:
                    epoch = epoch - 1
                    date1 = CDFepoch._EPOCHbreakdownTT2000(epoch)
                    date1[5] = date1[5] + 1
                ye1 = date1[0]
                mo1 = date1[1]
                da1 = date1[2]
                ho1 = date1[3]
                mi1 = date1[4]
                se1 = date1[5]
                if encoding:
                    return epoch, nansec
            else:
                # pre-1972...
                epoch = secSinceJ2000 + CDFepoch.J2000Since0AD12hSec
                if encoding:
                    return epoch, nansec
                xdate1 = CDFepoch._EPOCHbreakdownTT2000(epoch)
                xdate1.append(0)
github MAVENSDC / cdflib / cdflib / epochs.py View on Github external
nansec = nansec - 184000000
            else:
                nanoSecSinceJ2000 = nanoSecSinceJ2000 + CDFepoch.T12hinNanoSecs
                nanoSecSinceJ2000 = nanoSecSinceJ2000 - CDFepoch.dTinNanoSecs
                secSinceJ2000 = int(nanoSecSinceJ2000 / CDFepoch.SECinNanoSecsD)
                nansec = int(nanoSecSinceJ2000 - secSinceJ2000 * CDFepoch.SECinNanoSecs)
            if nansec < 0:
                nansec = CDFepoch.SECinNanoSecs + nansec
                secSinceJ2000 = secSinceJ2000 - 1
            t2 = secSinceJ2000 * CDFepoch.SECinNanoSecs + nansec
            if datx[0] > 0.0:
                # post-1972...
                secSinceJ2000 = secSinceJ2000 - int(datx[0])
                epoch = CDFepoch.J2000Since0AD12hSec + secSinceJ2000
                if datx[1] == 0.0:
                    date1 = CDFepoch._EPOCHbreakdownTT2000(epoch)
                else:
                    epoch = epoch - 1
                    date1 = CDFepoch._EPOCHbreakdownTT2000(epoch)
                    date1[5] = date1[5] + 1
                ye1 = date1[0]
                mo1 = date1[1]
                da1 = date1[2]
                ho1 = date1[3]
                mi1 = date1[4]
                se1 = date1[5]
                if encoding:
                    return epoch, nansec
            else:
                # pre-1972...
                epoch = secSinceJ2000 + CDFepoch.J2000Since0AD12hSec
                if encoding: