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
4dad4b9a
Commit
4dad4b9a
authored
1 year ago
by
Robert Butora
Browse files
Options
Downloads
Patches
Plain Diff
creates DataLink-constructor to convert cutout results in ServeltCutout
parent
1f80727a
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
data-access/servlet/src/main/java/webapi/ServletCutout.java
+2
-26
2 additions, 26 deletions
data-access/servlet/src/main/java/webapi/ServletCutout.java
data-access/servlet/src/main/java/webapi/output/DataLink.java
+33
-0
33 additions, 0 deletions
...-access/servlet/src/main/java/webapi/output/DataLink.java
with
35 additions
and
26 deletions
data-access/servlet/src/main/java/webapi/ServletCutout.java
+
2
−
26
View file @
4dad4b9a
...
...
@@ -152,7 +152,7 @@ public class ServletCutout extends javax.servlet.http.HttpServlet
rsl
.
resolve
(
id
);
relPathname
=
rsl
.
relPathname
();
hdunum
=
rsl
.
hdunum
();
String
subsurveyId
=
rsl
.
obsCollection
();
//this implementation assumes ObsCore::obs_collection holds ssID
String
subsurveyId
=
rsl
.
obsCollection
();
FitsCard
[]
extraCards
=
null
;
if
(
subsurveyId
!=
null
)
{
...
...
@@ -173,31 +173,7 @@ public class ServletCutout extends javax.servlet.http.HttpServlet
CutResult
cutResult
=
cutout
.
doFile
(
relPathname
,
hdunum
,
pos
,
band
,
time
,
pol
,
pixels
,
false
,
null
);
DataLink
dlk
=
new
DataLink
();
dlk
.
id
=
id
;
dlk
.
accessUrl
=
dlk
.
convertLocalPathnameToRemoteUrl
(
cutResult
.
filename
,
settings
.
fitsPaths
.
cutouts
(),
settings
.
fitsPaths
.
cutoutsUrl
());
dlk
.
serviceDef
=
null
;
dlk
.
errorMessage
=
null
;
dlk
.
description
=
"A cutout from "
+
id
;
// + " by parameters "
// + pos.toString() + " " + band.toString() + " " + time.toString() + " " + pol.toString();
dlk
.
semantics
=
"http://www.ivoa.net/rdf/datalink/core#proc#cutout"
;
dlk
.
contentType
=
"application/fits"
;
dlk
.
contentLength
=
cutResult
.
filesize
;
// VLKB-extension to DataLink:
Coord
coord
=
new
Coord
(
DEFAULT_SKY_SYSTEM
,
pos
,
DEFAULT_SPEC_SYSTEM
,
band
,
time
,
pol
);
LOGGER
.
info
(
coord
.
toString
());
dlk
.
inputs
=
new
Inputs
(
id
,
coord
,
countNullValues
);
dlk
.
versionString
=
Version
.
asString
;
dlk
.
cut
=
null
;
dlk
.
absCutPathname
=
cutResult
.
filename
;
dlk
.
datacubeCount
=
1
;
dlk
.
nullVals
=
((
cutResult
.
nullValueCount
.
percent
<
0
)
||
(
cutResult
.
nullValueCount
.
totalCount
<
1
))
?
null
:
cutResult
.
nullValueCount
;
dlk
.
mcutResultArr
=
null
;
DataLink
dlk
=
new
DataLink
(
settings
,
cutResult
,
id
,
pos
,
band
,
time
,
pol
,
countNullValues
);
return
dlk
;
}
...
...
This diff is collapsed.
Click to expand it.
data-access/servlet/src/main/java/webapi/output/DataLink.java
+
33
−
0
View file @
4dad4b9a
...
...
@@ -3,6 +3,7 @@ import java.util.logging.Logger;
import
java.util.List
;
import
java.util.ArrayList
;
import
vo.parameter.*
;
class
DataLink
{
...
...
@@ -38,6 +39,37 @@ class DataLink
this
.
datacubeCount
=
1
;
}
// used in ServeltCutout
public
DataLink
(
Settings
settings
,
CutResult
cutResult
,
String
id
,
Pos
pos
,
Band
band
,
Time
time
,
Pol
pol
,
boolean
countNullValues
)
{
this
.
id
=
id
;
this
.
accessUrl
=
convertLocalPathnameToRemoteUrl
(
cutResult
.
filename
,
settings
.
fitsPaths
.
cutouts
(),
settings
.
fitsPaths
.
cutoutsUrl
());
this
.
serviceDef
=
null
;
this
.
errorMessage
=
null
;
this
.
description
=
"A cutout from "
+
id
;
// + " by parameters "
// + pos.toString() + " " + band.toString() + " " + time.toString() + " " + pol.toString();
this
.
semantics
=
"http://www.ivoa.net/rdf/datalink/core#proc#cutout"
;
this
.
contentType
=
"application/fits"
;
this
.
contentLength
=
cutResult
.
filesize
;
// VLKB-extension to DataLink:
Coord
coord
=
new
Coord
(
pos
.
system
.
toString
(),
pos
,
band
.
system
.
toString
(),
band
,
time
,
pol
);
LOGGER
.
info
(
coord
.
toString
());
this
.
inputs
=
new
Inputs
(
id
,
coord
,
countNullValues
);
this
.
versionString
=
Version
.
asString
;
this
.
cut
=
null
;
this
.
absCutPathname
=
cutResult
.
filename
;
this
.
datacubeCount
=
1
;
this
.
nullVals
=
((
cutResult
.
nullValueCount
.
percent
<
0
)
||
(
cutResult
.
nullValueCount
.
totalCount
<
1
))
?
null
:
cutResult
.
nullValueCount
;
this
.
mcutResultArr
=
null
;
}
// FIXME fake, only to compile MCutout and Merge
public
DataLink
(
CutResult
cutResult
)
{
...
...
@@ -63,6 +95,7 @@ class DataLink
}
// used in MCutout
public
DataLink
(
MCutResult
cutResult
)
{
this
.
nullVals
=
new
NullValueCount
();
...
...
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