How to use the cdflib.epochs.CDFepoch.encode 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 / cdfread.py View on Github external
entryWithType.append(entryData.tolist()[0])
                            else:
                                if (dataType != 33):
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist()[0],
                                                                               iso_8601=False))
                                else:
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist()[0]))
                        else:
                            if (dataType != 31 and dataType != 32 and dataType != 33):
                                entryWithType.append(entryData.tolist())
                            else:
                                if (dataType != 33):
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist(),
                                                                               iso_8601=False))
                                else:
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist()))
                    entryWithType.append(CDF._datatype_token(aedr_info['data_type']))
                    entries[aedr_info['entry_num']] = entryWithType
                aedr_byte_loc = aedr_info['next_aedr']

            if (len(entries) != 0):
                if (expand is False):
                    if (len(entries) == 1):
                        return_dict[adr_info['name']] = entries[0]
                    else:
                        return_dict[adr_info['name']] = entries
                else:
                    return_dict[adr_info['name']] = entries
            byte_loc = adr_info['next_adr_location']

        return return_dict
github MAVENSDC / cdflib / cdflib / cdfread.py View on Github external
dataType = aedr_info['data_type']
                        if (len(entryData.tolist()) == 1):
                            if (dataType != 31 and dataType != 32 and dataType != 33):
                                entryWithType.append(entryData.tolist()[0])
                            else:
                                if (dataType != 33):
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist()[0],
                                                                               iso_8601=False))
                                else:
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist()[0]))
                        else:
                            if (dataType != 31 and dataType != 32 and dataType != 33):
                                entryWithType.append(entryData.tolist())
                            else:
                                if (dataType != 33):
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist(),
                                                                               iso_8601=False))
                                else:
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist()))
                    entryWithType.append(CDF._datatype_token(aedr_info['data_type']))
                    entries[aedr_info['entry_num']] = entryWithType
                aedr_byte_loc = aedr_info['next_aedr']

            if (len(entries) != 0):
                if (expand is False):
                    if (len(entries) == 1):
                        return_dict[adr_info['name']] = entries[0]
                    else:
                        return_dict[adr_info['name']] = entries
                else:
                    return_dict[adr_info['name']] = entries
            byte_loc = adr_info['next_adr_location']
github MAVENSDC / cdflib / cdflib / cdfread.py View on Github external
return_dict[adr_info['name']] = entryData
                else:
                    entryWithType = []
                    if (isinstance(entryData, str)):
                        entryWithType.append(entryData)
                    else:
                        dataType = aedr_info['data_type']
                        if (dataType != 31 and dataType != 32 and dataType != 33):
                            if (len(entryData.tolist()) == 1):
                                entryWithType.append(entryData.tolist()[0])
                            else:
                                entryWithType.append(entryData.tolist())
                        else:
                            if (len(entryData.tolist()) == 1):
                                if (dataType != 33):
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist()[0],
                                                                               iso_8601=False))
                                else:
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist()[0]))
                            else:
                                if (dataType != 33):
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist(),
                                                                               iso_8601=False))
                                else:
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist()))
                    entryWithType.append(CDF._datatype_token(aedr_info['data_type']))
                    return_dict[adr_info['name']] = entryWithType
                found = 1
                break
            byte_loc = adr_info['next_adr_location']
            if (found == 0 and expand != False):
                return_dict[adr_info['name']] = None
github MAVENSDC / cdflib / cdflib / cdfread.py View on Github external
entries.append(entryData)
                else:
                    entryWithType = []
                    if (isinstance(entryData, str)):
                        entryWithType.append(entryData)
                    else:
                        dataType = aedr_info['data_type']
                        if (len(entryData.tolist()) == 1):
                            if (dataType != 31 and dataType != 32 and dataType != 33):
                                entryWithType.append(entryData.tolist()[0])
                            else:
                                if (dataType != 33):
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist()[0],
                                                                               iso_8601=False))
                                else:
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist()[0]))
                        else:
                            if (dataType != 31 and dataType != 32 and dataType != 33):
                                entryWithType.append(entryData.tolist())
                            else:
                                if (dataType != 33):
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist(),
                                                                               iso_8601=False))
                                else:
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist()))
                    entryWithType.append(CDF._datatype_token(aedr_info['data_type']))
                    entries[aedr_info['entry_num']] = entryWithType
                aedr_byte_loc = aedr_info['next_aedr']

            if (len(entries) != 0):
                if (expand is False):
                    if (len(entries) == 1):
github MAVENSDC / cdflib / cdflib / cdfread.py View on Github external
dataType = aedr_info['data_type']
                        if (dataType != 31 and dataType != 32 and dataType != 33):
                            if (len(entryData.tolist()) == 1):
                                entryWithType.append(entryData.tolist()[0])
                            else:
                                entryWithType.append(entryData.tolist())
                        else:
                            if (len(entryData.tolist()) == 1):
                                if (dataType != 33):
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist()[0],
                                                                               iso_8601=False))
                                else:
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist()[0]))
                            else:
                                if (dataType != 33):
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist(),
                                                                               iso_8601=False))
                                else:
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist()))
                    entryWithType.append(CDF._datatype_token(aedr_info['data_type']))
                    return_dict[adr_info['name']] = entryWithType
                found = 1
                break
            byte_loc = adr_info['next_adr_location']
            if (found == 0 and expand != False):
                return_dict[adr_info['name']] = None
        return return_dict
github MAVENSDC / cdflib / cdflib / cdfread.py View on Github external
if (isinstance(entryData, str)):
                        entryWithType.append(entryData)
                    else:
                        dataType = aedr_info['data_type']
                        if (dataType != 31 and dataType != 32 and dataType != 33):
                            if (len(entryData.tolist()) == 1):
                                entryWithType.append(entryData.tolist()[0])
                            else:
                                entryWithType.append(entryData.tolist())
                        else:
                            if (len(entryData.tolist()) == 1):
                                if (dataType != 33):
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist()[0],
                                                                               iso_8601=False))
                                else:
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist()[0]))
                            else:
                                if (dataType != 33):
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist(),
                                                                               iso_8601=False))
                                else:
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist()))
                    entryWithType.append(CDF._datatype_token(aedr_info['data_type']))
                    return_dict[adr_info['name']] = entryWithType
                found = 1
                break
            byte_loc = adr_info['next_adr_location']
            if (found == 0 and expand != False):
                return_dict[adr_info['name']] = None
        return return_dict
github MAVENSDC / cdflib / cdflib / cdfread.py View on Github external
entryWithType.append(entryData.tolist()[0])
                            else:
                                entryWithType.append(entryData.tolist())
                        else:
                            if (len(entryData.tolist()) == 1):
                                if (dataType != 33):
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist()[0],
                                                                               iso_8601=False))
                                else:
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist()[0]))
                            else:
                                if (dataType != 33):
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist(),
                                                                               iso_8601=False))
                                else:
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist()))
                    entryWithType.append(CDF._datatype_token(aedr_info['data_type']))
                    return_dict[adr_info['name']] = entryWithType
                found = 1
                break
            byte_loc = adr_info['next_adr_location']
            if (found == 0 and expand != False):
                return_dict[adr_info['name']] = None
        return return_dict
github MAVENSDC / cdflib / cdflib / cdfread.py View on Github external
aedr_info = self._read_aedr2(aedr_byte_loc, to_np=to_np)
                entryData = aedr_info['entry']
                if (expand is False):
                    entries.append(entryData)
                else:
                    entryWithType = []
                    if (isinstance(entryData, str)):
                        entryWithType.append(entryData)
                    else:
                        dataType = aedr_info['data_type']
                        if (len(entryData.tolist()) == 1):
                            if (dataType != 31 and dataType != 32 and dataType != 33):
                                entryWithType.append(entryData.tolist()[0])
                            else:
                                if (dataType != 33):
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist()[0],
                                                                               iso_8601=False))
                                else:
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist()[0]))
                        else:
                            if (dataType != 31 and dataType != 32 and dataType != 33):
                                entryWithType.append(entryData.tolist())
                            else:
                                if (dataType != 33):
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist(),
                                                                               iso_8601=False))
                                else:
                                    entryWithType.append(epoch.CDFepoch.encode(entryData.tolist()))
                    entryWithType.append(CDF._datatype_token(aedr_info['data_type']))
                    entries[aedr_info['entry_num']] = entryWithType
                aedr_byte_loc = aedr_info['next_aedr']