우리는 Windows 7/Vista 플랫폼에서 실행되는 독점적 인 이미지 분석 소프트웨어가있는 과학 장비 모음을 보유하고 있습니다. 이 소프트웨어는 품질 관리 메트릭 컬렉션을 바이너리 형식으로 유지합니다. 진취적인 프로그래머는 python 라이브러리를 작성하여 이러한 메트릭 파일에서 데이터를 가져오고 분류했습니다. 저는 이것을 사용하고 있지만, 해독에 어려움을 겪고있는 큰 관심거리가 있습니다. 라이브러리 코드에서 :펑키 파일 타임 스탬프 형식을 해독하는 방법에 대한 팁?
def parse_binary(self):
bs = self.bs
# Extraction Metrics (ExtractionMetricsOut.bin)
# Contains extraction metrics such as fwhm (full width at half maximum) scores and raw intensities
# Format:
# byte 0: file version number (2)
# byte 1: length of each record
# bytes (N * 38 + 2) - (N *38 + 39): record:
# 2 bytes: lane number (uint16)
# 2 bytes: tile number (uint16)
# 2 bytes: cycle number (uint16)
# 4 x 4 bytes: fwhm scores (float) for channel [A, C, G, T] respectively
# 2 x 4 bytes: intensities (uint16) for channel [A, C, G, T] respectively
#---->8 bytes: date/time of CIF creation --> 2 x 4 bytes for date and timestamp
# ...Where N is the record index
self.apparent_file_version = bs.read('uintle:8')
self.check_version(self.apparent_file_version)
recordlen = bs.read('uintle:8') # length of each record
for i in range(0,((bs.len)/(recordlen * 8))): # record length in bits
#OMITTED: obtain various data
#...
# 8 bytes: date/time of CIF creation
self.data['datetime'].append(bs.read('uintle:32'))
self.data['timestamp'].append(bs.read('uintle:32'))
self.df = pandas.DataFrame(self.data)
파이썬 콘솔에서 데이터를 검사 할 때 'datetime'데이터는 전혀 이해가되지 않습니다. 그러나 타임 스탬프 데이터가 훨씬 더 흥미 롭다 :
"exmets는"십일일의 과정에 대한 통계를 포함하는 팬더 dataframe 인 6 월 5 일 2013 년 6 월 (16) 2013 년 :
>>> len(exmets.data['timestamp'])
226559
>>> len(exmets.data['datetime'])
226559
>>> exmets.data['datetime'][1:10]
[2861233716L, 2934210013L, 2764566050L, 2864234016L, 2767136307L, 2817880381L, 2936700262L, 2820490642L, 2769576551L, 2866944287L]
>>> exmets.data['datetime'][100000:100010]
[4093949428L, 4104309713L, 4090699103L, 4094859519L, 4094289462L, 4098919713L, 4104359713L, 4104359713L, 4132262259L, 4150663099L]
내가 말했듯이, 'datetime'은 꽤 이상합니다. 그러나 '타임 스탬프는'훨씬 더 일반적인 것 같다
>>>exmets.data['timestamp'][1:10]
[2295344086L, 2295344086L, 2295344086L, 2295344086L, 2295344086L, 2295344086L, 2295344086L, 2295344086L, 2295344086L]
>>>exmets.data['timestamp'][100000:100010]
[2295345531L, 2295345531L, 2295345531L, 2295345531L, 2295345531L, 2295345531L, 2295345531L, 2295345531L, 2295345531L, 2295345531L]
>>>exmets.data['timestamp'][226549:226559]
[2295347466L, 2295347466L, 2295347466L, 2295347466L, 2295347466L, 2295347466L, 2295347466L, 2295347466L, 2295347466L, 2295347466L]
그래서 처음부터 끝까지 정기적으로 진행이있다, 그러나 당신이이 숫자 평균 초를 가정하면, 년에 단 한 시간이면 동일시 2296347466 - 2295344086 = 3380
의 차이가있다 용어의 초. 기계가 11 일간의 기간 동안 데이터를 생성하고 있었으므로 초가 이것을 잘못 가정하는 것으로 보입니다.
이것을 해독하는 방법에 대한 아이디어가 있으십니까?
앱에 타임 스탬프가 표시 되니 비교할만한 게 있습니까? –
8 바이트를 모두 배정도 부동 소수점으로 해석하려고 시도 했습니까? 며칠 또는 초가 될 수 있는지 확인 하시겠습니까? –