Discussion:
Hovmoller
(too old to reply)
t***@uah.edu
2014-07-24 19:39:06 UTC
Permalink
I have been able to read in several NetCDF files, and now I am attempting to create Hovmoller diagrams, but cannot get the data to cooperate with me. The data is as follows:
temp=[2000,2000, 2]
lon=[2000,2000,2]
lat=[2000,2000,2]
time=[2]

Any suggestions on how to create these plots would be much appreciated.

Thanks
David Fanning
2014-07-25 13:36:40 UTC
Permalink
Post by t***@uah.edu
temp=[2000,2000, 2]
lon=[2000,2000,2]
lat=[2000,2000,2]
time=[2]
Any suggestions on how to create these plots would be much appreciated.
Movmoller plots are time vs latitude or time vs longitude plots. You
will have an EXTREMELY difficult time producing such plots with only two
time points! :-)

Are you sure this is what you want?

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
t***@uah.edu
2014-07-25 18:27:28 UTC
Permalink
Post by David Fanning
Post by t***@uah.edu
temp=[2000,2000, 2]
lon=[2000,2000,2]
lat=[2000,2000,2]
time=[2]
Any suggestions on how to create these plots would be much appreciated.
Movmoller plots are time vs latitude or time vs longitude plots. You
will have an EXTREMELY difficult time producing such plots with only two
time points! :-)
Are you sure this is what you want?
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
When I use the WHERE function to limit the temperature values and use that index on over the time array I get an equal number of time and longitude values.
David Fanning
2014-07-25 18:47:23 UTC
Permalink
Post by t***@uah.edu
When I use the WHERE function to limit the temperature values and use that index on over the time array I get an equal number of time and longitude values.
Well, then you are doing it wrong. :-)

Believe me, you only have two temperature values in this file. Print out
your time array.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
t***@uah.edu
2014-07-25 19:41:17 UTC
Permalink
Post by David Fanning
Post by t***@uah.edu
When I use the WHERE function to limit the temperature values and use that index on over the time array I get an equal number of time and longitude values.
Well, then you are doing it wrong. :-)
Believe me, you only have two temperature values in this file. Print out
your time array.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Here is my time array after I read in 2 files:

TIME FLOAT = Array[2]

Then I try to find where the temps are less than 220:
IND=WHERE(temp LE 220, count)
temp=temp[IND]
help, temp
TEMP FLOAT = Array[205967]
David Fanning
2014-07-25 20:20:15 UTC
Permalink
Post by t***@uah.edu
TIME FLOAT = Array[2]
IND=WHERE(temp LE 220, count)
temp=temp[IND]
help, temp
TEMP FLOAT = Array[205967]
Yes, but I'm not sure why you are telling me this. A Hovmoller plot is a
plot of temperature with longitude (or latitude) along one axis and time
along the other. You have two time points. What do you expect the
"plot" to look like?

If I were you, I would just contour the two temperature "images" you
have next to each other and label them with the two times you have. You
will have the advantage that people will understand what you are
showing. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
t***@uah.edu
2014-07-25 20:22:37 UTC
Permalink
Post by t***@uah.edu
temp=[2000,2000, 2]
lon=[2000,2000,2]
lat=[2000,2000,2]
time=[2]
Any suggestions on how to create these plots would be much appreciated.
Thanks
Well I have about 20 files and will want to show eastward propagation with time
David Fanning
2014-07-25 20:49:02 UTC
Permalink
Post by t***@uah.edu
Well I have about 20 files and will want to show eastward propagation with time
Ah, so you have more than one file. As Wesley says in the Princess
Bride, "Why didn't you mention the wheelbarrow among our assets the
first time?"

Presumably these files contain data points at different times. Perhaps
you have 20 such times. Now we are getting somewhere!

What you have to do is build up a 2D array by selecting for longitude
and saving the temperatures at those longitudes.

ntimes = 20

; Read the first file, just to see how big array has to be.
... read the data file, extract variables, etc.
lonIndices = where(lons gt -25 and lons lt 40)

; Temperature at longitude and time
data = FltArr(N_Elements(lonIndices), ntimes)
temps = temps[lonIndices]
times = FltArr(ntimes)

; Read the files in a loop and extract info for Hovmoller plot.
for j=0,19 DO BEGIN
... Read file, extract variables, etc.
times = time[0]
data[*,j] = temps[lonIndices]
endfor

Now, make your plot...

cgContour, data, times, lons[lonIndices], ... ; Hovmoller plot

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
l***@gmail.com
2017-12-27 20:30:02 UTC
Permalink
No disrespect intended, but what if we want to make said plot without using Coyote graphics?
Post by David Fanning
Post by t***@uah.edu
Well I have about 20 files and will want to show eastward propagation with time
Ah, so you have more than one file. As Wesley says in the Princess
Bride, "Why didn't you mention the wheelbarrow among our assets the
first time?"
Presumably these files contain data points at different times. Perhaps
you have 20 such times. Now we are getting somewhere!
What you have to do is build up a 2D array by selecting for longitude
and saving the temperatures at those longitudes.
ntimes = 20
; Read the first file, just to see how big array has to be.
... read the data file, extract variables, etc.
lonIndices = where(lons gt -25 and lons lt 40)
; Temperature at longitude and time
data = FltArr(N_Elements(lonIndices), ntimes)
temps = temps[lonIndices]
times = FltArr(ntimes)
; Read the files in a loop and extract info for Hovmoller plot.
for j=0,19 DO BEGIN
... Read file, extract variables, etc.
times = time[0]
data[*,j] = temps[lonIndices]
endfor
Now, make your plot...
cgContour, data, times, lons[lonIndices], ... ; Hovmoller plot
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Jim P
2017-12-28 02:52:42 UTC
Permalink
Post by l***@gmail.com
No disrespect intended, but what if we want to make said plot without using Coyote graphics?
Post by David Fanning
Post by t***@uah.edu
Well I have about 20 files and will want to show eastward propagation with time
Ah, so you have more than one file. As Wesley says in the Princess
Bride, "Why didn't you mention the wheelbarrow among our assets the
first time?"
Presumably these files contain data points at different times. Perhaps
you have 20 such times. Now we are getting somewhere!
What you have to do is build up a 2D array by selecting for longitude
and saving the temperatures at those longitudes.
ntimes = 20
; Read the first file, just to see how big array has to be.
... read the data file, extract variables, etc.
lonIndices = where(lons gt -25 and lons lt 40)
; Temperature at longitude and time
data = FltArr(N_Elements(lonIndices), ntimes)
temps = temps[lonIndices]
times = FltArr(ntimes)
; Read the files in a loop and extract info for Hovmoller plot.
for j=0,19 DO BEGIN
... Read file, extract variables, etc.
times = time[0]
data[*,j] = temps[lonIndices]
endfor
Now, make your plot...
cgContour, data, times, lons[lonIndices], ... ; Hovmoller plot
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
IDL has a built-in CONTOUR function that doesn't rely on the David's Coyote library.

https://www.harrisgeospatial.com/docs/contour.html
l***@gmail.com
2017-12-29 22:22:19 UTC
Permalink
Post by Jim P
Post by l***@gmail.com
No disrespect intended, but what if we want to make said plot without using Coyote graphics?
Post by David Fanning
Post by t***@uah.edu
Well I have about 20 files and will want to show eastward propagation with time
Ah, so you have more than one file. As Wesley says in the Princess
Bride, "Why didn't you mention the wheelbarrow among our assets the
first time?"
Presumably these files contain data points at different times. Perhaps
you have 20 such times. Now we are getting somewhere!
What you have to do is build up a 2D array by selecting for longitude
and saving the temperatures at those longitudes.
ntimes = 20
; Read the first file, just to see how big array has to be.
... read the data file, extract variables, etc.
lonIndices = where(lons gt -25 and lons lt 40)
; Temperature at longitude and time
data = FltArr(N_Elements(lonIndices), ntimes)
temps = temps[lonIndices]
times = FltArr(ntimes)
; Read the files in a loop and extract info for Hovmoller plot.
for j=0,19 DO BEGIN
... Read file, extract variables, etc.
times = time[0]
data[*,j] = temps[lonIndices]
endfor
Now, make your plot...
cgContour, data, times, lons[lonIndices], ... ; Hovmoller plot
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
IDL has a built-in CONTOUR function that doesn't rely on the David's Coyote library.
https://www.harrisgeospatial.com/docs/contour.html
I don't think contour is what I want. Doesn't it always filter/interpolate the data? Maybe "image" will do.
t***@uah.edu
2014-07-28 19:41:36 UTC
Permalink
Post by t***@uah.edu
temp=[2000,2000, 2]
lon=[2000,2000,2]
lat=[2000,2000,2]
time=[2]
Any suggestions on how to create these plots would be much appreciated.
Thanks
Thanks David
Loading...