phl-microsat-dpad / image-browser

BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Directory Structure for Files #10

Open benjiao opened 8 years ago

benjiao commented 8 years ago

From @benjiao on November 25, 2015 9:23

Files include:

Here's my proposed structure:

.
+-- images
|   +-- landsat
|       +-- LC81180542015327LGN00
|           +-- LC81180542015327LGN00_THUMB
|           +-- LC81180542015327LGN00_B1
|           +-- LC81180542015327LGN00_B2
|           +-- LC81180542015327LGN00_B3
|       +-- LC81180542015327LGN01
|           +-- LC81180542015327LGN01_THUMB
|           +-- LC81180542015327LGN01_B1
|           +-- LC81180542015327LGN01_B2
|   +-- diwata1
|       +-- D1C81180542015327LGN00
|           +-- D1C81180542015327LGN00_THUMB
|           +-- D1C81180542015327LGN00_B1
|           +-- D1C81180542015327LGN00_B2
|       +-- D1C81180542015327LGN01
|           +-- D1C81180542015327LGN01_THUMB
|           +-- D1C81180542015327LGN01_B1
|           +-- D1C81180542015327LGN01_B2
|           +-- D1C81180542015327LGN01_B4

Landsat API and Libra will depend on the _<band-id> suffix to tell whether a specific band or data product is available for that scene.

Pro's

Con's

Copied from original issue: phl-microsat-dpad/libra#1

benjiao commented 8 years ago
benjiao commented 8 years ago

From @rukku on November 25, 2015 11:8

@benjiao We'll have to consult with project 5 on the types of data products. diwata 1 also has three sensors:

  1. SMI with LCTF
  2. High Precision Telescope
  3. Wide field camera

So that makes for at least three types of images. We still don't have enough information on how the bands would be named etc for the LCTF data, too. Diwata 1 scenes are also irregular so we'll have to devise a naming convention for it, too.

http://landsat.usgs.gov/naming_conventions_scene_identifiers.php

LXSPPPRRRYYYYDDDGSIVV
L = Landsat
X = Sensor
S = Satellite
PPP = WRS path
RRR = WRS row
YYYY = Year
DDD = Julian day of year
GSI = Ground station identifier
VV = Archive version number

Examples:
LC80390222013076EDC00 (Landsat 8 OLI and TIRS)
LO80390222013076EDC00 (Landsat 8 OLI only)
LT80390222013076EDC00 (Landsat 8 TIRS only)
LE70160392004262EDC02 (Landsat 7 ETM+)
LT40170361982320XXX08 (Landsat 4 TM)
LM10170391976031AAA01 (Landsat 1 MSS)

Landsat uses the path/row concept in its scene ids as its scenes are fixed. We'll have to use something else for Diwata. Though we can copy the other concepts.

benjiao commented 8 years ago

@rukku: Wow this is very helpful. I thought the characters after "L" was just a hash.

Re: naming convention for Diwata, I guess it would make sense to make our file structure more insensitive to file names.

We can probably do:

|   +-- landsat
|       +-- LC81180542015327LGN00
|           +-- thumbnail
|               +-- LC81180542015327LGN00_THUMB
|           +-- band1
|               +-- LC81180542015327LGN00_B1
|           +-- band2
|               +-- LC81180542015327LGN00_B2

Where thumbnail, band1, and band2 are keywords recognized by the webapp. This way, the file names they send us can be anything. Also to avoid dependencies.

benjiao commented 8 years ago

To add to my comment above, the link to be stored in our metadata storage will be /landsat/LC81180542015327LGN00. Links to the thumbnails and individual images can be easily derived by the landsat-api clone on the fly.

This way, we won't have to update our metadata storage everytime a dataproduct has been added/computed for a specific scene.

benjiao commented 8 years ago

From @lkpanganiban on November 26, 2015 6:14

So I have done some readings about image storage. It is recommended to store the images to a file system then store the metadata to our database. So naiisip ko yung structure ay may load balancer in front of our image file storage since maglock up yung connevtion kapag nagsimula magdownload si user.

benjiao commented 8 years ago

@lkpanganiban what LB setup do you have in mind? HAProxy? Squid?

That implies we setup multiple identical nodes for the file server kasi. It might affect our initial design for the update service AND double our space requirements. :p

Usually when we setup a download server, we just use Nginx. Maybe you have a better idea. :)

benjiao commented 8 years ago

From @lkpanganiban on November 26, 2015 8:13

okay na yung nginx for hosting our images. since we are going host landsat 8 images usually they are about 700-800mb per scene so kailangan talaga na madami tayo servers for just hosting our data. We can also do links via email. kapag nagrequest ka nang data isend yung download link via email para controlled yung number of downloads natin per day.

benjiao commented 8 years ago

From @lkpanganiban on November 26, 2015 8:35

We can also do that we will just direct our downloads to usgs servers. hehe. :)

benjiao commented 8 years ago

We can also do that we will just direct our downloads to usgs servers. hehe. :)

@lkpanganiban: Hehe. Actually pwede as failover. Wag nalang natin tanggalin yung links to usgs images from the meta. Though mas ok padin kung locally hosted so students and researchers can have faster downloads within campus.

Anyway, I think the best thing to do at this point is to finalize the directory structure so we can start working on the update/download script. Just to recap, we will have to consider the following:

Pacheck nalang ng latest file structure na pinost ko above. :)