Skip to content

Commit

Permalink
Merge branch 'dev' into fix/quickanalysis_source
Browse files Browse the repository at this point in the history
  • Loading branch information
jnation3406 authored Oct 30, 2023
2 parents ab92472 + a74f30d commit 5cf171e
Show file tree
Hide file tree
Showing 13 changed files with 314 additions and 194 deletions.
47 changes: 26 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"vue-material-design-icons": "^4.6.0",
"vue-router": "^3.2.0",
"vuex": "^3.4.0",
"vuex-persistedstate": "^2.7.1",
"vuex-persistedstate": "^4.1.0",
"ws": "^7.3.0"
},
"devDependencies": {
Expand Down
26 changes: 24 additions & 2 deletions src/components/ImageDisplay/FitsHeaderModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
:data="fitsHeaderTable"
:columns="columns"
style="width: auto; flex: 0"
:loading="headerIsLoading"
/>
</div>
</div>
Expand All @@ -75,7 +76,9 @@ export default {
},
data () {
return {
fitsHeader: {},
showFitsHeaderModal: false,
headerIsLoading: false,
columns: [
{
field: 'key',
Expand All @@ -91,22 +94,41 @@ export default {
]
}
},
watch: {
image () {
if (this.showFitsHeaderModal) {
this.refreshFitsHeader()
}
}
},
computed: {
fitsHeaderTable () {
const tableData = []
for (const property in this.image.header) {
for (const property in this.fitsHeader) {
tableData.push({
key: property.toLowerCase(),
val: this.image.header[property]
val: this.fitsHeader[property]
})
}
return tableData
}
},
methods: {
refreshFitsHeader () {
this.fitsHeader = {}
this.headerIsLoading = true
this.$store.dispatch('images/loadCurrentImageFitsHeader').then(header => {
this.fitsHeader = header
}).finally(() => {
this.headerIsLoading = false
})
},
showFitsHeader () {
this.refreshFitsHeader()
this.showFitsHeaderModal = true
}
}
}
</script>
<style lang="scss" scoped>
</style>
151 changes: 68 additions & 83 deletions src/components/ImageDisplay/ImageInfoBar.vue
Original file line number Diff line number Diff line change
@@ -1,49 +1,53 @@
<template>
<div>
<div class="image-info-bar-item site">
site:&nbsp;{{ site }}
site:&nbsp;{{ current_image.site }}
</div>
<div class="image-info-bar-item exptime">
exposure:&nbsp;{{ exposure }}s
exptime:&nbsp;{{ current_image.exposure_time }}s
</div>
<div class="image-info-bar-item filter-used">
filter:&nbsp;{{ filter }}
filter:&nbsp;{{ current_image.filter_used }}
</div>
<div class="image-info-bar-item smartstack">
stack:&nbsp;{{ smartstackProgress }}
</div>
<div class="image-info-bar-item ra">
ra:&nbsp;
<RaDisplay
<div
class="image-info-bar-item ra"
style="display:flex"
>
ra:&nbsp;<ra-display
:ra_hours_decimal="raHours"
:decimal_precision="3"
/>
</div>
<div class="image-info-bar-item dec">
dec:&nbsp;
<DecDisplay
<div
class="image-info-bar-item dec"
style="display:flex"
>
dec:&nbsp;<dec-display
:dec_deg_decimal="current_image.declination"
:decimal_precision="3"
/>
</div>
<div class="image-info-bar-item airmass">
airmass:&nbsp;{{ airmass }}
airmass:&nbsp;{{ current_image.airmass }}
</div>
<div class="image-info-bar-item altitude">
altitude:&nbsp;{{ altitude }}°
altitude:&nbsp;{{ truncateDecimalString(current_image.altitude, 4) }}°
</div>
<div class="image-info-bar-item obstime">
{{ obstime }}
{{ current_image.capture_date | dateToReadable }}
</div>
<div class="image-info-bar-item filename">
{{ current_image.base_filename }}
</div>
<div class="image-info-bar-item fwhm">
fwhm: {{ fwhm }}"
</div>
<div class="image-info-bar-item sepsky">
sky: {{ sepsky }} adu
</div>
<div class="image-info-bar-item filename">
{{ filename }}
</div>
</div>
</template>

Expand All @@ -63,11 +67,51 @@ export default {
required: true
}
},
data () {
return {
fwhm: '',
sepsky: '',
smartstackLength: 1, // Total number of images for this smartstack
smartstackNumber: 0 // Value of n for "this image is the nth smartstack image", 0-indexed
}
},
methods: {
filters: {
dateToReadable (date) {
return moment.utc(date).format('YYYY-MM-DD HH:mm UTC')
},
}
},
watch: {
current_image () {
// Get header for extra infobar values
this.$store.dispatch('images/loadCurrentImageFitsHeader').then(header => {
// Round appropriately
if ('FWHMASEC' in header) {
this.fwhm = Number(header.FWHMASEC).toFixed(2)
} else {
this.fwhm = 'n/a'
}
if ('SEPSKY' in header) {
this.sepsky = parseInt(header.SEPSKY)
} else {
this.sepsky = 'n/a'
}
if ('SSTKLEN' in header) {
this.smartstackLength = parseInt(header.SSTKLEN)
} else {
this.smartstackLength = 1
}
if ('SSTKNUM' in header) {
this.smartstackNumber = parseInt(header.SSTKNUM)
} else {
this.smartstackNumber = 0
}
})
}
},
methods: {
dateToUnix (date) {
return (new Date(date).getTime() / 1000).toFixed(0)
},
Expand All @@ -80,64 +124,6 @@ export default {
},
computed: {
site () {
return this.current_image.site
},
exposure () {
// Account for the cumulative exposure time represented in a smartstack by multiplying the
// single frame exposure time by the number of frames being represented.
//
// If the image is not part of a smartstack, it is treated like a smartstack with size 1, so the math still works.
const frameExposureTime = Number(this.current_image.exposure_time)
const framesInSmartstack = this.smartstackNumber
const cumulativeExposure = (framesInSmartstack + 1) * frameExposureTime
return cumulativeExposure
},
filter () {
return this.current_image.filter_used
},
airmass () {
return this.current_image.airmass
},
altitude () {
return this.truncateDecimalString(this.current_image.altitude, 4)
},
obstime () {
return this.dateToReadable(this.current_image.capture_date)
},
filename () {
return this.current_image.base_filename
},
fwhm () {
if (this.current_image.header && 'FWHMASEC' in this.current_image.header) {
return Number(this.current_image.header.FWHMASEC).toFixed(2)
} else {
return 'n/a'
}
},
sepsky () {
if (this.current_image.header && 'SEPSKY' in this.current_image.header) {
return parseInt(this.current_image.header.SEPSKY)
} else {
return 'n/a'
}
},
// Total number of images for this smartstack
smartstackLength () {
if (this.current_image.header && 'SSTKLEN' in this.current_image.header) {
return parseInt(this.current_image.header.SSTKLEN)
} else {
return 1
}
},
// Value of n for "this image is the nth smartstack image", 0-indexed
smartstackNumber () {
if (this.current_image.header && 'SSTKNUM' in this.current_image.header) {
return parseInt(this.current_image.header.SSTKNUM)
} else {
return 0
}
},
smartstackProgress () {
if (this.smartstackLength == 1) {
return 'n/a'
Expand Down Expand Up @@ -169,12 +155,11 @@ export default {
color: #aaa;
background-color: #1e2223;
display: grid;
grid-template-rows: 1fr 1fr 1fr 1fr;
grid-template-columns: 1fr 1.5fr 1fr 1fr;
grid-template-areas: 'site exptime ra dec'
'filter-used obstime airmass altitude'
'smartstack fwhm sepsky .'
'filename filename filename filename';
grid-template-rows: 1fr 1fr 1fr;
grid-template-columns: 1fr 2fr 0.5fr 1fr 1fr;
grid-template-areas: 'site exptime . ra dec'
'filter-used obstime . airmass altitude'
'smartstack filename filename fwhm sepsky';
grid-column-gap: 10px;
padding: 1px 3px;
font-size: 9pt;
Expand All @@ -186,8 +171,8 @@ export default {
.filter-used { grid-area: filter-used; }
.smartstack { grid-area: smartstack; }
.exptime { grid-area: exptime; }
.ra { grid-area: ra; display: flex; }
.dec { grid-area: dec; display: flex }
.ra { grid-area: ra; }
.dec { grid-area: dec; }
.airmass { grid-area: airmass; }
.altitude { grid-area: altitude; }
.obstime { grid-area: obstime; }
Expand Down
Loading

0 comments on commit 5cf171e

Please sign in to comment.