Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vlkb-soda
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
ViaLactea
vlkb-soda
Commits
e74a4df4
Commit
e74a4df4
authored
2 months ago
by
Robert Butora
Browse files
Options
Downloads
Patches
Plain Diff
cutout: adds check on adding extra_cards only if not in header (by exact match on key)
parent
de089c19
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
data-access/engine/src/common/src/fitsfiles.cpp
+14
-2
14 additions, 2 deletions
data-access/engine/src/common/src/fitsfiles.cpp
data-access/engine/src/vlkb-obscore/src/database/database.cpp
+1
-0
1 addition, 0 deletions
...-access/engine/src/vlkb-obscore/src/database/database.cpp
with
15 additions
and
2 deletions
data-access/engine/src/common/src/fitsfiles.cpp
+
14
−
2
View file @
e74a4df4
...
...
@@ -362,6 +362,18 @@ string fitsfiles::append_card_if_not_in_header(string header, const vector<fits_
// deprecated
// NOT: checks only for _exact_ match on card-key: 'xxxxx____=' ? 'yyyyy____='
bool
is_in_header
(
string
&
hdr
,
string
&
card
)
{
for
(
int
offset
=
0
;
offset
<
hdr
.
size
();
offset
+=
80
)
{
string
hdr_card_key
{
hdr
.
substr
(
offset
,
10
)
};
if
(
0
==
card
.
substr
(
0
,
10
).
compare
(
hdr_card_key
))
return
true
;
}
return
false
;
}
void
append_cards
(
string
&
hdr
,
vector
<
string
>
cards
)
{
LOG_trace
(
__func__
);
...
...
@@ -374,7 +386,8 @@ void append_cards(string& hdr, vector<string> cards)
{
if
(
end_card
.
compare
(
hdr
.
substr
(
hdr_len
-
80
,
80
))
==
0
)
hdr
.
erase
(
hdr_len
-
80
,
80
);
for
(
long
unsigned
int
i
=
0
;
i
<
cards
.
size
();
i
++
)
hdr
+=
cards
[
i
];
for
(
long
unsigned
int
i
=
0
;
i
<
cards
.
size
();
i
++
)
if
(
!
is_in_header
(
hdr
,
cards
[
i
])
)
hdr
+=
cards
[
i
];
hdr
+=
end_card
;
}
...
...
@@ -408,7 +421,6 @@ vector<fitsfiles::Hdu> fitsfiles::fname2hdrstr(
bool
extra_cards_given
=
(
extra_cards
.
size
()
>
0
);
if
(
extra_cards_given
)
{
// FIXME check for duplicates before appending
append_cards
(
header_str
,
extra_cards
);
}
...
...
This diff is collapsed.
Click to expand it.
data-access/engine/src/vlkb-obscore/src/database/database.cpp
+
1
−
0
View file @
e74a4df4
...
...
@@ -322,6 +322,7 @@ void database::dbAddSurvey(int sid, const string groups,
{
// FIXME add check that any of cards RESTFREQ RESTFRQ RESTWAV exist:Add only if not!
// current append in fname2hdrstr checks only for _exact_ match on card-key: 'xxxxx____=' ? 'yyyyy____='
ostringstream
restfrq
;
restfrq
.
setf
(
ios
::
fixed
,
ios
::
floatfield
);
...
...
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