McGill-sea-ice / ice-tracker-deformations

This project aims at computing arctic sea ice deformations from icetracker data (Sentinel-1 and RCM).
3 stars 3 forks source link

Generating frequency heat maps of the S1 and RCM datasets #23

Open LekiYak opened 2 years ago

LekiYak commented 2 years ago

Plotting heat maps of data point density (frequency) for different delta t's and collection periods.

LekiYak commented 2 years ago

It may be productive to work year by year first instead of plotting multiple winters at once.

JFLemieux73 commented 2 years ago

This is a test @lbtremblay.

lbtremblay commented 2 years ago

ok


From: JFLemieux73 @.> Sent: Wednesday, June 1, 2022 10:18 AM To: McGill-sea-ice/ice-tracker-deformations @.> Cc: Bruno Tremblay, Prof. @.>; Mention @.> Subject: Re: [McGill-sea-ice/ice-tracker-deformations] Generating frequency heat maps of the S1 and RCM datasets (Issue #23)

This is a test @lbtremblayhttps://github.com/lbtremblay.

— Reply to this email directly, view it on GitHubhttps://github.com/McGill-sea-ice/ice-tracker-deformations/issues/23#issuecomment-1143672486, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALTQC24KSHLNJMVPWE4MAL3VM5WLBANCNFSM5XRMDEJA. You are receiving this because you were mentioned.Message ID: @.***>

LekiYak commented 2 years ago

Created branch coverage-map to store code related to heat map generation.

LekiYak commented 2 years ago

Heat maps representing spatial coverage of any delta T (Time step), tolerance (+- allowance on the selected time step), and spatial resolution can be generated by editing src/SatelliteCoverage/options.ini and running src/SatelliteCoverage/coverage_frequency_map.py. Sample maps can be seen below, as well as histograms of the delta T distribution used to inform the delta T and tolerance selection.

RCM 2019~2020 RCM2019-2020_deltaT 20200131_20200530_24_3_res10_RCM_freq 20200131_20200531_72_5_res10_RCM_freq

S1 2019~2020 S12019-2020_deltaT 20191231_20200531_24_3_res10_S1_freq 20191004_20200531_0_3_res10_S1_freq

While the RCM dataset does cover more of the Arctic than the S1 dataset, it only does so at 72 hours.

JFLemieux73 commented 2 years ago

Thanks Lekima. Could you please do the same for 2020-2021?

lbtremblay commented 2 years ago

Is it strange that 2019-20 has a larger coverage than 2020-2021 at 1day dt?

Very nice Lekima.

I agree. We should do all years before we agree to a given delta t.

Bruno


From: JFLemieux73 @.> Sent: Monday, June 6, 2022 9:42 AM To: McGill-sea-ice/ice-tracker-deformations @.> Cc: Bruno Tremblay, Prof. @.>; Mention @.> Subject: Re: [McGill-sea-ice/ice-tracker-deformations] Generating frequency heat maps of the S1 and RCM datasets (Issue #23)

Thanks Lekima. Could you please do the same for 2020-2021?

— Reply to this email directly, view it on GitHubhttps://github.com/McGill-sea-ice/ice-tracker-deformations/issues/23#issuecomment-1147461885, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALTQC22PWV4EB24U4KFQ3E3VNX54XANCNFSM5XRMDEJA. You are receiving this because you were mentioned.Message ID: @.***>

dringeis commented 2 years ago

Pretty! we can guess the satellites tracks =)

I think it is different satellites compared here, over the (roughly) same time period, not different years @lbtremblay.

Lekima, I would recommend (as good practice):

I'm not 100% sure about what the heatmap shows. Is it the number of timesteps when data is present at the 24h/72h interval for each given pixel?

LekiYak commented 2 years ago

Thanks for the feedback Damien :)

I have unstable internet at the moment, and could only download the RCM data for 2020~2021.

There seems to be a trade-off between temporal resolution and spatial coverage. My gut feeling tells me S1 data will have better temporal resolution overall, but with limited spatial coverage. Here's RCM 2020~2021: RCM2020-2021_deltaT 20201101_20210601_12_3_res10_RCM_freq 20201101_20210602_24_3_res10_RCM_freq 20201030_20210603_60_5_res10_RCM_freq 20201101_20210604_72_3_res10_RCM_freq

LekiYak commented 2 years ago

New tasks: Time series of % area covered for each delta T, at 1, 3, 6 day intervals.

Coverage maps (area): Same data filtering as the time series. If there is coverage, set cell to 1, if not, 0. Add histograms for each interval (1~6 days) over the entire winter (November to May) to visualize PDFs of spatial coverage.

dringeis commented 2 years ago

I am the annoying details person =D :

ISO 8601

So we do not mix months and days

LekiYak commented 2 years ago

Hi all,

I'm having trouble plotting the frequency map using intervals (1, 3, day(s) etc.) as timesteps. The x and y values of the data points (to be binned) are calculated by converting the sLat and sLon columns of the desired data files from WGS:84 into the Polar Stereographic projection. The function I used to create the original frequency maps is np.hist2d which returns an n x m array representing the 2d histogram, with each element storing the number of data points which fit into that bin.

For example, if we had a 3 x 3 histogram, a distribution could look like this: [[0, 2, 1], [3, 0, 1], [0, 0, 2]]

The function also returns an image.

What I've been trying to do is to create an array for each interval, but capping non-zero terms at 1, so the array above would look like:

[[0, 1, 1], [1, 0, 1], [0, 0, 1]]

And then adding those for every interval considered, and plotting a map using the resultant array. To do this, I tried using axis.contourf (MatPlotLib), but my plots end up with the wrong projection (or there is a flaw in my method). This is an example of a map I've plotted using RCM and S1 data (combined). There are clearly data points being plotted on land, which doesn't make sense.

TESTING1234

Possible problems I've considered are:

Does anyone have pointers or suggestions on how to go about this?

Thanks, Lekima

JFLemieux73 commented 2 years ago

Hi Lekima,

You could try with pcolormesh instead of contourf.

jf

a-bouchat commented 2 years ago

You could also try imshow to plot the final array.

a-bouchat commented 2 years ago

Actually I think that pcolormesh as suggested by jf would be a better option as you can specify the x/y coordinates for the corner of each bin so that should ensure that they show up at the right place on the map.

dringeis commented 2 years ago

If I am not mistaken, hist2D can take the bins in input: https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.hist2d.html That way you could ensure that the bins are the same for every interval.

That will allow you to see if the problem is the first on your list or something else.

LekiYak commented 2 years ago

Thanks everyone! I got the function working, and shockingly, a delta t of 72 hours (with 72 hour intervals considered) seemingly provides the best coverage.

72 Hours 20201110_20210601_72_5_res10_RCMS1_72_intervalfreq

Compared to 24 hours 20201111_20210601_24_5_res10_RCMS1_72_intervalfreq