Skip to content

Commit f917200

Browse files
authored
Merge pull request #130 from LCOGT/fix/output-analysis
Fixes for datalab output analysis
2 parents ed16f79 + 7cff85d commit f917200

File tree

8 files changed

+180
-559
lines changed

8 files changed

+180
-559
lines changed

package-lock.json

Lines changed: 21 additions & 426 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"dependencies": {
1111
"@geoman-io/leaflet-geoman-free": "^2.17.0",
1212
"@mdi/font": "5.9.55",
13+
"chart.js": "^4.4.6",
1314
"core-js": "^3.8.3",
14-
"d3": "^7.9.0",
1515
"leaflet": "^1.9.4",
1616
"lodash": "^4.17.21",
1717
"lru-cache": "^10.2.0",
@@ -21,7 +21,6 @@
2121
"serve": "^14.2.1",
2222
"vue": "^3.5.9",
2323
"vue-router": "^4.2.5",
24-
"vue3-carousel": "^0.3.1",
2524
"vuetify": "^3.7.4",
2625
"webfontloader": "^1.0.0"
2726
},

src/components/Project/CreateSessionDialog.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ async function addImagesToExistingSession(session){
3939
const inputData = [...existingSession.input_data, ...props.newImages.map(image => ({
4040
'source': 'archive',
4141
'basename': image.basename.replace('-small', '') || image.basename.replace('-large', ''),
42+
'id': image.id,
43+
'url': image.url,
4244
'filter': image.FILTER
4345
}))]
4446
const requestBody = {
@@ -57,6 +59,8 @@ async function createNewDataSession(){
5759
const inputData = props.newImages.map(image => ({
5860
'source': 'archive',
5961
'basename': image.basename.replace('-small', '') || image.basename.replace('-large', ''),
62+
'id': image.id,
63+
'url': image.url,
6064
'filter': image.FILTER
6165
}))
6266
const requestBody = {

src/components/Project/ImageAnalysis/ImageAnalyzer.vue

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ function closeDialog() {
3939
startCoords.value = null
4040
endCoords.value = null
4141
headerData.value = null
42+
positionAngle.value = null
4243
emit('update:modelValue', false)
4344
}
4445
@@ -47,6 +48,7 @@ function requestAnalysis(action, input, action_callback=null){
4748
const url = configStore.datalabApiBaseUrl + 'analysis/' + action + '/'
4849
const body = {
4950
'basename': props.image.basename,
51+
'source': props.image.source,
5052
...input
5153
}
5254
fetchApiCall({url: url, method: 'POST', body: body, successCallback: (response) => {handleAnalysisOutput(response, action, action_callback)}})
@@ -111,10 +113,13 @@ function showHeaderDialog() {
111113
/>
112114
<v-toolbar-title>{{ image.basename || "Unknown" }}</v-toolbar-title>
113115
<image-download-menu
114-
:image="image"
116+
:image-name="image.basename"
117+
:fits-url="image.url || image.fits_url"
118+
:jpg-url="image.largeCachedUrl"
115119
@analysis-action="requestAnalysis"
116120
/>
117121
<v-btn
122+
v-if="image.id"
118123
icon="mdi-information"
119124
@click="showHeaderDialog"
120125
/>
@@ -145,8 +150,8 @@ function showHeaderDialog() {
145150
rounded
146151
>
147152
<line-plot
148-
:y-axis-luminosity="lineProfile"
149-
:x-axis-arcsecs="lineProfileLength"
153+
:y-axis-data="lineProfile"
154+
:x-axis-length="lineProfileLength"
150155
:start-coords="startCoords"
151156
:end-coords="endCoords"
152157
:position-angle="positionAngle"
@@ -212,11 +217,11 @@ a{
212217
}
213218
.basic-info-sheet{
214219
padding: 1rem;
220+
margin-bottom: 1rem;
215221
color: var(--tan);
216222
background-color: var(--metal);
217223
}
218224
.line-plot-sheet {
219-
margin-top: 1rem;
220225
padding: 1rem;
221226
background-color: var(--metal);
222227
height: 100%;

src/components/Project/ImageAnalysis/ImageDownloadMenu.vue

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
11
<script setup>
22
import { useAlertsStore } from '@/stores/alerts'
33
4-
const props = defineProps(['image', 'tifUrl'])
4+
const props = defineProps({
5+
imageName: {
6+
type: String,
7+
required: true,
8+
default: null,
9+
},
10+
fitsUrl: {
11+
type: String,
12+
required: false,
13+
default: null,
14+
},
15+
jpgUrl: {
16+
type: String,
17+
required: false,
18+
default: null,
19+
},
20+
})
521
622
defineEmits(['analysisAction'])
723
@@ -12,6 +28,7 @@ function downloadLink(link, filename, fileType='file'){
1228
alertStore.setAlert('error', `No ${fileType} available for download`)
1329
return
1430
}
31+
// Create a link element and click it to download the file
1532
const a = document.createElement('a')
1633
a.href = link
1734
a.download = filename
@@ -33,19 +50,21 @@ function downloadLink(link, filename, fileType='file'){
3350
/>
3451
</template>
3552
<v-btn
53+
v-if="props.fitsUrl"
3654
key="1"
3755
text=".FITS"
38-
@click="downloadLink(props.image.url, props.image.basename, 'FITs')"
56+
@click="downloadLink(props.fitsUrl, props.imageName, 'FITs')"
3957
/>
4058
<v-btn
4159
key="2"
4260
text=".TIF"
43-
@click="$emit('analysisAction', 'get-tif', {'basename': props.image.basename}, downloadLink)"
61+
@click="$emit('analysisAction', 'get-tif', {'basename': props.imageName}, downloadLink)"
4462
/>
4563
<v-btn
64+
v-if="props.jpgUrl"
4665
key="3"
4766
text=".JPG"
48-
@click="downloadLink(props.image.largeCachedUrl, props.image.basename, 'JPG')"
67+
@click="downloadLink(props.jpgUrl, props.imageName, 'JPG')"
4968
/>
5069
</v-speed-dial>
5170
</template>

src/components/Project/ImageAnalysis/ImageViewer.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ function loadImageOverlay() {
5454
maxBoundsViscosity: 1.0,
5555
})
5656
57-
// Layer control allows the toggling of layers on the map
58-
layerControl = L.control.layers(null, null, {collapsed:false}).addTo(imageMap)
59-
6057
const img = new Image()
6158
img.src = props.imageSrc
6259
@@ -206,7 +203,7 @@ function createCatalogLayer(){
206203
snapIgnore: false, // Allow snapping to this layer
207204
})
208205
209-
sourceMarker.bindPopup(`Flux: ${source.flux}<br>Ra: ${source.ra}<br>Dec: ${source.dec}`)
206+
sourceMarker.bindPopup(`Flux: ${source.flux ?? 'N/A'}<br>Ra: ${source.ra ?? 'N/A'}<br>Dec: ${source.dec ?? 'N/A'}`)
210207
sourceCatalogMarkers.push(sourceMarker)
211208
})
212209
@@ -216,6 +213,9 @@ function createCatalogLayer(){
216213
// Displays the catalog layer by default
217214
catalogLayerGroup.addTo(imageMap)
218215
216+
// Layer control allows the toggling of layers on the map
217+
layerControl = L.control.layers(null, null, {collapsed:false}).addTo(imageMap)
218+
219219
layerControl.addOverlay(catalogLayerGroup, 'Source Catalog')
220220
}
221221

0 commit comments

Comments
 (0)