FCI Geolocation

55 views
Skip to first unread message

Glan

unread,
Jul 31, 2025, 1:07:42 PMJul 31
to pytroll
Hi 
I want to obtain pixelwise geolocation of the MTG FCI W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+FCI-1C-RRAD-FDHSI-FD--CHK-BODY--DIS-NC4E_C_EUMT_20250701121004_IDPFI_OPE_20250701120707_20250701120801_N_JLS_O_0073_0030.nc product.
How can i do this.
Glan

Martin Raspaud

unread,
Aug 1, 2025, 4:02:42 AMAug 1
to pytroll
Hi,

Can you show us what you tried so far, so we can help you find the solution?

Best regards,
Martin
________________________________________
From: pyt...@googlegroups.com <pyt...@googlegroups.com> on behalf of Glan <mani...@gmail.com>
Sent: 31 July 2025 16:05:33
To: pytroll
Subject: [pytroll] FCI Geolocation
--
You received this message because you are subscribed to the Google Groups "pytroll" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytroll+u...@googlegroups.com<mailto:pytroll+u...@googlegroups.com>.
To view this discussion, visit https://groups.google.com/d/msgid/pytroll/0c2f768f-3c6a-4c0d-805c-09952501eee0n%40googlegroups.com<https://groups.google.com/d/msgid/pytroll/0c2f768f-3c6a-4c0d-805c-09952501eee0n%40googlegroups.com?utm_medium=email&utm_source=footer>.

David Hoese

unread,
Aug 1, 2025, 12:19:04 PMAug 1
to pytroll
I actually had a separate user email me directly for this exact same problem. In their case they needed the lon/lats in binary files on disk. I'm not familiar with the FCI reader's defaults so it is possible these arrays are flipped, but this is the basic code:

from satpy import Scene
from glob import glob

scn = Scene(reader="fci_l1c_nc", filenames=glob("/data/satellite/fci/uncompressed/RC0067/*BODY*"))
scn.load(["vis_04"])
lons, lats = scn["vis_04"].attrs["area"].get_lonlats()
lons.tofile("fci_vis04_lons_f64.dat")
lats.tofile("fci_vis04_lats_f64.dat")

Dave
Message has been deleted

Andrea Meraner

unread,
Aug 11, 2025, 6:46:07 AMAug 11
to pytroll
Hi all, 

indeed, what Dave proposes will do. Just note that if you want the lon-lat arrays to be "upright" instead of flipped (likely the case), you can modify the load command as below to get the flipping done automatically:

scn.load(["vis_04"], upper_right_corner="NE")

Cheers, 
Andrea

Glan

unread,
Dec 2, 2025, 9:59:59 AM (5 days ago) Dec 2
to pytroll
Thanks Andrea and Dave.
I just need the geolocation of pixels in the W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+FCI-1C-RRAD-FDHSI-FD--CHK-BODY--DIS-NC4E_C_EUMT_20250701121004_IDPFI_OPE_20250701120707_20250701120801_N_JLS_O_0073_0030.nc only.
However  
lons, lats = scn["vis_04"].attrs["area"].get_lonlats()  gives the lat lons of the entire disk.
Any suggestions for getting reflectance values on Libya sites only.
Glan

Andrea Meraner

unread,
Dec 2, 2025, 10:07:45 AM (5 days ago) Dec 2
to pytroll
Hi Glan, 

indeed, even if you pass only one chunk file, satpy will automatically pad the data to full-disk. You can deactivate this by doing

scn.load(["vis_04"], upper_right_corner="NE", pad_data=False)

then you should only get the one area for the one chunk you passed, and you can extract the lat-lon only for it. This will work also if you pass only a few contingent chunks.

Cheers, Andrea

Glan

unread,
Dec 2, 2025, 3:29:48 PM (5 days ago) Dec 2
to pytroll
Thank you Andrea, the False flag works. . Also how can we get  for each pixel of FCI 
Time of Aquisition, pixel radiance,FCI pixel quality, solar zenith angle (SZA),FCI viewing zenith angle (VZA)
 Solar azimuth angle,,
 Viewing azimuth angle,sun–Earth distance
Rgds
Glan

Glan

unread,
Dec 3, 2025, 3:08:14 AM (4 days ago) Dec 3
to pytroll
Thanks, I was able to get the angles. How now when i try to get the reflectance values from the non padded scene, I get this error.
Can you help


from satpy import Scene
from glob import glob
from satpy.modifiers.angles import get_angles
chan='vis_04'
scn = Scene(reader="fci_l1c_nc", filenames=glob("/data/scdr068/MTG/dir01/LgTZpzM2TSKChDikqhHatASS/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1\
+FCI-1C-RRAD-FDHSI-FD--CHK-BODY--DIS-NC4E_C_EUMT_20251001104949_IDPFI_OPE_20251001104651_20251001104737_N_JLS_O_0065_0029.nc"))

scn.load(["vis_04"], upper_right_corner="NE", pad_data=False)
lons, lats = scn[chan].attrs["area"].get_lonlats()
sat_az, sat_zenith, solar_az, solar_zenith = get_angles(scn[chan])
ref_values = scn['vis_04'].values
print(sat_az.shape, sat_zenith.shape, solar_az.shape, solar_zenith.shape)#,ref_values.shape )

Traceback (most recent call last):
  File "/data/home004/manik.bali/fci/linux-command-mcp/get_fci_libyas.py", line 10, in <module>
    ref_values = scn['vis_04'].values
                 ^^^^^^^^^^^^^^^^^^^^
  File "/data/home004/manik.bali/.conda/envs/fci/lib/python3.13/site-packages/xarray/core/dataarray.py", line 798, in values
    return self.variable.values
           ^^^^^^^^^^^^^^^^^^^^
  File "/data/home004/manik.bali/.conda/envs/fci/lib/python3.13/site-packages/xarray/core/variable.py", line 556, in values
    return _as_array_or_item(self._data)
  File "/data/home004/manik.bali/.conda/envs/fci/lib/python3.13/site-packages/xarray/core/variable.py", line 336, in _as_array_or_item
    data = np.asarray(data)
  File "/data/home004/manik.bali/.conda/envs/fci/lib/python3.13/site-packages/dask/array/core.py", line 1723, in __array__
    x = self.compute()
  File "/data/home004/manik.bali/.conda/envs/fci/lib/python3.13/site-packages/dask/base.py", line 373, in compute
    (result,) = compute(self, traverse=False, **kwargs)
                ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/home004/manik.bali/.conda/envs/fci/lib/python3.13/site-packages/dask/base.py", line 681, in compute
    results = schedule(expr, keys, **kwargs)
  File "src/netCDF4/_netCDF4.pyx", line 5094, in netCDF4._netCDF4.Variable.__getitem__
  File "src/netCDF4/_netCDF4.pyx", line 6064, in netCDF4._netCDF4.Variable._get
  File "src/netCDF4/_netCDF4.pyx", line 2160, in netCDF4._netCDF4._ensure_nc_success
RuntimeError: NetCDF: Filter error: undefined filter encountered




Glan

unread,
Dec 3, 2025, 3:08:30 AM (4 days ago) Dec 3
to pytroll
Installed conda install -c conda-forge hdf5plugin

 and it works now
On Tuesday, December 2, 2025 at 3:29:48 PM UTC-5 Glan wrote:

Andrea Meraner

unread,
Dec 3, 2025, 4:01:22 AM (4 days ago) Dec 3
to pytroll
Hi Glan, great to hear that it works now! Indeed that error pointed to a missing decompression library. Importing hdf5plugin does the trick!

Glan

unread,
Dec 3, 2025, 2:04:11 PM (4 days ago) Dec 3
to pytroll
Hi
How do we get time of acquisition for each pixel for FCI.
Glan

Andrea Meraner

unread,
Dec 4, 2025, 5:08:50 AM (3 days ago) Dec 4
to pytroll

Hi Glan, you can get it by loading the datasets called as channelname_time, e.g. "ir_105_time". The resulting array is in seconds since 1st of Jan 2000.
Reply all
Reply to author
Forward
0 new messages