Mapping sea surface temp with specific location? Struggling with ge... (2024)

24 views (last 30 days)

Show older comments

Daryna Butash on 24 Feb 2021

  • Link

    Direct link to this question

    https://support.mathworks.com/matlabcentral/answers/754784-mapping-sea-surface-temp-with-specific-location-struggling-with-geoshow-function

  • Link

    Direct link to this question

    https://support.mathworks.com/matlabcentral/answers/754784-mapping-sea-surface-temp-with-specific-location-struggling-with-geoshow-function

Edited: Rik on 14 Mar 2021

Accepted Answer: Chad Greene

Open in MATLAB Online

Hello! Thank you for looking at my question I need a little bit of help with my code I am trying to plot sea surface temperature in the Baltic Sea for my uni coursework and plot it on a map on matlab with colour change gradients and contours however, I have been having very little luck with making the geoshow function work. My SST data ends up 3 dimensional and wont combine with my latitude and longtitude which are 2D variable and im not sure why that is I will attach my code here. my sst variable ends up being 383 x 523 x 56 double and my latitude one is 523x383 single, I have tried reshaping as well as putting it into just the two columns but then its not the same size. Any help would be much appreciated, thank you in advance! I have had a few attempts at reshaping which are percentaged below.

clc; close all ;

ncfile = 'CMEMS_BAL_PHY_reanalysis_monthlymeans_200809.nc' ; %loads temperature file

ncdisp(ncfile) %info about ncfile

sst = ncread(ncfile, 'thetao');

lon = ncread(ncfile,'longitude');

lat = ncread(ncfile,'latitude');

% Read in the sea_ice_fraction data and store in a new variable called ice:

%gets sea surface temperature value

time = ncread(ncfile,'time') ; nt = length(time) ; %reads the time variable and obtains its size

[X,Y] = meshgrid(lon,lat) ; % transform longitudes and latitudes into a grid of lon long x lat dimension

%% in case salinty wants to be used

%ncfileS = 'woa18_decav_s00_04.nc' ; %loads salinity file

sal = ncread(ncfile,'so'); %defines salinity variable

%%generates map

figure('Color','white'); %creates figure

ax=worldmap([45 90],[-45 45]); % loads world map with the limits for BALTICS

%newx= reshape(X, 383, 523);

%

%nsst = permute(sst,[1 3 2]);

%nsst = reshape(nsst,[],size(sst,2),1);

%nsst= reshape(sst, []);

%setm(ax,'mapprojection','mercator','Origin', [180 0 180]) %changes projection and changes origin reference for coordinates

levels=[ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ]; % creates levels for contours

geoshow(double(Y),double(X),sst,'DisplayType','texturemap') %creates surface map of temperature

cb = contourcbar('peer',ax,'Location','northoutside'); %creates colorbar

caxis([15 35]) %defines limits for colorbar

colormap(jet) %sets color scheme

set(get(cb,'XLabel'),'String','SST (^oC)') %title for color bar

set(cb,'Position',[0.23 0.2417 0.5750 0.0335]) %adjust location and size of color bar

%levels=[28]; %sets level for contour defining specific

geoshow(double(Y),double(X),nsst,'DisplayType', 'contour','LevelList',levels,'LineColor','black') %plots temperature contour defining the western Pacific Warm Pool

hold on

land = shaperead('landareas.shp', 'UseGeoCoords', true); %define land areas

geoshow(land, 'FaceColor', [0 0 0]) % plots land areas in black

1 Comment

Show -1 older commentsHide -1 older comments

Rik on 14 Mar 2021

Direct link to this comment

https://support.mathworks.com/matlabcentral/answers/754784-mapping-sea-surface-temp-with-specific-location-struggling-with-geoshow-function#comment_1390913

  • Link

    Direct link to this comment

    https://support.mathworks.com/matlabcentral/answers/754784-mapping-sea-surface-temp-with-specific-location-struggling-with-geoshow-function#comment_1390913

I recovered the removed content from the Google cache (something which anyone can do). Editing away your question is very rude. Someone spent time reading your question, understanding your issue, figuring out the solution, and writing an answer. Now you repay that kindness by ensuring that the next person with a similar question can't benefit from this answer.

Sign in to comment.

Sign in to answer this question.

Accepted Answer

Chad Greene on 2 Mar 2021

  • Link

    Direct link to this answer

    https://support.mathworks.com/matlabcentral/answers/754784-mapping-sea-surface-temp-with-specific-location-struggling-with-geoshow-function#answer_637406

  • Link

    Direct link to this answer

    https://support.mathworks.com/matlabcentral/answers/754784-mapping-sea-surface-temp-with-specific-location-struggling-with-geoshow-function#answer_637406

Open in MATLAB Online

For 3D data cubes of things like ocean temperature, you most often need to permute the first two dimensions when reading in from a netcdf. That would look like this for your data:

sst = permute(ncread(ncfile, 'thetao'),[2 1 3]);

To make a 2D map of this 3D data, you'll need to either pick a single time slice and plot it like this:

pcolorm(Lat,Lon,sst(:,:,3))

to plot the third map of SST data in the time series. Or perhaps you wish to plot the average SST map for all of your data. That would look like this:

pcolorm(Lat,Lon,mean(sst,3,'omitnan'))

which calculates the mean long the third dimension (time) and omits any missing data values if there are any.

A side note: As a matter of style, it's generally best if you can avoid using the variable names X and Y to mean longitude and latitude, because X and Y often refer to projected coordinates which are in meters, rather than degrees. In my own work, I typically use lowercase lon and lat for 1D arrays and uppercase Lon and Lat for 2D grids of longitdue and latitude. That would look like

[Lon,Lat] = meshgrid(lon,lat);

1 Comment

Show -1 older commentsHide -1 older comments

Daryna Butash on 4 Mar 2021

Direct link to this comment

https://support.mathworks.com/matlabcentral/answers/754784-mapping-sea-surface-temp-with-specific-location-struggling-with-geoshow-function#comment_1368201

  • Link

    Direct link to this comment

    https://support.mathworks.com/matlabcentral/answers/754784-mapping-sea-surface-temp-with-specific-location-struggling-with-geoshow-function#comment_1368201

This is super helpful thank you so much! I don't think I will plot in 3d just because of ease of relaying my figures but I will definitely give it a try! Your suggestion helped my code work thank you again for the help.

Sign in to comment.

More Answers (0)

Sign in to answer this question.

See Also

Categories

Mathematics and OptimizationMapping Toolbox

RadarMapping Toolbox

Find more on Mapping Toolbox in Help Center and File Exchange

Tags

  • geoshow
  • function
  • matlab

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

An Error Occurred

Unable to complete the action because of changes made to the page. Reload the page to see its updated state.


Mapping sea surface temp with specific location? Struggling with ge... (5)

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom(English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
  • 日本Japanese (日本語)
  • 한국Korean (한국어)

Contact your local office

Mapping sea surface temp with specific location? Struggling with ge... (2024)

FAQs

How to calculate sea surface temperature? ›

A: Satellite instruments measure sea surface temperature—often abbreviated as SST—by checking how much energy comes off the ocean at different wavelengths. Computer programs merge sea surface temperatures from ships and buoys with the satellite data, and incorporate information from maps of sea ice.

Why does ocean surface temperature vary from place to place? ›

The temperature of ocean water varies by location – both in terms of latitude and depth, due to variations in solar radiation and the physical properties of water.

What satellite is used to monitor the surface temperature of the ocean? ›

AVHRR (MetOp-1/2) Level 2/3

NOAA CoastWatch / OceanWatch / PolarWatch produces Level 2/3 sea surface temperature datasets using AVHRR sensors aboard the Metop 1/2 satellites.

How do we monitor sea surface temperature? ›

To measure SST, scientists deploy temperature sensors on satellites, buoys, ships, ocean reference stations, and through marine telemetry. The NOAA-led U.S. Integrated Ocean Observing System (IOOS®) and NOAA's Center for Satellite Applications and Research (STAR) merge their data to provide SSTs worldwide.

How does NOAA measure sea surface temperature? ›

NOAA's satellites utilize microwave and infrared radiometers to measure sea surface temperatures, giving researchers valuable clues about the ocean. The ocean is home to critical coral reef ecosystems that provide a home to millions of plant, fish and marine animals.

What is the pattern of sea surface temperature? ›

The surface temperature of the world's oceans varies mainly with latitude, with the warmest waters generally near the equator and the coldest waters in the Arctic and Antarctic regions.

What are the factors affecting sea surface temperature? ›

Temperature of ocean water is not uniform and several factors like insolation, prevailing winds, ocean currents, affect its distribution. There is a gradual decrease of temperature from equator towards poles and the rate of decrease of temperature is generally of the order 0.5° per latitude.

Which ocean is colder, Pacific or Atlantic? ›

However, in general, the Atlantic Ocean's waters are warmer near the equator and colder near the poles compared to the Pacific. Please note that many variables can influence ocean temperatures. Why is science important?

How does the sea surface temperature change along latitude lines? ›

Temperature profiles vary at different latitudes, as the surface water is warmer near the equator and colder at the poles. In low latitude tropical regions the sea surface is much warmer, leading to a highly pronounced thermocline (Figure 6.2. 4).

Which instrument is used for measuring sea surface temperatures? ›

Sea surface temperature is a key climate and weather measurement obtained by satellite microwave radiometers, infrared (IR) radiometers, in situ moored and drifting buoys, and ships of opportunity.

At what depth is sea surface temperature measured? ›

Ocean Temperature is a measure of the energy in the ocean due to the motion of molecules. Depending on the sensor, spaceborne measurements give us an unprecedented global measurement of ocean temperatures from approximately 10 µm below the surface to 1 mm depths using radiometers.

Which satellite uses radar to measure and map sea surface height? ›

The TOPEX/Poseidon spacecraft uses a high precision radar altimeter to take measurements of sea surface height over 90% of the world's ice- free oceans. The satellite orbits at an altitude of 1336 km above the Earth and at an inclination of 66 degrees.

How do you find the sea surface temperature data? ›

Data Sources
  1. Near real-time temperatures are from NOAA's National Ocean Service (NOS) tidal stations and Physical Oceanographic Real-Time System (PORTS®).
  2. Recent and near real-time water temperatures are also from NOAA's National Data Buoy Center (NDBC) moored buoys.

What tools are used to monitor the ocean temperature? ›

The temperature of seawater is measured using instruments called thermistors. The temperature of seawater can be measured to great accuracy with carefully calibrated modern thermistors - down to variations of 0.0001° C. We measure temperature from a number of different platforms in the OSMOSIS project.

What is one advantage of using a map over a line graph? ›

Answer:​ Maps can display data patterns over large areas, but often with less detail or resolution than graphs. Graphs represent a “slice” of data along a line, but can show smaller variations.

How do we determine surface temperature? ›

Surface temperature is measured with a hand-held Infrared Thermometer (IRT) that, when necessary, is wrapped in a thermal glove or has been placed outdoors for at least 30 minutes prior to data collection.

How do you measure the temperature of seawater? ›

Temperature. The temperature of seawater is measured using instruments called thermistors. The temperature of seawater can be measured to great accuracy with carefully calibrated modern thermistors - down to variations of 0.0001° C. We measure temperature from a number of different platforms in the OSMOSIS project.

What is considered sea surface temperature? ›

Sea surface temperature is defined as the average temperature of the top few millimeters of the ocean. Sea surface temperature monitoring tells us how the ocean and atmosphere interact, as well as providing fundamental data on the global climate system.

How do you calculate the heat of the sea? ›

The heart of the sea must be found. It cannot be crafted or obtained by trading, making it a non-renewable resource. A heart of the sea is obtained from a buried treasure. The location is marked with a noticeable red X on a buried treasure map, which is found in ocean ruins and shipwrecks.

Top Articles
Latest Posts
Article information

Author: Delena Feil

Last Updated:

Views: 6180

Rating: 4.4 / 5 (45 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Delena Feil

Birthday: 1998-08-29

Address: 747 Lubowitz Run, Sidmouth, HI 90646-5543

Phone: +99513241752844

Job: Design Supervisor

Hobby: Digital arts, Lacemaking, Air sports, Running, Scouting, Shooting, Puzzles

Introduction: My name is Delena Feil, I am a clean, splendid, calm, fancy, jolly, bright, faithful person who loves writing and wants to share my knowledge and understanding with you.