Skip to content
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
109 changes: 88 additions & 21 deletions web-client/src/components/SrAdvOptAccordion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import Accordion from 'primevue/accordion'
import AccordionPanel from 'primevue/accordionpanel'
import AccordionHeader from 'primevue/accordionheader'
import AccordionContent from 'primevue/accordioncontent'
import { defineAsyncComponent, ref } from 'vue'
import { defineAsyncComponent, ref, computed } from 'vue'
import { useReqParamsStore } from '@/stores/reqParamsStore'
import { computed } from 'vue'
import { photonProcessingAPIs } from '@/types/SrStaticOptions'

/* eslint-disable @typescript-eslint/promise-function-async */
const SrYAPC = defineAsyncComponent(() => import('@/components/SrYAPC.vue'))
Expand Down Expand Up @@ -39,6 +39,33 @@ const reqParamsStore = useReqParamsStore()
const props = defineProps<Props>()
const expandedPanels = ref<number[]>([])

const isPhotonProcessingAPI = computed(() => photonProcessingAPIs.has(props.iceSat2SelectedAPI))

// Fixed segment dimensions baked into pre-computed ATL06/ATL08 data products.
// Source: ICESat-2 ATL06 / ATL08 product specifications.
const fixedExtentsByAPI: Record<string, { len: number; res: number }> = {
atl06x: { len: 40, res: 20 },
atl08x: { len: 100, res: 100 }
}

const fixedExtents = computed(() => fixedExtentsByAPI[props.iceSat2SelectedAPI] ?? null)

const fixedExtentsTooltip = computed(() => {
const api = props.iceSat2SelectedAPI
return `Segment dimensions are fixed in the ${api} data product and cannot be modified.`
})

// Panels that show parameters used at request time are visible when the
// selected endpoint actually consumes them. X-series endpoints read pre-computed
// segments from the source HDF5 product so most photon-processing panels are hidden.
const showExtentsPanel = computed(() => isPhotonProcessingAPI.value || fixedExtents.value !== null)
const showSurfaceElevationPanel = computed(() =>
['atl06p', 'atl06sp', 'atl03x-surface'].includes(props.iceSat2SelectedAPI)
)
const showPhoRealPanel = computed(() =>
['atl08p', 'atl03x-phoreal'].includes(props.iceSat2SelectedAPI)
)

const onPanelOpen = (value: any) => {
//console.log('onPanelOpen', value, "type: ", typeof value);
expandedPanels.value.push(value.index)
Expand Down Expand Up @@ -86,41 +113,45 @@ const fieldsHeader = computed(() => {
<SrGranuleSelection />
</AccordionContent>
</AccordionPanel>
<AccordionPanel value="3" v-if="mission === 'ICESat-2'">
<AccordionPanel value="3" v-if="mission === 'ICESat-2' && isPhotonProcessingAPI">
<AccordionHeader>Photon Selection</AccordionHeader>
<AccordionContent v-if="isExpanded(3)">
<SrAtl03Classification />
<SrAtl08Cnf />
<SrYAPC />
</AccordionContent>
</AccordionPanel>
<AccordionPanel value="4" v-if="mission === 'ICESat-2'">
<AccordionPanel value="4" v-if="mission === 'ICESat-2' && showExtentsPanel">
<AccordionHeader>Extents</AccordionHeader>
<AccordionContent v-if="isExpanded(4)">
<SrExtents />
<SrExtents v-if="isPhotonProcessingAPI" />
<div
v-else-if="fixedExtents"
class="sr-fixed-extents"
v-tooltip.top="fixedExtentsTooltip"
>
<div class="sr-fixed-extents-header">
<i class="pi pi-lock"></i>
<span>Fixed in {{ iceSat2SelectedAPI }} data product</span>
</div>
<div class="sr-fixed-extents-row">
<span class="sr-fixed-extents-label">Length</span>
<span class="sr-fixed-extents-value">{{ fixedExtents.len }} m</span>
</div>
<div class="sr-fixed-extents-row">
<span class="sr-fixed-extents-label">Step Size</span>
<span class="sr-fixed-extents-value">{{ fixedExtents.res }} m</span>
</div>
</div>
</AccordionContent>
</AccordionPanel>
<AccordionPanel
value="5"
v-if="
mission === 'ICESat-2' &&
(props.iceSat2SelectedAPI.includes('atl06') ||
props.iceSat2SelectedAPI.includes('atl03x-surface'))
"
>
<AccordionPanel value="5" v-if="mission === 'ICESat-2' && showSurfaceElevationPanel">
<AccordionHeader>Surface Elevation</AccordionHeader>
<AccordionContent v-if="isExpanded(5)">
<SrSurfaceElevation />
</AccordionContent>
</AccordionPanel>
<AccordionPanel
value="6"
v-if="
mission === 'ICESat-2' &&
(props.iceSat2SelectedAPI.includes('atl08') ||
props.iceSat2SelectedAPI.includes('atl03x-phoreal'))
"
>
<AccordionPanel value="6" v-if="mission === 'ICESat-2' && showPhoRealPanel">
<AccordionHeader>PhoREAL Veg Density Alg</AccordionHeader>
<AccordionContent v-if="isExpanded(6)">
<SrVegDensity />
Expand Down Expand Up @@ -331,4 +362,40 @@ const fieldsHeader = computed(() => {
justify-content: center;
margin-bottom: 0.5rem;
}

.sr-fixed-extents {
display: flex;
flex-direction: column;
gap: 0.5rem;
padding: 0.75rem;
border: 1px solid var(--p-surface-300);
border-radius: var(--p-border-radius);
cursor: help;
}

.sr-fixed-extents-header {
display: flex;
align-items: center;
gap: 0.5rem;
font-size: small;
color: var(--p-text-muted-color);
margin-bottom: 0.25rem;
}

.sr-fixed-extents-row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.25rem 0.5rem;
opacity: 0.7;
}

.sr-fixed-extents-label {
font-size: large;
}

.sr-fixed-extents-value {
font-family: monospace;
font-size: large;
}
</style>
35 changes: 20 additions & 15 deletions web-client/src/stores/reqParamsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ import {
OnOffOptions,
geoLocationOptions,
signalConfidenceNumberOptions,
qualityPHOptions
qualityPHOptions,
photonProcessingAPIs
} from '@/types/SrStaticOptions'

export function getDefaultReqParamsState(): SrReqParamsState {
Expand Down Expand Up @@ -490,6 +491,8 @@ const createReqParamsStore = (id: string) =>
getAtlReqParams(req_id: number): AtlReqParams {
//console.log('getAtlReqParams req_id:', req_id);
const req: AtlReqParams = {}
const isPhotonAPI =
this.missionValue === 'ICESat-2' && photonProcessingAPIs.has(this.iceSat2SelectedAPI)
if (this.missionValue === 'ICESat-2') {
if (!this.iceSat2SelectedAPI.includes('x')) {
// atlnnx does not need asset set
Expand Down Expand Up @@ -561,7 +564,7 @@ const createReqParamsStore = (id: string) =>
req.atl24.anc_fields = this.atl24AncillaryFields
}
} else {
if (this.missionValue === 'ICESat-2') {
if (isPhotonAPI) {
if (this.enableAtl03Classification) {
if (
this.surfaceReferenceType.length === 1 &&
Expand Down Expand Up @@ -625,7 +628,7 @@ const createReqParamsStore = (id: string) =>
}
}

if (this.missionValue === 'ICESat-2') {
if (isPhotonAPI) {
if (this.getUseSurfaceFitAlgorithm()) {
req.fit = {} as SrSurfaceFit
if (this.getUseMaxIterations()) {
Expand Down Expand Up @@ -707,14 +710,16 @@ const createReqParamsStore = (id: string) =>
}
}
}
if (this.passInvalid) {
req.pass_invalid = true
} else {
if (this.getUseAlongTrackSpread()) {
req.ats = this.alongTrackSpread
}
if (this.getUseMinimumPhotonCount()) {
req.cnt = this.minimumPhotonCount
if (isPhotonAPI) {
if (this.passInvalid) {
req.pass_invalid = true
} else {
if (this.getUseAlongTrackSpread()) {
req.ats = this.alongTrackSpread
}
if (this.getUseMinimumPhotonCount()) {
req.cnt = this.minimumPhotonCount
}
}
}

Expand Down Expand Up @@ -769,20 +774,20 @@ const createReqParamsStore = (id: string) =>
// ATL03 classification settings would go here
}

if (this.enableAtl08Classification) {
if (isPhotonAPI && this.enableAtl08Classification) {
if (this.atl08LandType.length > 0) {
req.atl08_class = this.atl08LandType
}
}

if (this.enableAtl24Classification) {
if (isPhotonAPI && this.enableAtl24Classification) {
if (!req.atl24) req.atl24 = {}
if (this.atl24_class_ph.length > 0) {
req.atl24.class_ph = this.atl24_class_ph
}
}

if (this.enableYAPC) {
if (isPhotonAPI && this.enableYAPC) {
let yapc = {} as Icesat2ConfigYapc
yapc.version = this.getYAPCVersion()
yapc.score = this.YAPCScore
Expand All @@ -798,7 +803,7 @@ const createReqParamsStore = (id: string) =>
req.yapc = yapc
//console.log('using req.yapc:',req.yapc)
}
if (this.distanceIn.value === 'segments') {
if (isPhotonAPI && this.distanceIn.value === 'segments') {
req.dist_in_seg = true
}
if (this.useServerTimeout) {
Expand Down
13 changes: 13 additions & 0 deletions web-client/src/types/SrStaticOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ export const iceSat2APIsItems = [
'atl13x'
]
export const gediAPIsItems = ['gedi01bp', 'gedi02ap', 'gedi04ap']
// ICESat-2 endpoints that compute segments from ATL03 photons and accept
// photon-processing parameters (cnf, srt, yapc, len, res, fit, etc.).
// X-series endpoints (atl06x, atl08x, atl24x, atl13x) read pre-computed
// segments from HDF5 files and ignore these parameters.
export const photonProcessingAPIs: ReadonlySet<string> = new Set([
'atl03x',
'atl03x-surface',
'atl03x-phoreal',
'atl03vp',
'atl06p',
'atl06sp',
'atl08p'
])
export const surfaceReferenceTypeOptions = [
{ name: 'Dynamic', value: -1 },
{ name: 'Land', value: 0 },
Expand Down
Loading
Loading