[Shake-dev] Orientation of the shake_result.hdf IMTS grids?

Hearne, Mike mhearne at usgs.gov
Tue Sep 17 22:08:05 UTC 2019


Tim - We organized the image arrays in the HDF such that the CENTER of
the upper left hand corner of the data (row index 0, column index 0),
should correspond with the xmin, ymax values. This means that you can
calculate the lat/lon values of any row/col combination by using an
algorithm as demonstrated in the following code:

https://github.com/usgs/MapIO/blob/master/mapio/geodict.py#L546

If you have any further questions, please feel free to contact me directly.

--Mike

On Mon, Sep 16, 2019 at 10:33 PM <timbeale at catalyst.net.nz> wrote:
>
> Hi,
>
> I'm trying to read the shakemap imts data directly from a
> shake_result.hdf file and I'm just a little unsure what lat/long
> co-ordinates the 0,0 dataset index refers to. I.e. does the dataset
> start from upper-left or lower-left or something else?
>
> I'm trying to read a grid dataset like this:
>
> DATASET "/arrays/imts/GREATER_OF_TWO_HORIZONTAL/PGA/mean" {
>     DATATYPE  H5T_IEEE_F64LE
>     DATASPACE  SIMPLE { ( 217, 303 ) / ( 217, 303 ) }
>     DATA {
>     (0,0): -5.84422, -5.83708, -5.82995, -5.82284, -5.81574, -5.80865,
> ...
>
> I can see the metadata attributes for xmin, xmax, ymin, ymax, which tell
> me the lat/long grid that the dataset is in. But what lat/long
> co-ordinates does dataset index 0,0 correspond to - is it xmin, ymin? I
> saw some references to 'upper left' (i.e. xmin, ymax) in the python code
> (e.g. geodict.py getRowCol()) which confused me.
>
> Unfortunately I need to work in another language, so I can't use the
> MapIO python code to read the file. I tried to read through the Python
> code to work this out, but I got a little lost.
>
> If someone could confirm where the dataset index starts from, that would
> be a big help.
>
> Thanks,
> Tim
> _______________________________________________
> Shake-dev mailing list
> Shake-dev at geohazards.usgs.gov
> https://geohazards.usgs.gov/mailman/listinfo/shake-dev


More information about the Shake-dev mailing list