Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update analysis functions to work on ocs archived fits images #113

Merged
merged 3 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading