pytroll / satpy

Python package for earth-observing satellite data processing
http://satpy.readthedocs.org/en/latest/
GNU General Public License v3.0
1.06k stars 292 forks source link

Is there a way to open a file whose data source is not yet supported in the readers? E.g., CloudSat data. #2387

Open stormycloudy opened 1 year ago

stormycloudy commented 1 year ago

I am trying to read and plot some CloudSat data (for example, https://www.cloudsat.cira.colostate.edu/data-products/2b-cldclass-lidar) in .hdf format. I am able to read them using pyhdf or pynio packages as xarray objects, but would love to try the plotting features of SatPy. I searched through the readers and couldn't find any one that works with these data. Any suggestions?

Also, these data are swath data, and are not regularly gridded. Can anything in SatPy grid them onto regular grids?

Sorry but I am new to this package. I searched through the docs and couldn't find any answers. I would really appreciate any suggestions and help.

mraspaud commented 1 year ago

Thanks for opening this issue @stormycloudy ! There is an old reader for caliop data here https://github.com/pytroll/satpy/blob/main/satpy/readers/caliop_l2_cloud.py, but I think it hasn't been updated in a while. So maybe it just needs to be refreshed and it will work again.

Regarding grids: yes, we have the possibility to regrid data in satpy, but since caliop is vertical data, I don't know if it will work out of the box (we usually work with horizontal data). There also, we need to give it a shot and see.

mraspaud commented 1 year ago

And to answer the broader question, we don't have ways to open unknown data, as satpy needs to get some specific data (eg for calibration and navigation).

stormycloudy commented 1 year ago

Hi @mraspaud , thank you so much for your response!

There is an old reader for caliop data

I actually tried this reader since it's the closest thing to CloudSat on the list, but still, it doesn't recognize CloudSat files. I can read the files into xarray objects. Is there a way to start from here? Like, use the xarray datasets/data arrays for next steps with satpy?

Regarding grids: yes, we have the possibility to regrid data in satpy, but since caliop is vertical data, I don't know if it will work out of the box (we usually work with horizontal data). There also, we need to give it a shot and see.

I could worry about the vertical grids later, but it would really be helpful if I can use satpy to grid the data in a lat-lon domain first. I am currently trying pyresample--does the satpy method also use pyresample?

Thanks!

mraspaud commented 1 year ago

Have a look at how to make a custom reader for satpy here: https://satpy.readthedocs.io/en/latest/dev_guide/custom_reader.html If this feels like something you can do, feel free to open a pull request with your improvements, so we can discuss the implementation and eventually integrate you changes to satpy.

And yes, satpy uses pyresample under the hood.

stormycloudy commented 1 year ago

Thanks for the tutorial. I will try and see what I can do.