File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ export interface NISARMetadata {
104104 sideBandPolarization : string ,
105105 mainBandPolarization : string ,
106106 rangeBandwidth : string ,
107+ sizeMB ?: { [ key : string ] : { bytes : number , format : string } }
107108}
108109
109110export enum FlightDirection {
Original file line number Diff line number Diff line change @@ -40,6 +40,11 @@ export class ProductService {
4040 if ( ! filename . includes ( g . gn ) ) {
4141 filename = `${ g . gn } -${ filename } ` ;
4242 }
43+ if ( g . d === 'NISAR' && g . nsr . sizeMB ) {
44+ // NISAR uses SizeInBytes instead of Size so doesn't populate the right field in the API.
45+ // the new property also auto converts to the right scale already
46+ g . s = ( g . nsr . sizeMB [ filename ] ?. bytes ?? 0 ) / 1000000 ;
47+ }
4348 let product = {
4449 name : g . gn ,
4550 productTypeDisplay : g . ptd ?? g . gn ,
@@ -311,7 +316,7 @@ export class ProductService {
311316 productTypeDisplay : productTypeDisplay || p ,
312317 file : fileID ,
313318 id : product . id + '-' + file_extension ,
314- bytes : 0 ,
319+ bytes : product . metadata . nisar ?. sizeMB ?. [ fileID ] ?. bytes ?? 0 ,
315320 browses,
316321 thumbnail : null ,
317322 metadata : {
@@ -323,7 +328,6 @@ export class ProductService {
323328 } ,
324329 virtual : true ,
325330 } as models . CMRProduct ;
326-
327331 products . push ( subproduct )
328332 }
329333
You can’t perform that action at this time.
0 commit comments