We've also been looking at reading the JMA supplied mtsat2 data as part of our work to migrate to Himawari8/9. It's very much a work in progress but I've attached what we've done so far in the tar. (Do note, we've not yet looked at the values in header 130). In the config file you'll need to point to your data dir and ensure the env. var PPP_CONFIG_DIR is set to your cfg directory.
We are still reviewing pytroll, so if you use the attached modifications, please treat the attached code with much suspicion and check you are getting good values (for instance we have performed a bytseswap when loading data [mipp/xrit/loader.py]; and there is no prologue file from JMA so we currently use the header information from the first segment file as the prologue, this may impact your use of header 130 if it is different across segments.).
The changes here assume the northern and southern hemisphere tar.gz files from JMA have already been uncompressed in to the source directory (it might be possible to get mipp to do that but we'll probably script that untar'ing task prior to invoking pytroll, if we go down the road of using pytroll of course).
The changes we have done will also have probably broken eumetsat sourced mtsat2 data in pytroll. We don't have access to that feed, so it probably doesn't matter for us. We also have the issue of ongoing maintenance, e.g. how would we deploy pytroll updates in the future without disrupting our own changes?
If Martin (or other Pytroll developers) have time to critique what we have done that would be useful.
So we still have a lot to work through but I hope what is here helps you.
For testing pytroll I've been using...
from PIL import ImageOps
import Image # as PIL_Image
from datetime import datetime
from mpop.satellites import GeostationaryFactory
import numpy as np
from pyresample.geometry import AreaDefinition
t = datetime(2015, 03, 25, 01, 32)
mtsat = GeostationaryFactory.create_scene("mtsat", "2", "mviri", time_slot=t)
mtsat.load([0.7, 3.8, 6.8, 10.8, 12.00]) #, 3.8, 6.8, 10.8])
print mtsat
globe = mtsat.image.channel_image(0.7)
img = globe.pil_image()
from pycoast import ContourWriter
cw = ContourWriter('/opt/spare/gshhg')
proj4_string = '+proj=geos +lon_0=145 +a=6378169.00 +b=6356583.80 +h=35785831.0'
area_extent = (-5499500.0, -5500500.0, 5500500.0, 5499500.0)
area = (proj4_string, area_extent)
cw.add_coastlines(img, area, resolution='h', level=5, outline='white')
cw.add_grid(img, area, (10.0,10.0),(2.0,2.0), fill='white',
outline='white', minor_outline='white')
img.save("./vis_globe_coast.png")
In case you're looking at resampling/projecting here are a couple of area.def specifications
REGION: TROPICS {
NAME: TROPICS
PCS_ID: tropics
PCS_DEF:
proj=merc,lat_ts=0,a=6370997.0,lon_0=0,lat_0=0
XSIZE: 1344
YSIZE: 848
AREA_EXTENT: (-555555.4924,-4156086.2753,7779110.2268,1102690.9047)
};
REGION: NZ_LL {
NAME: NZ_LL
PCS_ID: nz_ll
PCS_DEF:
proj=eqc,lat_ts=0,a=6370997.0,lon_0=0,lat_0=0
XSIZE: 840
YSIZE: 540
AREA_EXTENT:
(-1111110.9848,-6666665.9088,6666665.9088,-1666666.4772)
}
We've found the re-projecting quite challenging.
Best regards
Bill Self
MetService NZ.