Himawari-8

2,163 views
Skip to first unread message

bay...@gmail.com

unread,
Mar 14, 2015, 8:53:10 AM3/14/15
to pyt...@googlegroups.com
Hello
Our team has a mission to ingest and process HimawariCloud satellite imagery:

Number of bands: 16 (VIS: 3; NIR: 3; IR: 10)
Spatial resolution: VIS: 0.5–1km; NIR: 1–2km; IR: 2km
Divided into 10 segments
Size/frequency: ~1GB of bzip2 compressed data every ten minutes

Fortunately, the Japanese have preprocessed and georeferenced the data prior to distribution and have provided sample code for extracting values directly given lat/long so the ingest should be straight forward.

Although PyTroll looks like it is primarily targetted at handling polar orbiting satellites, the pyresample module looks useful if we can feed it lat/long input. Our biggest issue is how to process and disseminate the information.

One scenario is to have a cloud server located network-close to the Himawari cloud server retrieving the data and onfeeding it to another co-located server (or servers) for processing and delivery. A fixed set of high-priority projection imagery will be automatically generated along with ten-degree lat/long netcdf tiles and made available via a pydap server running under Apache with mod_deflate. Many ~MB-sized tiles will be retrieved in parallel by clients for regions of interest. Further down the track, fog and volcanic ash algorithms may be implemented and distributed.

Alternatively, we could opt for using Aspera (on a cloud server located network-close to the Himawari cloud server retrieving the data) to just feed all the data back to New Zealand and process it locally. Having to then redistribute out to our international clients does not make this a preferred option.

The choice of netcdf over GeoTiff is based on our perception of industry acceptance.

I would be interested in any thoughts members of the group would have as to these ideas and how it would fit in with the PyTroll framework. Note that our customer base has a predominant requirement for lat/long data so this is reflected in the design.  We will have HimawariCast data retrieved locally as a fallback option.

Thanks
Colin Brown
sample_codes_11.zip.dat

Martin Raspaud

unread,
Mar 16, 2015, 3:59:03 AM3/16/15
to pyt...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Colin,

- From what you describe, I think Pytroll could be used with great
benefit. And we do process geostationary data with Pytroll (mostly
MSG, but also MTSAT-2 for example), so it's working fine.

So from what I see, here are the components that could be used:
- - pyresample (as you mentionned) for reprojecting the data. In the
case of geostationary satellites, the precomputation feature is very
interesting since the nearest neighbour search can be skipped
altogether after the first time if the projection is fixed
- - mpop for reading the data, high-level reprojecting, saving to netcdf
and (custom) imagery. And a prototype reader for AHI standard format
is available (see Adam's mail on the 12/03).
- - trollduction for the automated batch production based on xml
product-lists. Usefull when the number of products start to increase.
- - pycoast for adding coastlines on top of image.

Most of the modules would fit right in, but as far as I know the
processing chain you describe hasn't been implemented yet, so some
minor adjustments might be need. However, it shouldn't be any problem
for a python programmer.

Best regards,
Martin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQEcBAEBAgAGBQJVBo1GAAoJEBdvyODiyJI434AIAJfWIDaH0zqcx3smvlBPONoy
RTfs/q8AipNoc44o5ykoQeHU+L28vg7EAmIaf2N0exftq6hfzgdVoaVjqkt1/HCj
CbK7zK96ULAqypM51dd+SDYnTPVCEpyzayfMjf6SrFwl9dP5QzZh5KiRWH1OrNC6
d3DtUD0dvhBuMFBf1NCroaYiyFrBLHr03WP4dH8j6VVP+fmdTtdxh3dKoQETi3LQ
s0cDGaA1v1mA38FD9h2uIZi+9hEWyiQ8r5u7KYeJmSD3BuIN350ITylGudCL0Zor
S6cWqzVbiglUgXaHuAww5df7z3cf3hCa6G9fDucfmR8OmB853F4TC3gY78Xj1YE=
=8qYW
-----END PGP SIGNATURE-----
martin_raspaud.vcf

RAC C

unread,
Apr 5, 2016, 11:16:44 AM4/5/16
to pytroll
Hello

I am in need of projecting Geodetic coordinates onto Himawari-8 standard data. attached is a png file for Channel 2.  The first header file block 11 looks like this

#11  Spare block -------------------
header block number           : 11
block length                  : 259
spare                         :

# convert from (pixel,line) to (longitude,latitude) ---
(Pix,Lin)(  3666.0,   184.0) ==> (Lon,Lat)(-9999.000,-9999.000)
(Pix,Lin)(  4888.0,   367.0) ==> (Lon,Lat)(  126.948,   63.660)
(Pix,Lin)(  6110.0,   550.0) ==> (Lon,Lat)(  152.138,   58.504)
(Pix,Lin)(  7332.0,   733.0) ==> (Lon,Lat)(  174.803,   55.931)
(Pix,Lin)(  8554.0,   916.0) ==> (Lon,Lat)(-9999.000,-9999.000)

# convert from (longitude,latitude) to (pixel,line) ---
(Lon,Lat)(-9999.000,-9999.000) ==> (Pix,Lin)(-9999.0,-9999.0)
(Lon,Lat)(  126.948,   63.660) ==> (Pix,Lin)(4888.0, 367.0)
(Lon,Lat)(  152.138,   58.504) ==> (Pix,Lin)(6110.0, 550.0)
(Lon,Lat)(  174.803,   55.931) ==> (Pix,Lin)(7332.0, 733.0)
(Lon,Lat)(-9999.000,-9999.000) ==> (Pix,Lin)(-9999.0,-9999.0)

# Digital count of (longitude,latitude) ---
(Lon,Lat)(-9999.000,-9999.000) ==> count value = 65534
(Lon,Lat)(  126.948,   63.660) ==> count value = 229
(Lon,Lat)(  152.138,   58.504) ==> count value = 407
(Lon,Lat)(  174.803,   55.931) ==> count value = 386
(Lon,Lat)(-9999.000,-9999.000) ==> count value = 65534

# Radiance of (longitude,latitude) ---
(Lon,Lat)(-9999.000,-9999.000) ==> radiance = -10000000000.0000
(Lon,Lat)(  126.948,   63.660) ==> radiance = 62.9066
(Lon,Lat)(  152.138,   58.504) ==> radiance = 116.4825
(Lon,Lat)(  174.803,   55.931) ==> radiance = 110.1617
(Lon,Lat)(-9999.000,-9999.000) ==> radiance = -10000000000.0000

# Albedo of (longitude,latitude) ---
(Lon,Lat)(-9999.000,-9999.000) ==> albedo = -10000000000.000
(Lon,Lat)(  126.948,   63.660) ==> albedo = 0.104
(Lon,Lat)(  152.138,   58.504) ==> albedo = 0.194
(Lon,Lat)(  174.803,   55.931) ==> albedo = 0.183
(Lon,Lat)(-9999.000,-9999.000) ==> albedo = -10000000000.000



How do I use the these data in PyCoast to geo-register the coastlines?  I don't understand the project4_string statement in the examples

i.e.
proj4_string = '+proj=stere +lon_0=8.00 +lat_0=50.00 +lat_ts=50.00 +ellps=WGS84'
 


Can you please help me with this? 

Martin Raspaud

unread,
Apr 7, 2016, 5:05:10 AM4/7/16
to pytroll
Hi,

At the moment, pycoast works only on gridded data that can be described as a proj.4 string.
So pure lonlats won't work, but maybe the 'geos' projection works on Himawari 8 data ?

Best regards,
Martin

--
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.
For more options, visit https://groups.google.com/d/optout.
--
Martin Raspaud, PhD
Software engineer
SMHI, SE-60176

David Hoese

unread,
Apr 7, 2016, 9:48:16 AM4/7/16
to pyt...@googlegroups.com
FYI I have had success processing AHI data (in separate software outside of pytroll) by generating a PROJ.4 string using this information from the NetCDF files I had:

+proj=geos +over +lon_0={longitude_of_projection_origin:0.3f} +lat_0={latitude_of_projection_origin:0.3f} +a={semi_major_axis:0.3f} +f={flattening} +h={perspective_point_height} +sweep={sweep_angle_axis}

Where semi_major_axis and perspective_point_height need to be in meters (they are in kilometers in the NetCDF files). Also "flattening" is 1/"inverse_flattening".

For a full disk image you end up with something like this:

+proj=geos +over +lon_0=140.700 +lat_0=0.000 +a=6378137.000 +f=0.0033528129638281333 +h=35785863.0 +sweep=x

Hope that helps.

Dave

On 4/7/16 4:04 AM, Martin Raspaud wrote:
> Hi,
>
> At the moment, pycoast works only on gridded data that can be described
> as a proj.4 string.
> So pure lonlats won't work, but maybe the 'geos' projection works on
> Himawari 8 data ?
>
> Best regards,
> Martin
>
> On Tue, 5 Apr 2016 at 17:16 RAC C <thii...@gmail.com
> <mailto:thii...@gmail.com>> wrote:
>
> Hello
>
> I am in need of projecting Geodetic coordinates onto Himawari-8
> standard data. attached is a png file for Channel 2. The first
> header file block 11 looks like this
>
> #11Spare block -------------------
> header block number: 11
> block length: 259
> spare:
>
> # convert from (pixel,line) to (longitude,latitude) ---
> (Pix,Lin)(3666.0,184.0) ==> (Lon,Lat)(-9999.000,-9999.000)
> (Pix,Lin)(4888.0,367.0) ==> (Lon,Lat)(126.948,63.660)
> (Pix,Lin)(6110.0,550.0) ==> (Lon,Lat)(152.138,58.504)
> (Pix,Lin)(7332.0,733.0) ==> (Lon,Lat)(174.803,55.931)
> (Pix,Lin)(8554.0,916.0) ==> (Lon,Lat)(-9999.000,-9999.000)
>
> # convert from (longitude,latitude) to (pixel,line) ---
> (Lon,Lat)(-9999.000,-9999.000) ==> (Pix,Lin)(-9999.0,-9999.0)
> (Lon,Lat)(126.948,63.660) ==> (Pix,Lin)(4888.0, 367.0)
> (Lon,Lat)(152.138,58.504) ==> (Pix,Lin)(6110.0, 550.0)
> (Lon,Lat)(174.803,55.931) ==> (Pix,Lin)(7332.0, 733.0)
> (Lon,Lat)(-9999.000,-9999.000) ==> (Pix,Lin)(-9999.0,-9999.0)
>
> # Digital count of (longitude,latitude) ---
> (Lon,Lat)(-9999.000,-9999.000) ==> count value = 65534
> (Lon,Lat)(126.948,63.660) ==> count value = 229
> (Lon,Lat)(152.138,58.504) ==> count value = 407
> (Lon,Lat)(174.803,55.931) ==> count value = 386
> (Lon,Lat)(-9999.000,-9999.000) ==> count value = 65534
>
> # Radiance of (longitude,latitude) ---
> (Lon,Lat)(-9999.000,-9999.000) ==> radiance = -10000000000.0000
> (Lon,Lat)(126.948,63.660) ==> radiance = 62.9066
> (Lon,Lat)(152.138,58.504) ==> radiance = 116.4825
> (Lon,Lat)(174.803,55.931) ==> radiance = 110.1617
> (Lon,Lat)(-9999.000,-9999.000) ==> radiance = -10000000000.0000
>
> # Albedo of (longitude,latitude) ---
> (Lon,Lat)(-9999.000,-9999.000) ==> albedo = -10000000000.000
> (Lon,Lat)(126.948,63.660) ==> albedo = 0.104
> (Lon,Lat)(152.138,58.504) ==> albedo = 0.194
> (Lon,Lat)(174.803,55.931) ==> albedo = 0.183
> <mailto:pytroll+u...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> Martin Raspaud, PhD
> Software engineer
> SMHI, SE-60176
>
> --
> 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>.

thiirane

unread,
Apr 7, 2016, 9:46:27 PM4/7/16
to pyt...@googlegroups.com
Thanks Dave, This is excellent news. Where did you find the documentation that describes how to do this projection? I want to understand how this statement
+proj=geos +over +lon_0=140.700 +lat_0=0.000 +a=6378137.000 +f=0.0033528129638281333 +h=35785863.0 +sweep=x
Works.

Very Respectfully,
Russell
You received this message because you are subscribed to a topic in the Google Groups "pytroll" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pytroll/qE0uNShileg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pytroll+u...@googlegroups.com.

David Hoese

unread,
Apr 8, 2016, 7:59:12 AM4/8/16
to pyt...@googlegroups.com
Russel,

I'm pretty familiar with PROJ.4 and projections in general (through
pytroll and polar2grid development) so I recognized what attributes I
needed to access from the data files I was given. This projection
definition is PROJ.4 for the C proj4 library and pyproj python library.
The best place to find information on each of these attributes that I've
found is here:
https://trac.osgeo.org/proj/wiki/GenParms

Hope that helps.

Dave

ron goodson

unread,
May 16, 2016, 12:49:41 PM5/16/16
to pytroll
To David H.

Where did you get the NetCDF sample that has this geo-information?

I am only starting to play with Himawari and NetCDF samples I've downloaded from JMA website (for japan and target areas .. no full-disk netcdf available) which have only 1-dimensional arrays for the latitude and longitude points... from which I have to construct a big 2d array of all possible lat/lon pairs.

The information you described seems more similar to what I've seen in the GOES-R simulated files (which gives the projection and geo-extents for the full-disk/conus/mesoscale areas).  Since I was able to build the skeleton of a simple Pytroll reader for those  .. a similar format for Himawari would be nice.

Or am I being dense.

Tks for any info.

David Hoese

unread,
May 16, 2016, 1:02:32 PM5/16/16
to pyt...@googlegroups.com
Hi Ron,

The NetCDF files I had access to are coming from an early version of
CSPP Geo. Specifically a script converting Himawari Standard Data (hsd)
format to NetCDF. If you need me to I can get you in touch with the CSPP
Geo folks here at the SSEC (I think some of them are on this list).

Dave

ron goodson

unread,
May 16, 2016, 1:18:32 PM5/16/16
to pytroll

Well .. I guess that explains why what you described seemed a lot like the GOES-R files :-)

Thanks for the info - nothing needs to be done for now.

ron

echa...@gmail.com

unread,
Dec 5, 2016, 8:59:04 PM12/5/16
to pytroll
Dear all.

I am looking for some methods about how to read and plot the HIMAWARI-8 standard format data (.hsd) using python.

Thank you in advance for your kind helps

best,
echa

Balthasar Indermuehle

unread,
Dec 5, 2016, 9:56:17 PM12/5/16
to pyt...@googlegroups.com
here's some code to get you started. This will create a true color
composite using the satpy built-in true colour routine of the full
disk.

You'll have to adjust the path to the HSD files.

#!/usr/bin/python
import sys
from datetime import datetime
from datetime import timedelta
import glob
from satpy.scene import Scene

if __name__ == '__main__':

if len(sys.argv) != 6:
print "usage: vis_comp.py year month day hour minute"
sys.exit(0)

starttime = datetime(int(sys.argv[1]), int(sys.argv[2]),
int(sys.argv[3]), int(sys.argv[4]), int(sys.argv[5]), 0)

print "Trying full disk data for %s" %
starttime.strftime('%Y-%m-%d %H:%M:%S')
fnames = glob.glob('/mnt/data/SAT/HSD/NCI/HS_H08_%s*' %
(starttime.strftime('%Y%m%d_%H%M')))
if fnames is not None and not fnames:
raise "No input files found"

scn = Scene(
sensor='ahi',
start_time = starttime,
end_time = starttime + timedelta(seconds=600),
filenames = fnames
)

print "LOAD >>>>>>>>>>>>>>>>>>>>"
scn.load(['true_color_raw'])

# instead of resample, just shrink:
print "RESIZE >>>>>>>>>>>>>>>>>>>>"
scn['B03'] = scn['B03'][::2, ::2]
scn['B03'].info['area'] = scn['B01'].info['area']
print "COMPUTE >>>>>>>>>>>>>>>>>>>>"
scn.compute()

print "SAVE >>>>>>>>>>>>>>>>>>>>"

# save the un-resampled version as well:
jptime = starttime + timedelta(hours=9)
scn.save_dataset('true_color_raw', 'hima8%s00fd.png' %
jptime.strftime('%Y%m%d%H%M'))
> --
> 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.

Martin Raspaud

unread,
Dec 6, 2016, 4:17:01 AM12/6/16
to pyt...@googlegroups.com
Dear Echa,

As Balthasar mentionned, you can use the (experimental) satpy package. To install is, I would recommend cloning it from github, using the develop branch.

Best regards,
Martin

echa desu

unread,
Dec 6, 2016, 8:28:46 PM12/6/16
to pytroll
Dear Martin and Balthasar,

Thank you for the reply.

Currently, I am using python(x,y) in my windows PC. And I tried to instal satpy module using : "pip install satpy " , but error is there.
Probably I need to install by clonning as Martin suggested via github?

Regards,
Echa

echa desu

unread,
Dec 7, 2016, 12:07:10 AM12/7/16
to pytroll
Hi Balthasar,

my .hsd data in compressed in .bz2. So I decompress it into *.DAT

then I tried to use your suggested code, as following:

=============================

import sys
from datetime import datetime
from datetime import timedelta
import glob
from satpy.scene import Scene

starttime = datetime(2015,8,5,1)

#fnames = glob.glob(".\\HS_H08_20150805_0100_B01_JP01_R10_S0101.DAT")
fnames = glob.glob('.\\HS_H08_%s*' % (starttime.strftime('%Y%m%d_%H%M')))
print fnames


scn = Scene(
        sensor='ahi',
        start_time = starttime,
        end_time = starttime + timedelta(seconds=600),
        filenames = fnames
        )
========================================

and when I try to run it in python(x,y), the error was:
=============================================
No handlers could be found for logger "satpy.readers"

Traceback (most recent call last):
  File "D:/04_TIV/05_hoge/hoge3.py", line 17, in <module>
    filenames = fnames
  File "D:/04_TIV/05_hoge\satpy\scene.py", line 125, in __init__
    filenames=filenames)
  File "D:/04_TIV/05_hoge\satpy\readers\__init__.py", line 318, in __call__
    raise ValueError("No supported files found")
ValueError: No supported files found
===============================================

Looking forward to your advice.

Regards,
Echa

Balthasar Indermuehle

unread,
Dec 7, 2016, 12:32:19 AM12/7/16
to pyt...@googlegroups.com
Hi,

that's a problem I just ran into myself the other day. It has to do
with where satpy thinks its configuration is stored. I fixed it by
adding this to the scene object:

ppp_config_dir = "/home/ubuntu/.local/etc/"

you obviously have to substitute /home/ubuntu with your own user's path.

Cheers

- Balthasar

echa desu

unread,
Dec 7, 2016, 2:03:10 AM12/7/16
to pytroll
Thank you for the reply, Balthasar.

Actually I could not install the satpy module properly in my python(x,y), even I ran : "python setup.py install"

so I just copied the satpy folder (from satpy-master folder downloaded from github), into my working folder, and modified the code into following, according to your advice.

=============

import sys
from datetime import datetime
from datetime import timedelta
import glob
from satpy.scene import Scene

starttime = datetime(2015,8,5,1)

#fnames = glob.glob(".\\HS_H08_20150805_0100_B01_JP01_R10_S0101.DAT")
fnames = glob.glob('.\\HS_H08_%s*' % (starttime.strftime('%Y%m%d_%H%M')))
print fnames

scn = Scene(
        sensor='ahi',
        start_time = starttime,
        end_time = starttime + timedelta(seconds=600),
        filenames = fnames,
        ppp_config_dir = "D:\\04_TIV\\05_hoge\\satpy-master\\etc"
        )

=============

the error message, now becomes:

-----------
WARNING:satpy.readers.yaml_reader:No filenames found for reader: ahi_hsd
WARNING:satpy.readers:Don't know how to open the following files: set(['.\\HS_H08_20150805_0100_B01_JP01_R10_S0101.DAT'])


Traceback (most recent call last):
  File "D:/04_TIV/05_hoge/hoge3.py", line 20, in <module>
    ppp_config_dir = "D:\\04_TIV\\05_hoge\\satpy-master\\etc"

  File "D:/04_TIV/05_hoge\satpy\scene.py", line 125, in __init__
    filenames=filenames)
  File "D:/04_TIV/05_hoge\satpy\readers\__init__.py", line 320, in __call__

    raise ValueError("No supported files found")
ValueError: No supported files found

----------

Thank you,

Regards,
Echa

Balthasar Indermuehle

unread,
Dec 7, 2016, 2:08:04 AM12/7/16
to pyt...@googlegroups.com
I guess one question is does D:\\04_TIV\\05_hoge\\satpy-master\\etc
exist? and if so, what's in it? However, you are on windows, I'm sorry
I have no experience whatsoever running python/satpy on that platform.

Cheers

- Balthasar

echa desu

unread,
Dec 7, 2016, 3:42:47 AM12/7/16
to pytroll
Yes, the folder is exist. And that folder (satpy-master) is the satpy files folder which is downloaded from github.

Erm,..maybe I need to install properly the satpy? instead of just copying the file into working folder.

Or, if you do not mind...could you please provide me the folder consisting of needed satpy modules? so I just copy it into my working folder (D:\\04_TIV\\05_hoge).

Thank you in advance

Regards,
Echa

echa desu

unread,
Dec 7, 2016, 4:58:44 AM12/7/16
to pytroll
Dear Martin and Balthasar,

Thank you for the advice.

I figured out the problems.

1. Even though I can not install using setup.py --> I just copy the folder from github into my working folder
2. add ppp_config_dir in scene object as Balthasar suggested
3. the sample code from Balthasar can make true color for fuldisk data. To apply it for another data area (like japan area and landmark area), maybe I need to adjust or set the 'area'?? such as " HS_H08_20150805_0110_B01_JP01_R10_S0101.DAT "
4. my pc runs out of memory when creating true color image for fulldisk ( I am using python(x,y) on windows), nevertheless I am able to create png image for one segment (among 10 segments of fulldisk data)

Again, thank you very much guys, for your kind helps and advises. I am now looking for the way how to calculate solar and satellite zenith angle based on information in .hsd data.

Best regards,
Echa

Balthasar Indermuehle

unread,
Dec 7, 2016, 5:09:55 AM12/7/16
to pyt...@googlegroups.com
It takes about 9GB of RAM on my machine to make a full disk image.

To make an image of only a region, you have to use a region defintion.
Example (my region is called MRO):

mro_def = utils.load_area('/home/ubuntu/bin/areas.def', 'MRO')

then you have to resample the scene you want to plot to your region definition:

mro_scn = scn.resample(mro_def)

then you apply your imaging requests to that scene object:

mro_scn.load(['true_color_raw'])

the region definition in areas.def looks like this:

+proj=merc +lat_0=-26.5 +lon_0=116.0 +ellps=WGS84
REGION: MRO {
NAME: MRO
PCS_ID: merc_116.0_-26.5
PCS_DEF: proj=merc,lat_0=-26.5,lon_0=116.0,ellps=WGS84
XSIZE: 890
YSIZE: 866
AREA_EXTENT: (-445277.96317309776, -3482189.085408616,
445277.96317308926, -2615329.640607556)
};

There are many pre-defined regions in def files included, but you can
easily make your own using mpop (you have to find and install mpop, I
think its pip install mpop... but not sure) then simply run:

python ~/mpop/utils/coord2area_def.py MRO merc -29 -22 112 120 1

where the parameters are: lower left latitude, upper right latitude,
lower left longitude, upper right longitude, and the last parameter is
the resolution in km/pixel

this makes the AREA_EXTENT: (-445277.96317309776,
-3354934.9252385288, 445277.96317308926, -2495525.393664017)

you can then stick into the REGION definition in your areas.def file.

Hope this helps.

Cheers

- Balthasar

echa desu

unread,
Dec 7, 2016, 11:03:20 AM12/7/16
to pytroll
Thank you.

mro_def = utils.load_area('/home/ubuntu/
bin/areas.def', 'MRO')

where is the module for :" utils.load_area" ? it belongs to satpy.readers ??

best,
echa

echa desu

unread,
Dec 7, 2016, 11:26:36 AM12/7/16
to pytroll
and also for "resample" , is it the function in scene.py?

update: I import utils from pyresample, but still no idea for : mro_scn  = scn.resample(mro_def)


Martin Raspaud

unread,
Dec 8, 2016, 2:43:20 AM12/8/16
to pytroll
Hi echa,

I just made a new release for satpy which should solve the ppp_config_dir problem.

Regarding resampling: to get an area, you can indeed use pyresample. Then should be able to resample as Balthazar said. What error do you get when you try that ?

Best regards,
Martin

echa desu

unread,
Dec 8, 2016, 8:17:28 AM12/8/16
to pytroll
Hi Martin,

Thanks for the reply.

I made following script:
----------------------------------------------------

import sys
from datetime import datetime
from datetime import timedelta
import glob
from satpy.scene import Scene
import pyresample as pr

starttime = datetime(2015,1,25,2,30)

#hsd file hrs sudah di decompress

fnames = glob.glob('.\\HS_H08_%s*' % (starttime.strftime('%Y%m%d_%H%M')))
print fnames

scn = Scene(
        sensor='ahi',
        start_time = starttime,
        end_time = starttime + timedelta(seconds=600),
        filenames = fnames,
        ppp_config_dir = "D:\\04_TIV\\05_hoge\\01_read_hsd\\satpy\\etc"
        )

aus_def = pr.utils.load_area('D:\\04_TIV\\05_hoge\\01_read_hsd\\satpy\\etc\\areas.def', 'australia')
aus_scn  = scn.resample(aus_def)

#print "LOAD  >>>>>>>>>>>>>>>>>>>>"
aus_scn.load(['true_color_raw'])

# instead of resample, just shrink:

'''
print "RESIZE  >>>>>>>>>>>>>>>>>>>>"
scn['B03'] = scn['B03'][::2, ::2]
scn['B03'].info['area'] = scn['B01'].info['area']


print "COMPUTE  >>>>>>>>>>>>>>>>>>>>"
scn.compute()

print "SAVE  >>>>>>>>>>>>>>>>>>>>"

# save the un-resampled version as well:
jptime = starttime + timedelta(hours=9)
scn.save_dataset('true_color_raw', 'hima8%s00fd.png' %jptime.strftime('%Y%m%d_%H%M'))
'''

---------------------------------------------

and i get this error:

Traceback (most recent call last):
  File "D:/04_TIV/05_hoge/01_read_hsd/02_hoge_trueColor_area.py", line 26, in <module>
    aus_scn.load(['true_color_raw'])
  File "D:/04_TIV/05_hoge/01_read_hsd\satpy\scene.py", line 604, in load
    **kwargs)
  File "D:/04_TIV/05_hoge/01_read_hsd\satpy\scene.py", line 489, in read
    return self.read_from_deptree(dataset_keys, **kwargs)
  File "D:/04_TIV/05_hoge/01_read_hsd\satpy\scene.py", line 484, in read_from_deptree
    tree = self.create_deptree(dataset_keys)
  File "D:/04_TIV/05_hoge/01_read_hsd\satpy\scene.py", line 364, in create_deptree
    tree.add_child(self._find_dependencies(key))
  File "D:/04_TIV/05_hoge/01_read_hsd\satpy\scene.py", line 336, in _find_dependencies
    (str(dataset_key), str(err)))
KeyError: "Can't find anything called true_color_raw: "


Thanks,
echa
Reply all
Reply to author
Forward
0 new messages