From f29b79ac576564eae601d87a297dfb1d6f30091d Mon Sep 17 00:00:00 2001 From: Carolina Capetillo Date: Mon, 23 Sep 2024 12:25:29 -0700 Subject: [PATCH 01/29] allows user to select different targets --- src/components/Scheduling/BeginnerScheduling.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Scheduling/BeginnerScheduling.vue b/src/components/Scheduling/BeginnerScheduling.vue index 60d2596..003bef0 100644 --- a/src/components/Scheduling/BeginnerScheduling.vue +++ b/src/components/Scheduling/BeginnerScheduling.vue @@ -110,6 +110,7 @@ const scheduleObservation = () => { +

Scheduling Observation of a {{ objectSelection.object }}

@@ -127,7 +128,6 @@ const scheduleObservation = () => {
-

Scheduling observation of a {{ objectSelection.object }} - {{ targetSelection.name }}

@@ -141,6 +141,8 @@ const scheduleObservation = () => {

+ +

Photon Ranch will schedule this for you

From f5f5f6576b836f3d39539ef3645f5fd35dae2f3e Mon Sep 17 00:00:00 2001 From: Carolina Capetillo Date: Mon, 30 Sep 2024 13:34:17 -0700 Subject: [PATCH 02/29] adds object selection and populates from api --- .../Scheduling/AdvancedScheduling.vue | 5 - .../Scheduling/BeginnerScheduling.vue | 182 +++++++++++++----- src/components/Scheduling/Calendar.vue | 41 ++++ src/components/Views/SchedulingView.vue | 42 ++-- 4 files changed, 200 insertions(+), 70 deletions(-) create mode 100644 src/components/Scheduling/Calendar.vue diff --git a/src/components/Scheduling/AdvancedScheduling.vue b/src/components/Scheduling/AdvancedScheduling.vue index 291f3e8..151e9c9 100644 --- a/src/components/Scheduling/AdvancedScheduling.vue +++ b/src/components/Scheduling/AdvancedScheduling.vue @@ -24,10 +24,6 @@ const showProjectName = (name) => { } } -const editProjectName = () => { - projectName.value = '' -} - const addTarget = (newTarget) => { targets.push({ name: newTarget, saved: true, editing: false }) addingNewTarget.value = false @@ -88,7 +84,6 @@ const scheduleObservation = () => {

Project Name: {{ projectName }}

- edit

Target: {{ target.name }}

diff --git a/src/components/Scheduling/BeginnerScheduling.vue b/src/components/Scheduling/BeginnerScheduling.vue index 003bef0..634eb97 100644 --- a/src/components/Scheduling/BeginnerScheduling.vue +++ b/src/components/Scheduling/BeginnerScheduling.vue @@ -2,6 +2,8 @@ import { ref, defineEmits, reactive, computed } from 'vue' import ExposureSettings from './ExposureSettings.vue' import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' +import Calendar from './Calendar.vue' +import { fetchApiCall } from '../../utils/api.js' const emits = defineEmits(['scheduled']) @@ -10,10 +12,10 @@ const categories = ref([ { location: 'Deep Space', options: [ - { object: 'Galaxy', targets: [{ name: 'Andromeda', type: 'spiral' }, { name: 'Milky Way', type: 'spiral' }, { name: 'Messier 87', type: 'elliptical' }] }, - { object: 'Star Cluster', targets: [{ name: 'Pleiades', type: 'open' }, { name: 'Hyades', type: 'open' }, { name: 'Messier 67', type: 'open' }] }, - { object: 'Supernova', targets: [{ name: 'Crab Nebula', type: 'supernova' }, { name: 'Tycho\'s Supernova', type: 'supernova' }, { name: 'SN 1054', type: 'supernova' }] }, - { object: 'Nebula', targets: [{ name: 'Orion Nebula', type: 'emission' }, { name: 'Crab Nebula', type: 'supernova' }, { name: 'Eagle Nebula', type: 'emission' }] } + { object: 'Galaxy' }, + { object: 'Star Cluster' }, + { object: 'Supernova' }, + { object: 'Nebula' } ] }, { @@ -30,33 +32,37 @@ const categories = ref([ ]) const beginner = ref() - +const dateRange = ref() const objectSelection = ref('') const objectSelected = ref(false) - const targetSelection = ref('') const targetSelected = ref(false) - const exposureSettings = reactive([]) const addingNewSettings = ref(false) +const loading = ref(false) +const selectedTargets = ref([]) const handleObjectSelection = (option) => { - if (option) { - objectSelection.value = option - objectSelected.value = true - if (!option.targets) { - targetSelected.value = true - targetSelection.value = option - } else { - targetSelected.value = false - targetSelection.value = null - } - } else { - objectSelection.value = null - objectSelected.value = false - targetSelected.value = false - targetSelection.value = null + objectSelection.value = option + objectSelected.value = true + + // Find the correct regex for the selected object from objectCategories + const categoryRegex = objectCategories.find(cat => cat.label === option.object)?.value + + if (!categoryRegex) { + return } + + // Filter targets using the appropriate regex + const filteredTargets = selectedTargets.value.filter( + target => target.avmdesc.match(categoryRegex) + ).slice(0, 3) // Only show the top 3 + + // Populate the targets for the selected object + objectSelection.value.targets = filteredTargets.map(target => ({ + name: target.name, + desc: target.desc + })) } const handleTargetSelection = (target) => { @@ -94,41 +100,120 @@ const scheduleObservation = () => { } } +// List of avmdesc categories that the user can select +const objectCategories = [ + { label: 'Star Cluster', value: /cluster|Cluster of Stars/i }, + { label: 'Supernova', value: /supernov/i }, + { label: 'Galaxy', value: /galax/i }, + { label: 'Nebula', value: /nebul/i } +] + +const saveTargets = (response) => { + const allTargets = response.targets + const filteredTargetsByCategory = {} + + objectCategories.forEach((category) => { + const filteredTargets = allTargets + .filter(target => target.avmdesc.match(category.value)) + .slice(0, 3) + + if (filteredTargets.length) { + filteredTargetsByCategory[category.label] = filteredTargets + } + }) + + selectedTargets.value = response.targets + const deepSpaceCategory = categories.value.find(category => category.location === 'Deep Space') + + if (deepSpaceCategory) { + deepSpaceCategory.options = Object.keys(filteredTargetsByCategory).map((label) => { + return { + object: label, + targets: filteredTargetsByCategory[label].map(target => ({ + name: target.name, + ra: target.ra, + dec: target.dec, + desc: target.desc, + filters: target.filters + })) + } + }) + } + + loading.value = false +} + +const fetchTargets = async (startDate, endDate) => { + loading.value = true + await fetchApiCall({ + url: `https://whatsup.lco.global/range/?start=${startDate}T22:00:00&end=${endDate}T22:00:00&aperture=0m4&mode=full`, + method: 'GET', + successCallback: saveTargets, + failCallback: (error) => { + console.error('Error fetching targets:', error) + } + }) +} + +const handleDateRangeUpdate = (newDateRange) => { + dateRange.value = newDateRange + const startDate = newDateRange[0].toISOString().split('T')[0] + const endDate = newDateRange[1].toISOString().split('T')[0] + fetchTargets(startDate, endDate) +} + +const resetSelections = () => { + objectSelection.value = '' + objectSelected.value = false + targetSelection.value = '' + targetSelected.value = false +} + + + diff --git a/src/components/Scheduling/Calendar.vue b/src/components/Scheduling/Calendar.vue new file mode 100644 index 0000000..1f4b2db --- /dev/null +++ b/src/components/Scheduling/Calendar.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/src/components/Views/SchedulingView.vue b/src/components/Views/SchedulingView.vue index ac6c90a..640972b 100644 --- a/src/components/Views/SchedulingView.vue +++ b/src/components/Views/SchedulingView.vue @@ -7,37 +7,39 @@ import ScheduledObservations from '../Scheduling/ScheduledObservations.vue' // TO DO (near future): Save this value in the store // TO DO (future): Get level depending on course completion const level = ref('') - const showScheduled = ref(false) From cfb90e4f79c9c7e0e1001b2b6124e8a7f84e45a6 Mon Sep 17 00:00:00 2001 From: Carolina Capetillo Date: Mon, 30 Sep 2024 15:16:52 -0700 Subject: [PATCH 03/29] adds recommended filters --- .../Scheduling/BeginnerScheduling.vue | 114 ++++++++++-------- 1 file changed, 66 insertions(+), 48 deletions(-) diff --git a/src/components/Scheduling/BeginnerScheduling.vue b/src/components/Scheduling/BeginnerScheduling.vue index 634eb97..463895a 100644 --- a/src/components/Scheduling/BeginnerScheduling.vue +++ b/src/components/Scheduling/BeginnerScheduling.vue @@ -7,7 +7,6 @@ import { fetchApiCall } from '../../utils/api.js' const emits = defineEmits(['scheduled']) -// TO DO: Save selections to store const categories = ref([ { location: 'Deep Space', @@ -46,28 +45,36 @@ const handleObjectSelection = (option) => { objectSelection.value = option objectSelected.value = true - // Find the correct regex for the selected object from objectCategories const categoryRegex = objectCategories.find(cat => cat.label === option.object)?.value if (!categoryRegex) { return } - // Filter targets using the appropriate regex const filteredTargets = selectedTargets.value.filter( target => target.avmdesc.match(categoryRegex) - ).slice(0, 3) // Only show the top 3 + ).slice(0, 3) // Populate the targets for the selected object objectSelection.value.targets = filteredTargets.map(target => ({ name: target.name, - desc: target.desc + desc: target.desc, + filters: target.filters })) } const handleTargetSelection = (target) => { targetSelection.value = target targetSelected.value = true + exposureSettings.splice(0) + target.filters.forEach(filter => { + exposureSettings.push({ + filter: filter.name, + exposureTime: filter.exposure, + saved: true, + editing: false + }) + }) } const addSettings = (newSettings) => { @@ -214,50 +221,61 @@ const resetSelections = () => {
-
-

Scheduling observation of a {{ objectSelection.object }} - {{ targetSelection.name }}

-

How do you want to set up your observation?

-
-

- -

-

- -

-
- +
+

+ Scheduling observation of + a + {{ objectSelection.object }} + - {{ targetSelection.name }} + +

+

How do you want to set up your observation?

+
+

+ +

+

+ +

+
+ +
+
+

Photon Ranch will schedule this for you

+
+
+ + + + + Any 0.35m telescope + +

+ + + + + As soon as possible +
-
-

Photon Ranch will schedule this for you

-
-
- - - - - Any 0.35m telescope - -

- - - - - As soon as possible - -
-
- - - - - -
  • 3 color image
  • 120s
  • 1 x 1 mosaic
  • 100% zoom level
-
-
-
-
- -
+
+ + + + + +
    +
  • {{ exposureSettings.length }} color images
  • +
  • + {{ setting.exposureTime }}s with {{ setting.filter }} filter +
  • +
+
+
+
+
+ +
From 78eac9fcd1dfe5f720097b439e59141454ebff78 Mon Sep 17 00:00:00 2001 From: Carolina Capetillo Date: Tue, 1 Oct 2024 13:39:43 -0700 Subject: [PATCH 04/29] sends post request to requestgroups --- .../Scheduling/BeginnerScheduling.vue | 193 +++++++++++++----- 1 file changed, 146 insertions(+), 47 deletions(-) diff --git a/src/components/Scheduling/BeginnerScheduling.vue b/src/components/Scheduling/BeginnerScheduling.vue index 463895a..626fcd1 100644 --- a/src/components/Scheduling/BeginnerScheduling.vue +++ b/src/components/Scheduling/BeginnerScheduling.vue @@ -1,11 +1,27 @@