Skip to content

Commit

Permalink
Merge pull request #103 from LCOGT/feature/position-angle
Browse files Browse the repository at this point in the history
Frontend changes to plumb the position angle through
  • Loading branch information
LTDakin authored Sep 16, 2024
2 parents 4d4e3a8 + 7027ba7 commit 02672d9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
9 changes: 6 additions & 3 deletions src/components/Project/ImageAnalysis/ImageAnalyzer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ const lineProfileLength = ref()
const startCoords = ref()
const endCoords = ref()
const catalog = ref([])
const positionAngle = ref()
function closeDialog() {
function closeDialog() {
lineProfile.value = []
lineProfileLength.value = 0
startCoords.value = null
Expand All @@ -53,6 +54,7 @@ function handleAnalysisOutput(response, action, action_callback){
lineProfileLength.value = response.arcsec
endCoords.value = response.end_coords
startCoords.value = response.start_coords
positionAngle.value = response.position_angle
break
case 'source-catalog':
catalog.value = response
Expand Down Expand Up @@ -101,7 +103,7 @@ function handleAnalysisOutput(response, action, action_callback){
<p>Site: {{ image.site_id }}</p>
<p>Telescope: {{ image.telescope_id }}</p>
<p>Instrument: {{ image.instrument_id }}</p>
<span>Filter:
<span>Filter:
<filter-badge
v-if="image.FILTER"
:filter="image.FILTER"
Expand All @@ -113,6 +115,7 @@ function handleAnalysisOutput(response, action, action_callback){
:x-axis-arcsecs="lineProfileLength"
:start-coords="startCoords"
:end-coords="endCoords"
:position-angle="positionAngle"
/>
</div>
</div>
Expand Down Expand Up @@ -148,7 +151,7 @@ a{
margin-left: 10px;
margin-bottom: 5%;
}
@media (min-width: 1201px) {
@media (min-width: 1201px) {
.side-panel-container {
margin-left: 20%;
}
Expand Down
7 changes: 4 additions & 3 deletions src/components/Project/ImageAnalysis/ImageViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ const loadImageOverlay = () => {
img.onload = () => {
imageWidth.value = img.width
imageHeight.value = img.height
// Getting image bounds based on img's size
imageBounds = [[0, 0], [imageHeight.value, imageWidth.value]]
imageBounds = [[0, 0], [imageHeight.value, imageWidth.value]]
if (imageOverlay) {
image.removeLayer(imageOverlay)
}
Expand Down Expand Up @@ -221,7 +221,8 @@ function createCatalogLayer(){
fillColor: 'var(--tangerine)',
fillOpacity: 0.2,
radius: 10,
pmIgnore: true // Ignore this layer for geoman editing
// TODO: Figure out a way to make this uneditable without pmIgnore. This breaks the snap to source functionality :(
//pmIgnore: true // Ignore this layer for geoman editing
})
sourceMarker.bindPopup(`Flux: ${source.flux}<br>Ra: ${source.ra}<br>Dec: ${source.dec}`)
Expand Down
9 changes: 6 additions & 3 deletions src/components/Project/ImageAnalysis/LinePlot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as d3 from 'd3'
const svg = ref(null)
const props = defineProps(['yAxisLuminosity', 'xAxisArcsecs', 'startCoords', 'endCoords'])
const props = defineProps(['yAxisLuminosity', 'xAxisArcsecs', 'startCoords', 'endCoords', 'positionAngle'])
// Setting dimensions and margins for the plot
const margin = { top: 20, right: 20, bottom: 70, left: 80 },
Expand Down Expand Up @@ -94,7 +94,7 @@ onMounted(() => {
.style('font-family', 'Open Sans, sans-serif')
.style('text-anchor', 'middle')
.text('Luminosity')
})
</script>

Expand All @@ -119,10 +119,13 @@ onMounted(() => {
<p v-if="endCoords">
End: RA {{ endCoords[0].toFixed(3) }} DEC {{ endCoords[1].toFixed(3) }}
</p>
<p v-if="positionAngle">
Position Angle: {{ positionAngle.toFixed(3) }}° East of North
</p>
</div>
</template>

<style scoped>
<style scoped>
.line-plot {
color: var(--tan);
font-family: 'Open Sans', sans-serif;
Expand Down

0 comments on commit 02672d9

Please sign in to comment.