Support the Arctic Sea Ice Forum and Blog

Author Topic: Problem with IMS snow&ice data  (Read 8111 times)

pdjakow

  • New ice
  • Posts: 8
    • View Profile
  • Liked: 0
  • Likes Given: 0
Problem with IMS snow&ice data
« on: November 16, 2013, 05:57:20 PM »
Hello all!

I have problems with proper interpretation of IMS snow&ice data on NSIDC:
http://nsidc.org/data/docs/noaa/g02156_ims_snow_ice_analysis/

What I want to do is:

- get 4km ASCII file
- convert data file to something like dbf file:

lat lon value

Unfortunetaly data file is in polar stereographic projection:

Quote
Northern Hemisphere coverage is available at approximately 4-km and at approximately 24-km resolution. The bounding coordinates are as follows:

Southernmost Latitude: 0° N
Northernmost Latitude: 90° N
Westernmost Longitude: 180° W
Easternmost Longitude: 180° E

Data are in a polar stereographic projection centered at 90° N with the vertical longitude from the Pole at 80° W and the standard parallel at 60° N.

Example data files from NATICE:
http://www.natice.noaa.gov/pub/ims/snow/6144asc/2013/

There is 6144x6144 data points, and I don't know how to calculate position of each value. I even try to make image from that data, and that was funny in some way ;)



Does anyone know alghoritm to calculate lat/lon position of each data point?

//this image is of course mirror image of real world
« Last Edit: November 16, 2013, 06:15:10 PM by pdjakow »

ChrisReynolds

  • Nilas ice
  • Posts: 1764
    • View Profile
    • Dosbat
  • Liked: 20
  • Likes Given: 9
Re: Problem with IMS snow&ice data
« Reply #1 on: November 16, 2013, 08:59:28 PM »
Maybe I'm not understanding.

You have latitude and longitude files for each data point at both 4 and 24km resolution,
http://nsidc.org/data/docs/noaa/g02156_ims_snow_ice_analysis/#latlon_format
So that's your lat, lon, value taken care of.

Isn't it?

If you want to convert from lat/lon to a rectangular grid for plotting then the code snippet I use is:

Northing = (90 - GridArray(n, 2)) * Cos((GridArray(n, 1) - 45) * Pi / 180)
Easting = (90 - GridArray(n, 2)) * Sin((GridArray(n, 1) - 45) * Pi / 180)

Northing is up/down, easting across, GridArray(n,1) is longitude, GridArray(n,2) is latitiude, the -45 is to get the grid plot centred on Greenland. Think of it as a phasor problem - ask if I'm being too cryptic, I'm in a rush now.

I've been trying to get sense out of this site:
http://data.ncdc.noaa.gov/thredds/catalog/cdr/snowcover/catalog.html?dataset=cdr/snowcover/nhsce_v01r01_19661004_20130930.nc
Now I see it's a page 404 - Rutgers snowlab data is supposed to be migrating there. But this snow data looks like a doddle to use! I want to be able to work out a snow advance index for predicting cold winters.

Let me know if I have got totally the wrong end of the stick.

Wipneus

  • Citizen scientist
  • Young ice
  • Posts: 4220
    • View Profile
    • Arctische Pinguin
  • Liked: 1025
  • Likes Given: 0
Re: Problem with IMS snow&ice data
« Reply #2 on: November 17, 2013, 08:47:02 AM »
What Chris was saying, the lat & lon files are (as binary flat files) in ftp://sidads.colorado.edu/pub/DATASETS/NOAA/G02156/metadata/

If you insist on computing: for my gridded sea ice concentration files I have used proj.4, which seems to be some kind of standard for cartographics.

And your image seems to be in need of mirroring, something like i <- 6144 - i should do the trick.

pdjakow

  • New ice
  • Posts: 8
    • View Profile
  • Liked: 0
  • Likes Given: 0
Re: Problem with IMS snow&ice data
« Reply #3 on: November 17, 2013, 09:08:23 AM »
I'm working on ASCII files:
ftp://sidads.colorado.edu/pub/DATASETS/NOAA/G02156/4km/2013/

Image above was created with reading this ASCII file line by line and values represented by colors:

light blue (0) - outside northern hemisphere
blue (1) - ocean
green (2) - land
gray (3) - ice
white (4) - snow

Oryginal size image is here:
http://meteomodel.pl/klimat/IMS.png

Edit

Of course if I replace line:

bmp.SetPixel(i,j,Color.LoghtBlue)

with

bmp.SetPixel(6143-i,j,Color.LightBlue)

"Mirror effect" will be removed.
http://meteomodel.pl/klimat/IMS3.png
« Last Edit: November 17, 2013, 09:20:52 AM by pdjakow »

ChrisReynolds

  • Nilas ice
  • Posts: 1764
    • View Profile
    • Dosbat
  • Liked: 20
  • Likes Given: 9
Re: Problem with IMS snow&ice data
« Reply #4 on: November 17, 2013, 08:55:29 PM »
EDIT
Actually ignore this message, I've just realised that the NSIDC mask doesn't give seas within the Arctic Ocean. That was apparent from the numbering used, but I only noticed once plotted.



Wipneus,

While we're on the subject of lat/lon masks..

http://nsidc.org/data/polar_stereo/tools_masks.html
I've started work on gridding the PIOMAS volume into the sea regions of the Arctic as per the NSIDC mask. Before I start on the task of working out the grid lat/lon for each of the mask's data points - do you know if there's already a file of lat lon for each grid box centre?

« Last Edit: November 17, 2013, 10:25:32 PM by ChrisReynolds »

Wipneus

  • Citizen scientist
  • Young ice
  • Posts: 4220
    • View Profile
    • Arctische Pinguin
  • Liked: 1025
  • Likes Given: 0
Re: Problem with IMS snow&ice data
« Reply #5 on: November 18, 2013, 08:10:09 AM »
This is a developers tread, so I answer anyway.

long&lat for the NSIDC stereo graphic grids are here:

http://nsidc.org/data/polar_stereo/tools_geo_pixel.html

This one (from Cryosphere Today) is a 25 km NSIDC grid:



Jaxa has its own:


anonymous

  • Guest
Re: Problem with IMS snow&ice data
« Reply #6 on: November 18, 2013, 10:26:50 AM »
What I want to do is:

- get 4km ASCII file
- convert data file to something like dbf file:

lat lon value
You have all info needed to convert the pixel coordinates in to meters, put (0,0) at North Pole. From there you can project onto lats/lons with the projection provided. The polar has 3 important parameters: the latitude of the center,  the longitude pointing to the bottom and the latitude of true scale (standard parallel).

Then proj4 will help you, it defines projections with theses strings:

Code: [Select]
+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs
Taken from here: http://www.spatialreference.org/ref/epsg/3413/

So for the IMS it should be:

Code: [Select]
+proj=stere +lat_0=90 +lat_ts=60 +lon_0=-80 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs
Then in your program you can translate from x/y in meters into lat/lon in degrees.

Let us know the most volatile region in terms of snow cover :)



pdjakow

  • New ice
  • Posts: 8
    • View Profile
  • Liked: 0
  • Likes Given: 0
Re: Problem with IMS snow&ice data
« Reply #7 on: November 18, 2013, 11:37:43 AM »
I used lat/lon data files, as Chris said. This working good, however files are large and must be loaded into memory.



I have still problem with proper pixel drawing.

ChrisReynolds

  • Nilas ice
  • Posts: 1764
    • View Profile
    • Dosbat
  • Liked: 20
  • Likes Given: 9
Re: Problem with IMS snow&ice data
« Reply #8 on: November 18, 2013, 07:04:16 PM »
Thanks Werther,

You've prompted me to go back and look again at my last effort to make a region mask for the PIOMAS data (May of last year - what happens when I get distracted).

I used the Cryosphere Today image straight off their site, having just checked - it is 448 by 304, the same size as the NSIDC mask! I have already used ImageJ (IIRC) to convert the colours to greyscale, so a byte represents a pixcel using the following byte values.

1 Non-regional ocean
2 Sea of Okhotsk and Japan
3 Bering Sea
4 Hudson Bay
5 Baffin Bay/Davis Strait/Labrador Sea
6 Greenland Sea
7 Kara and Barents Seas
8 Central Arctic Ocean
9 Canadian Archipelago
10 Gulf of St. Lawrence
11 Land
12 Coast
13 Laptev Sea
14 East Siberian Sea
15 Chucki Sea
16 Beaufort Sea

One reason I didn't pursue that is that it would mean the pixcel dither along boundaries would be noticeable at the PIOMAS grid box level, PIOMAS is only 120X360, but is of higher resolution within the Arctic. But dithering would happen using the method I intend to emply, and I suspect that method will act to smooth.

What I had intended to do is to use the cartesian to polar conversion in my earlier reply to PD Jakow to use the image data outlined above as a look up table and produce a file of the same format as the PIOMAS files (although 1 byte per item) with the corresponding region code for each PIOMAS Lat/Lon grid box. The method would smooth because I intend to use a^2 + b^2 relationship to determine the closest Area code, using the centre lat/lon of the pixcels.

But I'm not doing it tonight, I'm too tired.