Skip to content

Commit

Permalink
Feature/fix swot alignment (#55)
Browse files Browse the repository at this point in the history
* update ummt sync github action

* update so we run cron at 1 am pst

* update again

* add in global grid from hitide configurations to fix swot 2.0 alignment

* update changelog
  • Loading branch information
sliu008 authored Feb 20, 2024
1 parent 6d372da commit e4e8b54
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]
### Added
- Added global_grid configuration check to make a global extent for images.
### Changed
### Removed
### Fixed
Expand Down
4 changes: 2 additions & 2 deletions src/hitideConfig.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var hitideProfileOrigin = "https://hitide.profile.podaac.uat.earthdatacloud.nasa.gov/hitide/api";

window.hitideConfig = {
paletteService: "https://hitide.podaac.uat.earthdatacloud.nasa.gov/palettes",
paletteService: "https://hitide.podaac.earthdatacloud.nasa.gov/palettes",

cmrDatasetSearchService: hitideProfileOrigin + "/cmr/search/collections.json?tool_name=HiTIDE",
cmrGranuleSearchService: hitideProfileOrigin + "/cmr/search/granules.umm_json",
Expand All @@ -25,4 +25,4 @@ window.hitideConfig = {
maxGranulesPerDownload: 999999999,
googleTagManagerId: "GTM-M5D83V6",
earthDataAppClientId: "dxpH2WeN_f8IpNLgHwplsg"
};
};
30 changes: 25 additions & 5 deletions src/jpl/dijit/LayerControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ define([
"dijit/form/HorizontalRule",
"dijit/form/HorizontalRuleLabels",
"jpl/dijit/ui/AlertDialog",
"jpl/config/Config"
"jpl/config/Config",
"esri/geometry/Extent"
], function(declare, lang, on, domConstruct, domClass, domAttr, domStyle, topic, touch, xhr, array, _WidgetBase,
_TemplatedMixin, template, css, Layers, LayerEvent, MapEvent, MapUtil, AnimationUtil,
HorizontalSlider, HorizontalRule, HorizontalRuleLabels, AlertDialog, Config) {
HorizontalSlider, HorizontalRule, HorizontalRuleLabels, AlertDialog, Config, Extent) {
return declare([_WidgetBase, _TemplatedMixin], {
templateString: template,
widgetsInTemplate: false,
Expand Down Expand Up @@ -256,14 +257,33 @@ define([
var granuleName = obj.granuleObj["Granule-Name"];
var variableName = this.variableId;
var imageFilename = calculateImageFilename(granuleName, variableName);


var relatedUrls = obj.granuleObj.umm.RelatedUrls;
var objectURL
for(var i=0; i < relatedUrls.length; i++){
objectURL = relatedUrls[i]['URL'];
if(objectURL.includes(imageFilename)){
return MapUtil.prototype.createMapImage(objectURL, this.translateExtent(obj.granuleObj["Granule-Extent"]));
var currentExtent = this.translateExtent(obj.granuleObj["Granule-Extent"])

// Calculate the new extent properties based on the offset
var newExtent = new Extent({
xmin: currentExtent.xmin ,
ymin: currentExtent.ymin ,
xmax: currentExtent.xmax ,
ymax: currentExtent.ymax ,
spatialReference: currentExtent.spatialReference
});

if(obj['global_grid'] === true){
newExtent = new Extent({
xmin: -180 ,
ymin: -90 ,
xmax: 180 ,
ymax: 90 ,
spatialReference: currentExtent.spatialReference
});
}

return MapUtil.prototype.createMapImage(objectURL, newExtent);
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/jpl/dijit/LegendsAndOpacity.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ define([
if (this.datasets[message.datasetId]) {
this.removeDataset(message);
}

var laoDataset = new LegendsAndOpacityDataset({
_id: Math.random(),
datasetId: message.datasetId,
Expand Down Expand Up @@ -159,6 +158,9 @@ define([
this.open = false;
},
handleVariablesFetched: function(message) {
if('global_grid' in message){
this.datasets[message.datasetId]['global_grid'] = message['global_grid'];
}
if('multi_lon_lat' in message){
var new_variables = [];
for(var i = 0; i < message.multi_groups.length; i++){
Expand Down Expand Up @@ -193,6 +195,7 @@ define([
},
handleAddGranulePreview: function(message) {
var laoDataset = this.datasets[message.granuleObj["Granule-DatasetId"]];
message['global_grid'] = laoDataset['global_grid'];
if (laoDataset) {
laoDataset.addGranulePreview(message);
}
Expand Down

0 comments on commit e4e8b54

Please sign in to comment.