Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pyatsoleiloutils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PA
Optics
pyatsoleiloutils
Commits
e34e9d41
Commit
e34e9d41
authored
1 year ago
by
BLANCO-GARCIA
Browse files
Options
Downloads
Patches
Plain Diff
adding matlab files reading
parent
c955e234
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pyatsoleiloutils/readmatfile.py
+40
-0
40 additions, 0 deletions
pyatsoleiloutils/readmatfile.py
with
40 additions
and
0 deletions
pyatsoleiloutils/readmatfile.py
0 → 100644
+
40
−
0
View file @
e34e9d41
"""
This file contains functions to read preformated data from
mat files
"""
import
scipy
import
numpy
__all__
=
[
'
readmomapmat
'
]
def
readmomapmat
(
fname
):
"""
momap_pn, s_indexes, s_array = readmomapmat(fname)
This functions reads a given .mat with momentum aperture data
Args:
fname: name of the input .mat file
Returns:
momap: positive and negative sides of momentum aperture
s_indexes: indexes where momap was calculated
s_array: s coordinates of s_indexes
first_element_index : returns the first element index
0 (in python), 1 (in matlab)
"""
f
=
scipy
.
io
.
loadmat
(
fname
)
# set momap input format for get_lifetime
momap_pn
=
numpy
.
array
((
f
[
'
momap
'
][
'
dppP
'
][:],
f
[
'
momap
'
][
'
dppN
'
][:]))
momap_pn
=
numpy
.
copy
(
momap_pn
.
T
)
s_indexes
=
f
[
'
momap
'
][
'
s_indexes
'
][:]
s_array
=
f
[
'
momap
'
][
'
s_array
'
][:]
first_element_index
=
f
[
'
momap
'
][
'
first_element_index
'
][:]
f
.
close
()
return
momap_pn
,
s_indexes
,
s_array
,
first_element_index
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment