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
11 changes: 7 additions & 4 deletions web-client/src/components/SrAdvOptAccordion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ 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.
// Source: ICESat-2 ATL06 / ATL08 product specifications. atl06sp is the parallel
// ATL06 subsetter — same source segments as atl06x.
const fixedExtentsByAPI: Record<string, { len: number; res: number }> = {
atl06sp: { len: 40, res: 20 },
atl06x: { len: 40, res: 20 },
atl08x: { len: 100, res: 100 }
}
Expand All @@ -56,11 +58,12 @@ const fixedExtentsTooltip = computed(() => {
})

// 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.
// selected endpoint actually consumes them. Subsetter endpoints (atl06sp, atl06x,
// atl08x, atl24x, atl13x) 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)
['atl06p', 'atl03x-surface'].includes(props.iceSat2SelectedAPI)
)
const showPhoRealPanel = computed(() =>
['atl08p', 'atl03x-phoreal'].includes(props.iceSat2SelectedAPI)
Expand Down
5 changes: 2 additions & 3 deletions web-client/src/types/SrStaticOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,14 @@ export const iceSat2APIsItems = [
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.
// Subsetter endpoints (atl06sp, 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 = [
Expand Down
46 changes: 25 additions & 21 deletions web-client/tests/unit/endpointParamScoping.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
/**
* Unit tests for endpoint parameter scoping (Issue #1074)
*
* Verifies that X-series endpoints (atl06x, atl08x, atl24x, atl13x) do not
* include photon-processing parameters in their requests, since they read
* pre-computed segments from HDF5 files and the server ignores these params.
* Verifies that subsetter endpoints (atl06sp, atl06x, atl08x, atl24x, atl13x)
* do not include photon-processing parameters in their requests, since they
* read pre-computed segments from HDF5 files and the server ignores these
* params. atl06sp uses the same minimal Atl06Parameters class as atl06x —
* both call the atl06s subsetter under the hood.
*
* P-series endpoints (atl06p, atl03x, etc.) compute from ATL03 photons and
* should include these parameters when enabled.
* Photon-processing endpoints (atl06p, atl03x, atl08p, etc.) compute from
* ATL03 photons and should include these parameters when enabled.
*/

import { describe, it, expect, beforeEach } from 'vitest'
Expand Down Expand Up @@ -60,10 +62,10 @@ describe('Endpoint Parameter Scoping', () => {
'cnt'
]

describe('X-series endpoints should exclude photon-processing params', () => {
const xSeriesAPIs = ['atl06x', 'atl08x', 'atl24x', 'atl13x']
describe('Subsetter endpoints should exclude photon-processing params', () => {
const subsetterAPIs = ['atl06sp', 'atl06x', 'atl08x', 'atl24x', 'atl13x']

xSeriesAPIs.forEach((api) => {
subsetterAPIs.forEach((api) => {
it(`${api} request should not include photon-processing parameters`, () => {
enableAllPhotonParams()
store.iceSat2SelectedAPI = api
Expand Down Expand Up @@ -151,6 +153,16 @@ describe('Endpoint Parameter Scoping', () => {

expect(req).toHaveProperty('atl06_fields', ['h_li_sigma'])
})

it('atl06sp should include atl06_fields and the icesat2-atl06 asset', () => {
store.missionValue = 'ICESat-2'
store.iceSat2SelectedAPI = 'atl06sp'
store.atl06_fields = ['h_li_sigma']
const req = store.getAtlReqParams(1)

expect(req).toHaveProperty('atl06_fields', ['h_li_sigma'])
expect(req).toHaveProperty('asset', 'icesat2-atl06')
})
})

describe('Universal params work for all endpoints', () => {
Expand All @@ -168,24 +180,16 @@ describe('Endpoint Parameter Scoping', () => {
})

describe('photonProcessingAPIs set is correct', () => {
it('should contain all P-series and ATL03-based endpoints', () => {
const expected = [
'atl03x',
'atl03x-surface',
'atl03x-phoreal',
'atl03vp',
'atl06p',
'atl06sp',
'atl08p'
]
it('should contain all endpoints that compute from ATL03 photons', () => {
const expected = ['atl03x', 'atl03x-surface', 'atl03x-phoreal', 'atl03vp', 'atl06p', 'atl08p']
for (const api of expected) {
expect(photonProcessingAPIs.has(api)).toBe(true)
}
})

it('should not contain X-series endpoints', () => {
const xSeries = ['atl06x', 'atl08x', 'atl24x', 'atl13x']
for (const api of xSeries) {
it('should not contain subsetter endpoints', () => {
const subsetters = ['atl06sp', 'atl06x', 'atl08x', 'atl24x', 'atl13x']
for (const api of subsetters) {
expect(photonProcessingAPIs.has(api)).toBe(false)
}
})
Expand Down
Loading