Skip to content

Commit

Permalink
Merge pull request #113 from LCOGT/fix/quickanalysis_source
Browse files Browse the repository at this point in the history
Update analysis functions to work on ocs archived fits images
  • Loading branch information
jnation3406 authored Oct 30, 2023
2 parents a74f30d + 5cf171e commit 5fd0ee0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 42 deletions.
19 changes: 4 additions & 15 deletions src/components/AnalysisTools/HistogramTool.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
title="Get histogram from the selected rectangle region."
class="button"
:class="{ 'is-loading': region_histogram_loading }"
:disabled="!large_fits_exists && !small_fits_exists"
:disabled="!current_image.fits_filename"
@click="getHistogram(true)"
>
inspect region
Expand All @@ -16,7 +16,7 @@
<button
class="button"
:class="{ 'is-loading': image_histogram_loading }"
:disabled="!large_fits_exists && !small_fits_exists"
:disabled="!current_image.fits_filename"
@click="getHistogram(false)"
>
inspect image
Expand Down Expand Up @@ -61,8 +61,8 @@ export default {
getHistogram (useSubregion = true) {
const url = this.$store.state.api_endpoints.quickanalysis_endpoint + '/histogram-clipped'
const body = {
full_filename: this.best_available_full_filename,
s3_directory: this.current_image.s3_directory || 'data',
full_filename: this.current_image.fits_filename,
s3_directory: this.current_image.fits_path,
clip_percent: 0.001
}
if (useSubregion) {
Expand Down Expand Up @@ -110,17 +110,6 @@ export default {
'current_image'
]),
...mapGetters('images', [
'small_fits_exists',
'large_fits_exists',
'small_fits_filename',
'large_fits_filename'
]),
best_available_full_filename () {
return this.large_fits_exists
? this.large_fits_filename
: this.small_fits_filename
},
...mapGetters('drawshapes', [
'selectedId',
'selectionExists',
Expand Down
22 changes: 4 additions & 18 deletions src/components/AnalysisTools/ImageStatisticsViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
title="Only inspect the selected rectangle region."
class="button"
:class="{'is-loading':region_stats_loading}"
:disabled="!large_fits_exists && !small_fits_exists"
:disabled="!current_image.fits_filename"
@click="getRegionStats(true)"
>
inspect region
Expand All @@ -16,7 +16,7 @@
<button
class="button"
:class="{'is-loading':image_stats_loading}"
:disabled="!large_fits_exists && !small_fits_exists"
:disabled="!current_image.fits_filename"
@click="getRegionStats(false)"
>
inspect image
Expand Down Expand Up @@ -122,8 +122,8 @@ export default {
const body = {
site: this.sitecode,
full_filename: this.best_available_full_filename,
s3_directory: this.current_image.s3_directory || 'data'
full_filename: this.current_image.fits_filename,
s3_directory: this.current_image.fits_path
}
if (useSubregion) {
if (this.selectedShapeType != 'rects') {
Expand Down Expand Up @@ -180,14 +180,6 @@ export default {
'current_image'
]),
...mapGetters('images', [
'small_fits_exists',
'large_fits_exists',
'small_fits_filename',
'large_fits_filename',
'info_images_exist'
]),
...mapGetters('drawshapes', [
'selectedId',
'selectionExists',
Expand All @@ -198,12 +190,6 @@ export default {
return this.$store.getters['starprofile/marked_stars']
},
best_available_full_filename () {
return this.large_fits_exists
? this.large_fits_filename
: this.small_fits_filename
},
activeDrawShape: {
get () { return this.$store.getters['drawshapes/activeDrawShape'] },
set (val) { this.$store.dispatch('drawshapes/activeDrawShape', val) }
Expand Down
12 changes: 4 additions & 8 deletions src/components/AnalysisTools/LineProfileInspection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<div>
<b-field>
<button
:disabled="!large_fits_exists && !small_fits_exists"
title="first draw a line on the image to inspect"
class="button"
:class="{'is-loading': analysisInProgress}"
:disabled="!current_image.fits_filename"
@click="getLineProfile"
>
get line profile
Expand Down Expand Up @@ -127,8 +127,8 @@ export default {
}
const payload = {
full_filename: this.useLargeFits ? this.large_fits_filename : this.small_fits_filename,
s3_directory: this.current_image.s3_directory || 'data',
full_filename: this.current_image.fits_filename,
s3_directory: this.current_image.fits_path,
start: startingPoint,
end: endingPoint
}
Expand All @@ -151,11 +151,7 @@ export default {
computed: {
...mapGetters('images', [
'current_image',
'large_fits_exists',
'small_fits_exists',
'large_fits_filename',
'small_fits_filename'
'current_image'
]),
...mapGetters('drawshapes', [
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/images.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const getters = {
return `${image.base_filename}-${image.data_type}${state.large_fits_reduction_level}.fits.fz`
},

info_image_is_active: state => state.current_image.s3_direcotry == 'info-images',
info_image_is_active: state => state.current_image.s3_directory == 'info-images',
info_images_exist: state => state.info_images.some(i => 'channel' in i)
}

Expand Down

0 comments on commit 5fd0ee0

Please sign in to comment.