Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gdat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
SPC
gdat
Commits
d106e4b8
Commit
d106e4b8
authored
2 months ago
by
Luke Simons
Browse files
Options
Downloads
Patches
Plain Diff
Changed comments. Added calculation for epoch time in ns
parent
8ff7659f
No related branches found
No related tags found
1 merge request
!196
Resolve "Add dataset_description IDS"
Pipeline
#266136
passed
2 months ago
Stage: test
Stage: post-test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
matlab/TCV_IMAS/tcv_get_ids_dataset_description.m
+2
-2
2 additions, 2 deletions
matlab/TCV_IMAS/tcv_get_ids_dataset_description.m
matlab/get_mds_node_info.m
+13
-8
13 additions, 8 deletions
matlab/get_mds_node_info.m
with
15 additions
and
10 deletions
matlab/TCV_IMAS/tcv_get_ids_dataset_description.m
+
2
−
2
View file @
d106e4b8
...
@@ -64,11 +64,11 @@ ids_dataset_description.pulse=shot;
...
@@ -64,11 +64,11 @@ ids_dataset_description.pulse=shot;
% Attempt to fill information about pulse time
% Attempt to fill information about pulse time
% FIXME: How to get pulse_time_end? Simply = pulse_time_begin + X seconds?
% FIXME: How to get pulse_time_end? Simply = pulse_time_begin + X seconds?
[
pulse_time_begin
,
pulse_time_begin_epoch
]
=
...
[
pulse_time_begin
,
pulse_time_begin_epoch
,
pulse_time_begin_epoch_ns
]
=
...
get_mds_node_info
(
'\VSYSTEM:TIMERS.VALUES'
,
shot
);
get_mds_node_info
(
'\VSYSTEM:TIMERS.VALUES'
,
shot
);
ids_dataset_description
.
pulse_time_begin
=
pulse_time_begin
;
ids_dataset_description
.
pulse_time_begin
=
pulse_time_begin
;
ids_dataset_description
.
pulse_time_begin_epoch
.
seconds
=
pulse_time_begin_epoch
;
ids_dataset_description
.
pulse_time_begin_epoch
.
seconds
=
pulse_time_begin_epoch
;
ids_dataset_description
.
pulse_time_begin_epoch
.
nanoseconds
=
pulse_time_begin_epoch
.*
1e9
;
ids_dataset_description
.
pulse_time_begin_epoch
.
nanoseconds
=
pulse_time_begin_epoch
_ns
;
% ids_dataset_description.pulse_time_end_epoch.seconds=
% ids_dataset_description.pulse_time_end_epoch.seconds=
% ids_dataset_description.pulse_time_end_epoch.nanoseconds=
% ids_dataset_description.pulse_time_end_epoch.nanoseconds=
% ids_dataset_description.pulse_processing_time_begin=node_time
% ids_dataset_description.pulse_processing_time_begin=node_time
...
...
This diff is collapsed.
Click to expand it.
matlab/get_mds_node_info.m
+
13
−
8
View file @
d106e4b8
function
[
node_time
,
node_epoch_time
,
node_owner
]
=
get_mds_node_info
(
node_str
,
shot
)
function
[
node_time
,
node_epoch_time
,
node_epoch_time_ns
,
node_owner
]
=
get_mds_node_info
(
node_str
,
shot
)
%GET_MDS_NODE_INFO Retrieves insertion time and owner of a node in MDSplus
% [node_time, node_epoch_time, node_owner] =
% get_mds_node_info(node_str, shot)
%
% Retrieves insertion time and owner of a node in MDSplus
%
%
% [node_time, node_owner] = GET_MDS_NODE_INFO(node_str, shot)
% Inputs:
% Inputs:
% node_str - String path to the MDSplus node
% node_str - String
,
path to the MDSplus node
% (e.g. '\\RESULTS::CXRS_001:TI')
% (e.g. '\\RESULTS::CXRS_001:TI')
% shot - Shot number to open
% shot -
Numeric,
Shot number to open
%
%
% Outputs:
% Outputs:
% node_time - Time the node data was inserted
% node_time - Numeric, Time the node data was inserted
% node_owner - (Optional) Owner info of the node
% node_owner - String, (Optional) Owner info of the node
%
% Date: 20/09/24
% Author: L. Simons
% Open the shot
% Open the shot
mdsopen
(
'tcv_shot'
,
shot
);
mdsopen
(
'tcv_shot'
,
shot
);
...
@@ -25,7 +30,7 @@ function [node_time, node_epoch_time, node_owner] = get_mds_node_info(node_str,
...
@@ -25,7 +30,7 @@ function [node_time, node_epoch_time, node_owner] = get_mds_node_info(node_str,
node_time
=
[
time_str
'Z'
];
node_time
=
[
time_str
'Z'
];
% Convert to Unix Epoch time (seconds since Jan 1, 1970 UTC)
% Convert to Unix Epoch time (seconds since Jan 1, 1970 UTC)
node_epoch_time
=
posixtime
(
datetime
(
mds_node_time
,
'InputFormat'
,
'dd-MMM-yyyy HH:mm:ss.SSSSSS'
,
'TimeZone'
,
'UTC'
));
node_epoch_time
=
posixtime
(
datetime
(
mds_node_time
,
'InputFormat'
,
'dd-MMM-yyyy HH:mm:ss.SSSSSS'
,
'TimeZone'
,
'UTC'
));
node_epoch_time_ns
=
mod
(
second
(
dt
),
1
)
*
1e9
;
% Owner
% Owner
tdi_owner
=
sprintf
(
'owner_ascii("%s")'
,
node_str
);
tdi_owner
=
sprintf
(
'owner_ascii("%s")'
,
node_str
);
...
...
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