From 82c6fb187d73bbd006eef876135d3626799bb42c Mon Sep 17 00:00:00 2001 From: SpicyGarlicAlbacoreRoll Date: Fri, 23 Jan 2026 15:07:34 -0900 Subject: [PATCH] bug: hack around ancillary/aux products appearing in default nisar search --- .../short-name-selector.component.ts | 60 +++++++++---------- src/app/models/dataset.model.ts | 2 +- src/app/models/datasets/nisar.ts | 40 +++++++++++++ src/app/services/search-params.service.ts | 11 ++++ 4 files changed, 82 insertions(+), 31 deletions(-) diff --git a/src/app/components/shared/selectors/short-name-selector/short-name-selector.component.ts b/src/app/components/shared/selectors/short-name-selector/short-name-selector.component.ts index e04c16ef4..6f6d17103 100644 --- a/src/app/components/shared/selectors/short-name-selector/short-name-selector.component.ts +++ b/src/app/components/shared/selectors/short-name-selector/short-name-selector.component.ts @@ -1,15 +1,15 @@ import { Component, - OnInit, + // OnInit, Output, EventEmitter, OnDestroy, - inject, + // inject, } from '@angular/core'; import * as models from '@models'; -import * as filtersStore from '@store/filters'; -import { Store } from '@ngrx/store'; -import { AppState } from '@store'; +// import * as filtersStore from '@store/filters'; +// import { Store } from '@ngrx/store'; +// import { AppState } from '@store'; import { SubSink } from 'subsink'; import { MatSelectChange, @@ -35,34 +35,34 @@ import { TranslateModule } from '@ngx-translate/core'; TranslateModule, ], }) -export class ShortNameSelectorComponent implements OnInit, OnDestroy { - private store$ = inject>(Store); +export class ShortNameSelectorComponent implements OnDestroy { + // private store$ = inject>(Store); @Output() shortNamesChange = new EventEmitter(); public dataset: models.Dataset; public shortNamesList: string[] = []; public selectableShortNames: models.ShortName[] = []; - private dataset$ = this.store$.select(filtersStore.getSelectedDataset); + // private dataset$ = this.store$.select(filtersStore.getSelectedDataset); private subs = new SubSink(); - ngOnInit(): void { - this.subs.add( - this.dataset$.subscribe((dataset) => { - this.dataset = dataset; - this.selectableShortNames = dataset?.shortNames ?? []; - }), - ); - this.subs.add( - this.store$ - .select(filtersStore.getShortNames) - .subscribe( - (shortNamesList) => - (this.shortNamesList = shortNamesList.map((val) => val.apiValue)), - ), - ); - } + // ngOnInit(): void { + // this.subs.add( + // this.dataset$.subscribe((dataset) => { + // this.dataset = dataset; + // this.selectableShortNames = dataset?.shortNames ?? []; + // }), + // ); + // this.subs.add( + // this.store$ + // .select(filtersStore.getShortNames) + // .subscribe( + // (shortNamesList) => + // (this.shortNamesList = shortNamesList.map((val) => val.apiValue)), + // ), + // ); + // } ngOnDestroy(): void { this.subs.unsubscribe(); @@ -73,11 +73,11 @@ export class ShortNameSelectorComponent implements OnInit, OnDestroy { this.emitShortNames(shortNameAPIValues); } - public emitShortNames(shortNameAPIValues: string[]): void { - const shortNames = this.dataset?.shortNames ?? []; - const output = shortNameAPIValues.map((shortName) => - shortNames.find((datasetType) => datasetType.apiValue === shortName), - ); - this.shortNamesChange.emit(output); + public emitShortNames(_shortNameAPIValues: string[]): void { + // const shortNames = this.dataset?.shortNames ?? []; + // const output = shortNameAPIValues.map((shortName) => + // shortNames.find((datasetType) => datasetType.apiValue === shortName), + // ); + // this.shortNamesChange.emit(output); } } diff --git a/src/app/models/dataset.model.ts b/src/app/models/dataset.model.ts index 0f1281501..4a979eb3f 100644 --- a/src/app/models/dataset.model.ts +++ b/src/app/models/dataset.model.ts @@ -27,7 +27,7 @@ export interface Dataset { calibrationDatasets?: string[]; calibrationProductTypes?: ProductType[]; - shortNames?: ShortName[]; // For NISAR shortnames + shortNames?: string[]; // For NISAR shortnames instruments?: { displayName: string; apiValue: string }[]; bandwidth?: Record; frameMap?: { diff --git a/src/app/models/datasets/nisar.ts b/src/app/models/datasets/nisar.ts index a2e587f2b..45e25b656 100644 --- a/src/app/models/datasets/nisar.ts +++ b/src/app/models/datasets/nisar.ts @@ -180,6 +180,46 @@ export const nisar = { // apiValue: 'SB', // } ], + shortNames: [ + 'NISAR_L0B_RRSD_BETA_V1', + 'NISAR_L0B_RRSD_PROVISIONAL_V1', + 'NISAR_L0B_RRSD_V1', + 'NISAR_L1_RSLC_BETA_V1', + 'NISAR_L1_RSLC_PROVISIONAL_V1', + 'NISAR_L1_RSLC_V1', + 'NISAR_L1_RIFG_BETA_V1', + 'NISAR_L1_RIFG_PROVISIONAL_V1', + 'NISAR_L1_RIFG_V1', + 'NISAR_L1_RUNW_BETA_V1', + 'NISAR_L1_RUNW_PROVISIONAL_V1', + 'NISAR_L1_RUNW_V1', + 'NISAR_L1_ROFF_BETA_V1', + 'NISAR_L1_ROFF_PROVISIONAL_V1', + 'NISAR_L1_ROFF_V1', + 'NISAR_L2_GSLC_BETA_V1', + 'NISAR_L2_GSLC_PROVISIONAL_V1', + 'NISAR_L2_GSLC_V1', + 'NISAR_L2_GCOV_BETA_V1', + 'NISAR_L2_GCOV_PROVISIONAL_V1', + 'NISAR_L2_GCOV_V1', + 'NISAR_L2_GUNW_BETA_V1', + 'NISAR_L2_GUNW_PROVISIONAL_V1', + 'NISAR_L2_GUNW_V1', + 'NISAR_L2_GOFF_BETA_V1', + 'NISAR_L2_GOFF_PROVISIONAL_V1', + 'NISAR_L2_GOFF_V1', + 'NISAR_L3_SME2_BETA_V1', + 'NISAR_L3_SME2_PROVISIONAL_V1', + 'NISAR_L3_SME2_V1', + + // urgent and custom response + 'NISAR_CUSTOM_PROVISIONAL_V1', + 'NISAR_UR_L0B_RRSD', + 'NISAR_UR_L1', + 'NISAR_UR_L2', + // 'NISAR_OE', + // 'NISAR_RP', + ], // shortNames: [ // { // displayName: "NISAR Beta NEN Science Telemetry Data (Version 1)", diff --git a/src/app/services/search-params.service.ts b/src/app/services/search-params.service.ts index 56ce6df8d..7739fd706 100644 --- a/src/app/services/search-params.service.ts +++ b/src/app/services/search-params.service.ts @@ -83,6 +83,16 @@ export class SearchParamsService { // ({dataset: models.opera_s1.calibrationDatasets}) : ({})) // ) + private useNisarShortnames$ = this.store$ + .select(filterStore.getSelectedDatasetId) + .pipe( + map((dataset) => + dataset === models.nisar.id + ? { shortName: models.nisar.shortNames } + : {}, + ), + ); + private groupID$ = this.store$.select(filterStore.getGroupID).pipe( map((groupid) => ({ groupid, @@ -305,6 +315,7 @@ export class SearchParamsService { this.burstParams$, this.operaBurstParams$, // this.operaCalibrationParam$, + this.useNisarShortnames$, this.sciProducts$, this.groupID$, ]).pipe(