Skip to content

Commit

Permalink
Merge pull request #1807 from asfadmin/opera-deployment
Browse files Browse the repository at this point in the history
Opera-S1 Dataset (WIP)
  • Loading branch information
SpicyGarlicAlbacoreRoll authored Oct 16, 2023
2 parents 0725550 + 74dd6bc commit 385d3a1
Show file tree
Hide file tree
Showing 55 changed files with 692 additions and 119 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class BaselineChartComponent implements OnInit, OnDestroy {

ngOnInit(): void {
this.createSVG();
const products$ = this.scenesService.scenes$().pipe(
const products$ = this.scenesService.scenes$.pipe(
tap(products => products.map(
product => this.criticalBaseline = criticalBaselineFor(product)
)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,20 @@
<app-burst-selector></app-burst-selector>
</div>
</mat-expansion-panel>

<mat-expansion-panel
*ngIf="selectedDataset === 'OPERA-S1'"
[expanded]="defaultPanelOpenState" [disabled]="panelIsDisabled" class="raised-section"
(click)="selectPanel(panels.CAMPAIGN)"
[class.raised-section]="isSelected(panels.CAMPAIGN)">
<mat-expansion-panel-header [collapsedHeight]="customCollapsedHeight" [expandedHeight]="customExpandedHeight">
<mat-panel-title>
<!-- {{ 'SLC_BURST_FILTERS' | translate }} -->
OPERA S1 Filters
</mat-panel-title>
</mat-expansion-panel-header>
<div class="selector-card-spacing">
<app-opera-s1-selector></app-opera-s1-selector>
</div>
</mat-expansion-panel>
</mat-accordion>
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { DatasetSelectorModule } from '@components/shared/selectors/dataset-sele
import { AoiOptionsModule } from '@components/shared/aoi-options';
import { DocsModalModule } from '@components/shared/docs-modal';
import { BurstSelectorModule } from '@components/shared/selectors/burst-selector';
import { OperaS1SelectorModule } from '@components/shared/selectors/opera-s1-selector';
// import { TranslateModule } from "@ngx-translate/core";
import { SharedModule } from "@shared";

Expand All @@ -42,6 +43,7 @@ import { SharedModule } from "@shared";
AoiOptionsModule,
SearchTypeSelectorModule,
BurstSelectorModule,
OperaS1SelectorModule,
SharedModule,
// TranslateModule
],
Expand Down
10 changes: 10 additions & 0 deletions src/app/components/header/info-bar/info-bar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@
<b>{{'FULL_BURST_ID' | translate}}:</b> {{fullBurstIDs.length <= 4 ? fullBurstIDs.join(', ') : fullBurstIDs.length + ' IDs'}}
</span>
</span>
<span>
<span *ngIf="operaBurstIDs?.length > 0">
<b>{{'OPERA_BURST_ID' | translate}}:</b> {{operaBurstIDs.length <= 4 ? operaBurstIDs.join(', ') : operaBurstIDs.length + ' IDs'}}
</span>
</span>
<span>
<span *ngIf="!!groupID">
<b>Group ID:</b> {{groupID}}
</span>
</span>
</div>
<div class="last-info">
<app-ci-search></app-ci-search>
Expand Down
14 changes: 13 additions & 1 deletion src/app/components/header/info-bar/info-bar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export class InfoBarComponent implements OnInit, OnDestroy {
public perpRange: models.Range<number | null>;
public tempRange: models.Range<number | null>;
public fullBurstIDs: string[] = [];
public operaBurstIDs: string[] = [];
public groupID: string;

private subs = new SubSink();

Expand Down Expand Up @@ -126,6 +128,14 @@ export class InfoBarComponent implements OnInit, OnDestroy {
burstIDs => this.fullBurstIDs = burstIDs
);

const operaBurstIDSub = this.store$.select(filtersStore.getOperaBurstIDs).subscribe(
burstIDs => this.operaBurstIDs = burstIDs
);

const groupIDSub = this.store$.select(filtersStore.getGroupID).subscribe(
groupID => this.groupID = groupID
);

[
startSub, endSub,
pathSub, frameSub,
Expand All @@ -140,7 +150,9 @@ export class InfoBarComponent implements OnInit, OnDestroy {
missionSub,
tempSub, perpSub,
eventProductType,
fullBurstIDSub
fullBurstIDSub,
operaBurstIDSub,
groupIDSub
].forEach(sub => this.subs.add(sub));

this.subs.add(
Expand Down
6 changes: 4 additions & 2 deletions src/app/components/header/queue/queue.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ <h1>
</ng-container>
</b>
<span>
<span *ngIf="product.bytes === 0">Virtual</span>
<span *ngIf="product.bytes === 0 && !product.id.startsWith('OPERA')">Virtual</span>
<span *ngIf="product.bytes !== 0">{{product.bytes | readableSizeFromBytes }}</span>
</span>
</div>
Expand All @@ -89,7 +89,9 @@ <h1>
*ngIf="!product.isUnzippedFile && !product.metadata.job && product.groupId !== 'SARViews'"
style="margin-right: 15px;"
prompt="{{ 'COPY_FILE_ID' | translate}}"
[value]="product.metadata.productType === 'BURST_XML' ? product.id?.split('-XML')[0] : product.id"
[value]="product.metadata.productType === 'BURST_XML' ? product.id?.split('-XML')[0] : (
product.metadata.parentID || product.id
)"
>
</app-copy-to-clipboard>

Expand Down
2 changes: 1 addition & 1 deletion src/app/components/header/queue/queue.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export class QueueComponent implements OnInit, OnDestroy {
if (product.metadata.productType === 'BURST_XML') {
return product.id?.split('-XML')[0]
}
return product.id;
return product.metadata.parentID || product.id;
})
.join('\n');
this.clipboardService.copyFromContent(productListStr);
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/map/map.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ export class MapComponent implements OnInit, OnDestroy {
}

private scenesToFeatures(projection: string): Observable<Feature<Geometry>[]> {
return this.scenesService.scenes$().pipe(
return this.scenesService.scenes$.pipe(
map(scenes => scenes.filter(scene => scene.id !== this.selectedScene?.id)),
map(scenes => this.scenesToFeature(scenes, projection)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ enum CardViews {
export class BaselineResultsMenuComponent implements OnInit, OnDestroy {
@Input() resize$: Observable<void>;

public numBaselineScenes$ = this.scenesService.scenes$().pipe(
public numBaselineScenes$ = this.scenesService.scenes$.pipe(
map(scenes => scenes.length),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class DesktopResultsMenuComponent implements OnInit, OnDestroy {
)
);
this.subs.add(
this.scenesService.scenes$().subscribe(
this.scenesService.scenes$.subscribe(
scenes => this.scenesLength = scenes.length
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class BrowseListComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChild(CdkVirtualScrollViewport) scroll: CdkVirtualScrollViewport;

public scenesSorted$ = this.scenesService.sortScenes$(
this.scenesService.scenes$()
this.scenesService.scenes$
);
public scenes$: Observable<models.CMRProduct[]>;
private scene: models.CMRProduct;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,12 +323,14 @@
<div
[matTooltip]="
searchType === searchTypes.SARVIEWS_EVENTS ? ( 'GEOGRAPHIC_SEARCH_BASED_ON_EVENT_POLYGON' | translate ) :
(
dataset?.id === 'OPERA-S1' ? ('OPERA_S1_SOURCE_DATA' | translate) :
(dataset?.id === 'SENTINEL-1 BURSTS' ? ('GEOGRAPHIC_SEARCH_BASED_ON_BURST' | translate) :
!(
!(prop.isRelevant(p.PATH, dataset) &&
prop.isRelevant(p.FRAME, dataset)) ||
dataset?.id === 'UAVSAR'
) ? ('GEOGRAPHIC_SEARCH_BASED_ON_THIS_SCENE_S_PATH_FRAME' | translate) : ( 'NOT_ABLE_TO_SELECT_SIMILAR_SCENES_FROM_THIS_SOURCE' | translate))">
) ? ('GEOGRAPHIC_SEARCH_BASED_ON_THIS_SCENE_S_PATH_FRAME' | translate) : ( 'NOT_ABLE_TO_SELECT_SIMILAR_SCENES_FROM_THIS_SOURCE' | translate)))">

<button
mat-stroked-button
Expand All @@ -338,15 +340,26 @@
(prop.isRelevant(p.PATH, dataset) &&
prop.isRelevant(p.FRAME, dataset)) ||
dataset?.id === 'UAVSAR'||
dataset?.id === 'SENTINEL-1 BURSTS'
dataset?.id === 'SENTINEL-1 BURSTS' ||
dataset?.id === 'OPERA-S1'
)
"
(click)="moreLikeThis()"
class="mini-toggle-button search-button">
<span *ngIf="breakpoint === breakpoints.MOBILE">{{ 'MORE' | translate }}</span>
<span *ngIf="breakpoint != breakpoints.MOBILE">{{searchType !== searchTypes.SARVIEWS_EVENTS ? ('MORE_LIKE_THIS' | translate ) : ('GEOGRAPHIC' | translate )}}</span>

<span *ngIf="breakpoint != breakpoints.MOBILE">{{searchType !== searchTypes.SARVIEWS_EVENTS ? dataset?.id === 'OPERA-S1' ? ('SOURCE_DATA' | translate) : ('MORE_LIKE_THIS' | translate ) : ('GEOGRAPHIC' | translate )}}</span>
</button>

<!-- <button *ngIf="dataset?.id === 'OPERA-S1'"
mat-stroked-button
color="primary"
[disabled]="!(dataset?.id === 'OPERA-S1' && (scene.metadata.productType === 'RTC' || scene.metadata.productType === 'CSLC'))"
(click)="staticLayer()"
class="mini-toggle-button search-button">
<span *ngIf="breakpoint === breakpoints.MOBILE">{{ 'Static' }}</span>
<span *ngIf="breakpoint != breakpoints.MOBILE">{{'STATIC_LAYER' | translate}}</span>
</button> -->
</div>
<div *ngIf="searchType === searchTypes.SARVIEWS_EVENTS"
matTooltip="{{ 'USE_THIS_EVENT_S_PRODUCT_SCENES_IN_LIST_SEARCH' | translate }}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ export class SceneDetailComponent implements OnInit, OnDestroy {
this.makeSarviewsEventGeoSearch();
} else {
const scene = this.scene;
const shouldClear = this.searchType !== models.SearchType.DATASET;
const shouldClear = this.searchType !== models.SearchType.DATASET || this.dataset.id === 'OPERA-S1';
const dateRange = this.dateRange;

this.store$.dispatch(new searchStore.SetSearchType(models.SearchType.DATASET));
Expand All @@ -382,6 +382,17 @@ export class SceneDetailComponent implements OnInit, OnDestroy {
}
}

public staticLayer(){
const operaBurstID = this.scene.metadata.opera.operaBurstID;
const sensorDate = new Date(this.scene.metadata.date.toDate());
const staticType = this.scene.metadata.productType + '-STATIC'
this.store$.dispatch(new searchStore.ClearSearch());
this.store$.dispatch(new filtersStore.SetSelectedDataset('OPERA-S1'))
this.store$.dispatch(new filtersStore.setOperaBurstID([operaBurstID]));
this.store$.dispatch(new filtersStore.SetProductTypes([models.opera_s1.productTypes.find(t => t.apiValue === staticType)]));
this.store$.dispatch(new filtersStore.SetEndDate(sensorDate));
this.store$.dispatch(new searchStore.MakeSearch());
}
public makeBaselineSearch(): void {
const sceneName = this.baselineSceneName();
const dateRange = this.dateRange;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@

<a *ngIf="isHovered && !product.metadata.job" class="icon-margin">
<app-copy-to-clipboard
[value]="product.metadata.productType === 'BURST_XML' ? product.id?.split('-XML')[0] : product.id"
[value]="product.metadata.productType === 'BURST_XML' ? product.id?.split('-XML')[0] : (
product.metadata.parentID || product.id
)"
prompt="{{ 'COPY_FILE_ID' | translate }}">
</app-copy-to-clipboard>
</a>
Expand All @@ -85,7 +87,7 @@
</button>

<div mat-line class="file-sub-line">
<span *ngIf="product.bytes === 0">{{ 'VIRTUAL' | translate }}</span>
<span *ngIf="product.bytes === 0 && !product?.id?.startsWith('OPERA')">{{ 'VIRTUAL' | translate }}</span>
<span *ngIf="isDownloadable(product) && product.bytes !== 0">{{product.bytes.toString() | readableSizeFromBytes }}</span>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
</div>

<div *ngIf="!showUnzippedProductScreen">
<mat-list class="products-list" *ngFor="let product of products">
<app-scene-file
<mat-list class="products-list" >
<app-scene-file *ngFor="let product of products"
(toggle)="onToggleQueueProduct(product)"
(unzip)="onOpenUnzipProduct($event)"
(queueHyp3Job)="onQueueHyp3Job($event)"
Expand All @@ -25,6 +25,20 @@
[isOpen]="false"
>
</app-scene-file>
<app-scene-file *ngFor="let product of (StaticLayerProduct$ | async)"
(toggle)="onToggleQueueProduct(product)"
(unzip)="onOpenUnzipProduct($event)"
(queueHyp3Job)="onQueueHyp3Job($event)"
[loadingHyp3JobName]="loadingHyp3JobName"
[isUserLoggedIn]="isUserLoggedIn"
[product]="product"
[validHyp3JobTypes]="[]"
[hasAccessToRestrictedData]="hasAccessToRestrictedData"
[isUnzipLoading]="unzippedLoading === product.id"
[isQueued]="(queuedProductIds$ | async).has(product.id)"
[isOpen]="false"
>
</app-scene-file>
</mat-list>
</div>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {Component, OnInit, OnDestroy, AfterContentInit, Input, ViewChild} from '@angular/core';
import { SubSink } from 'subsink';

import { combineLatest } from 'rxjs';
import { debounceTime, filter, map, take, withLatestFrom } from 'rxjs/operators';
import { combineLatest, of } from 'rxjs';
import { debounceTime, distinctUntilChanged, filter, map, switchMap, take, withLatestFrom } from 'rxjs/operators';

import { Store } from '@ngrx/store';
import { AppState } from '@store';
Expand All @@ -12,7 +12,7 @@ import * as userStore from '@store/user';
import * as hyp3Store from '@store/hyp3';
import * as uiStore from '@store/ui';

import { Hyp3Service, NotificationService, SarviewsEventsService } from '@services';
import { AsfApiService, Hyp3Service, NotificationService, ProductService, SarviewsEventsService } from '@services';
import * as models from '@models';
import { CMRProductMetadata, hyp3JobTypes, SarviewProductGranule, SarviewsProduct } from '@models';
import { ClipboardService } from 'ngx-clipboard';
Expand Down Expand Up @@ -111,16 +111,19 @@ export class SceneFilesComponent implements OnInit, OnDestroy, AfterContentInit
private eventMonitoringService: SarviewsEventsService,
public dialog: MatDialog,
private screenSize: ScreenSizeService,
private asfApiService: AsfApiService,
private productService: ProductService
) { }

ngOnInit() {
this.subs.add(
combineLatest([
this.store$.select(scenesStore.getSelectedSceneProducts),
this.store$.select(scenesStore.getOpenUnzippedProduct),
this.store$.select(scenesStore.getUnzippedProducts)]
).pipe(debounceTime(0))
.subscribe(
this.store$.select(scenesStore.getUnzippedProducts),
]
).pipe(debounceTime(0)
).subscribe(
([products, unzipped, unzippedFiles]) => {
this.unzippedProducts = unzippedFiles;
this.products = products;
Expand Down Expand Up @@ -417,6 +420,40 @@ export class SceneFilesComponent implements OnInit, OnDestroy, AfterContentInit
};
return toCMRProduct;
}

public StaticLayerProduct$ = this.store$.select(scenesStore.getSelectedScene).pipe(
debounceTime(100),
distinctUntilChanged((prev, curr) => prev?.id === curr?.id),
switchMap(scene => {
if(!!scene && ['RTC', 'CSLC'].includes(scene?.metadata?.productType) && scene?.id.startsWith('OPERA')) {
const queryParams = {
processinglevel : scene.metadata.productType + '-STATIC',
start: scene.metadata.stopDate === null ? '' : moment.utc( scene.metadata.stopDate ).format(),
operaburstid: scene.metadata?.opera?.operaBurstID,
collections: models.opera_s1.apiValue.collections,
};
return this.asfApiService.query<any[]>(queryParams).pipe(
map(products => products.length > 0 ? this.productService.fromResponse(products).slice(0, 1) : [])
);
} else {
return of([]);

}
}

)
);

// const queryParams = {
// processinglevel : selectedScene.metadata.productType + '-STATIC',
// start: selectedScene.metadata.stopDate === null ? '' : moment.utc( selectedScene.metadata.stopDate ).format(),
// operaburstid: selectedScene.metadata?.opera?.operaBurstID
// }

// const staticLayer = this.asfApiService.query<any[]>(queryParams).pipe(
// map(products => this.productService.fromResponse(products).slice(0,1))
// );
// }
public getProductSceneCount(products: SarviewsProduct[]) {
const outputList = products.reduce((prev, product) => {
const temp = product.granules.map(granule => granule.granule_name);
Expand Down
Loading

0 comments on commit 385d3a1

Please sign in to comment.