SpatioTemporal / GeoData

Module of experimental, but perhaps useful, code not yet stable or proven general enough for inclusion in STARE or pystare.
1 stars 1 forks source link

questions about code in GeoData/geodata/modis_coarse_to_fine_geolocation/modis_1km_to_250m_geolocation.py #2

Open captainkirk99 opened 3 years ago

captainkirk99 commented 3 years ago

@michaelleerilee and @NiklasPhabian :

I have some questions about code in: GeoData/geodata/modis_coarse_to_fine_geolocation/modis_1km_to_250m_geolocation.py

1 - In this function:

def itk_1km_to_250m ( i_tk_1km ) :
    """
    return the 250m grid index along track of a 1km pixel
    """
    return 1.5 + 4. * i_tk_1km

Is the argument i_tk_1km intended to be an integer? It seems like it must be, as an index, but the calculation can yield a floating point. Is the floating point just truncated to an integer?

2 - I see this code:

# the width of one scan, in number of pixels, at 250m resolution
    w_scan_250m = 40

I'm not sure what this means. The scan is 8120 x 5416 for the 250 meter resolution, which is the size across and along the scan. What then is a pixel in this context? Isn't a pixel 1 x 1 in size? Where does the 40 come from? I have read the MOD09 docs here: https://salsa.umd.edu/files/MOD09_UserGuide_v1.4.pdf and it seems to say that pixels are only relevant for the gridded product, not the MOD09L2 product. What am I missing?

3 - In the code here:

 # linear interpolation on the position
    alpha_lon = ( lon_right_250m - lon_left_250m ) / ( isc_right_250m - isc_left_250m )
    alpha_lat = ( lat_right_250m - lat_left_250m ) / ( isc_right_250m - isc_left_250m )

    lat = lat_left_250m + alpha_lat * ( isc_250m - isc_left_250m )
    lon = lon_left_250m + alpha_lon * ( isc_250m - isc_left_250m )

It seems that we end up doing linear interpolation of the lon and then the lat values. Is this correct?

michaelleerilee commented 3 years ago

The better document is at https://modis.gsfc.nasa.gov/data/atbd/atbd_mod28_v3.pdf .

Table 3-2 describes 40 detectors at 250m resolution in one scan. Section 3.1.4.3 I think is relevant to calculating 250m positions.

captainkirk99 commented 3 years ago

Holy crap that is complex! However, it seems that @NiklasPhabian is just doing linear interpolation. I have requested a meeting with him to discuss. Meanwhile, I will study the ATBD and see if I can learn more...

michaelleerilee commented 3 years ago

Part of the complexity may come from the overlapping at the edges (bow-tie). We may need to ask Robert Wolfe to get on the right track.