FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
PMRID/src/python/raw_12_to_10bits.py at training_patch · AlgorithmicIntelligence/PMRID · GitHub
AlgorithmicIntelligence
/
PMRID
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Issues
1
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
PMRID
/
src
/
python
/
raw_12_to_10bits.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
18 lines (16 loc) · 616 Bytes
Breadcrumbs
PMRID
/
src
/
python
/
raw_12_to_10bits.py
Copy path
File metadata and controls
18 lines (16 loc) · 616 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import
os
import
numpy
as
np
data_folder_path
=
'/home/user/work/data/Tsing/2-25600/linear/raws'
raw_paths
=
list
()
for
raw_name
in
os
.
listdir
(
data_folder_path
):
if
not
'.raw'
in
raw_name
:
continue
raw_path
=
os
.
path
.
join
(
data_folder_path
,
raw_name
)
raw
=
np
.
fromfile
(
raw_path
,
np
.
uint16
).
astype
(
np
.
float32
)
os
.
remove
(
raw_path
)
# print(raw.shape)
# print(raw.shape, raw.max(), raw.min(), raw.mean())
raw
=
np
.
round
(
raw
/
4095
*
1023
).
astype
(
np
.
uint16
)
# output_raw_path = raw_path.replace('h1080', 'h1072')
with
open
(
raw_path
,
'wb'
)
as
f
:
f
.
write
(
raw
.
tobytes
())
Back
|
FazBrowse Home
|
New Git URL