Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proj for raw geostationary data when writing to geotiff #24

Open
tmlunde opened this issue Nov 15, 2015 · 5 comments
Open

Add proj for raw geostationary data when writing to geotiff #24

tmlunde opened this issue Nov 15, 2015 · 5 comments

Comments

@tmlunde
Copy link

tmlunde commented Nov 15, 2015

from datetime import datetime, timedelta


geosSettings = {
                "met10": {'sat':"meteosat", 'num':"10", 'instr':"seviri", 'ir':'IR_108', 'freq': 15 }
}
sat = "met10"
fOut = "tst.tif"

cycles = 1
dateNow = datetime.now()
t = dateNow - timedelta(minutes=dateNow.minute % 15, seconds=dateNow.second, microseconds=dateNow.microsecond) - timedelta(15*cycles/(24.*60.))

geosSettings[sat]['meta'] = GeostationaryFactory.create_scene(geosSettings[sat]['sat'], 
                                             geosSettings[sat]['num'], 
                                             geosSettings[sat]['instr'], time_slot=t)

geosSettings[sat]['meta'].load([geosSettings[sat]['ir']])
img = geosSettings[sat]['meta'].image.ir108()
img.save(fOut)

Results in no proj information is written to tst.tif. The proj (and proj4 string) is present in meteosat10.cfg, but unless the scene is projected first (with foo.project("projection") ), this information is omitted. On my wishlist to include the raw geos projection string when writing to geotiff even if project has not been called.

Best wishes
Torleif

@mraspaud
Copy link
Member

@tmlunde thanks for reporting this. The problem is probably that geosSettings[sat]['meta'][10.8].area is None...

@mraspaud
Copy link
Member

ok, it's actually the opposite, geosSettings[sat]['meta'].area is None, which is quite logical since there could be channels with different areas in the scene object. A workaround is to do

geosSettings[sat]['meta'].area = geosSettings[sat]['meta'][10.8].area

just after the load...

@tmlunde
Copy link
Author

tmlunde commented Nov 16, 2015

Will indeed work. Maybe the missing proj could be set during image creation as the channel problem would self resolve at this stage. But understand if it should ne kept as a feature.

@mraspaud mraspaud added this to the mpop v2.0 milestone Nov 16, 2015
@mraspaud
Copy link
Member

I will mark this issue as a feature request for mpop 2.0.

@tmlunde
Copy link
Author

tmlunde commented Nov 16, 2015

Thanks :-)

meteoswiss-mdr pushed a commit to meteoswiss-mdr/mpop that referenced this issue Nov 29, 2016
Signed-off-by: Martin Raspaud <martin.raspaud@smhi.se>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants