[Landsat-pds] Converting MTL.txt to JSON

Layton, Jeff jefflay at amazon.com
Thu Feb 26 07:15:05 PST 2015


Charlie,

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?

Thanks!

Jeff


-----Original Message-----
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

Hi all,

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.

—Charlie


> 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!
>  
> Thanks!
> 
> Jeff
>  
>  
>  
> Dr. Jeff Layton
> Solutions Architect – HPC
> Amazon Web Services
> jefflay at amazon.com
> 678-310-3685
>  
> <LC80361102015008LGN00_MTL.txt><testfile>_______________________________________________
> Landsat-pds mailing list
> Landsat-pds at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/landsat-pds

_______________________________________________
Landsat-pds mailing list
Landsat-pds at lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/landsat-pds


More information about the Landsat-pds mailing list