[Landsat-pds] Converting MTL.txt to JSON
jefflay at amazon.com
Thu Feb 26 07:15:05 PST 2015
Right now the script just reads the MTL file as a string and writes it the exact same way it reads it. We can convert the string to a number, then change how we write it but it will take a little work. My suggestion is to write out the JSON file exactly as the MTL file is written so they match and there's no difference between the two. Does this work?
From: landsat-pds-bounces at lists.osgeo.org [mailto:landsat-pds-bounces at lists.osgeo.org] On Behalf Of Charlie Loyd
Sent: Wednesday, February 25, 2015 5:46 PM
To: landsat-pds at lists.osgeo.org
Subject: Re: [Landsat-pds] Converting MTL.txt to JSON
Hurray, JSON! Thanks, Jeff!
It’s just a detail, but should the numeric values be converted to numbers? For example, this line of JSON:
> "REFLECTANCE_MULT_BAND_9": "2.0000E-05",
could be replaced by:
> "REFLECTANCE_MULT_BAND_9": 2e-05,
This would mean one less conversion-and-check necessary on the end user’s side in order to use the value.
I won’t push on this – it’s a very small thing and it might add complexity in ways I’m not seeing. Just asking.
> On Feb 25, 2015, at 1:13 PM, Layton, Jeff <jefflay at amazon.com> wrote:
> Hello everyone,
> I just joined the mailing list and I’m working with Jed from AWS (I work for AWS as well). The first project I did was write a simple Python tool to convert the MTL.txt files to JSON. I’m attaching a sample MTL file and the resulting JSON. Let me know what you think!
> Dr. Jeff Layton
> Solutions Architect – HPC
> Amazon Web Services
> jefflay at amazon.com
> Landsat-pds mailing list
> Landsat-pds at lists.osgeo.org
Landsat-pds mailing list
Landsat-pds at lists.osgeo.org
More information about the Landsat-pds