Giter VIP home page Giter VIP logo

cloud-free-scene-counts's People

Contributors

cgmorton avatar cpearson1 avatar mattyrb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cloud-free-scene-counts's Issues

Add ID type command line argument to make_quicklook_lists.py

To help support switching to using the full Landsat product ID (instead of scene ID) (see #5) , I think it would be useful to first add a command line argument to the make_quicklook_lists.py script so that the user can control which type of ID is used in the output files. This could be done with separate "--product_id"/"--scene_id" flags or something like "--id product"/"--id scene". We could initially default the script to returning the scene ID if not set, and then switch to product ID later on.

The WRS_PATH field doesn't exist in the CSV; erroneous

After filtering the metadata csv files for year 2014 pr 041r027,p041r028 then running make_quicklook_lists.py, the program errors. I removed the LANDSAT_TM_C.csv file (not filtered; "No data for target years(s), skipping file"), and it ran.

extra column in usecols_dtype

Looks like Pandas wasn't finding 'LANDSAT_SCENE_ID' in the csv.

I got this to run by commenting out scene_id_col:

dtype_cols = {
    acq_date_col: object,
    browse_col: object,
    browse_url_col: object,
    col_number_col: object,
    col_category_col: object,
    cloud_col: float,
    data_type_col: object,
    product_id_col: object,
    # scene_id_col: object,
    sensor_col: object,
    time_col: object,
    wrs2_path_col: int,
    wrs2_row_col: int,
    # elevation_col: float,
    # azimuth_col: float,
}

See traceback:

C:\cloud-free-scene-counts>python metadata_csv_filter.py -y 2015 -pr p041r027 -d

Filter/reducing Landsat Metadata CSV files
['acquisitionDate', 'browseAvailable', 'browseURL', 'CLOUD_COVER_LAND', 'COLLECTION_CATEGORY', 'COLLECTION_NUMBER', 'DATA_TYPE_L1', 'LANDSAT_PRODUCT_ID', 'LANDSAT_SCENE_ID', 'sensor', 'sceneStartTime', 'path', 'row']
Paths: 41
Rows: 27
WRS2 Tiles: p041r027
LANDSAT_8_C1.csv
Filtering by chunk
Traceback (most recent call last):
File "metadata_csv_filter.py", line 495, in
years=args.years, months=args.months, conus_flag=args.conus)
File "metadata_csv_filter.py", line 301, in main
usecols=list(dtype_cols.keys()), dtype=dtype_cols)):
File "C:\Users\justclickok\anaconda3\lib\site-packages\pandas\io\parsers.py", line 678, in parser_f
return _read(filepath_or_buffer, kwds)
File "C:\Users\justclickok\anaconda3\lib\site-packages\pandas\io\parsers.py", line 440, in _read
parser = TextFileReader(filepath_or_buffer, **kwds)
File "C:\Users\justclickok\anaconda3\lib\site-packages\pandas\io\parsers.py", line 787, in init
self._make_engine(self.engine)
File "C:\Users\justclickok\anaconda3\lib\site-packages\pandas\io\parsers.py", line 1014, in _make_engine
self._engine = CParserWrapper(self.f, **self.options)
File "C:\Users\justclickok\anaconda3\lib\site-packages\pandas\io\parsers.py", line 1749, in init
_validate_usecols_names(usecols, self.orig_names)
File "C:\Users\justclickok\anaconda3\lib\site-packages\pandas\io\parsers.py", line 1134, in _validate_usecols_names
"columns expected but not found: {missing}".format(missing=missing)
ValueError: Usecols do not match columns, columns expected but not found: ['LANDSAT_SCENE_ID']

metadata_quicklook_download.py

Script doesn't look for csv metadata files with the "_filter" suffix. It'd be better if the script looked for filtered lists by default (maybe to the extent that the code would skip unfiltered csv files).

make_quicklook_list.py not counting first clear scene each year

When I run make_quicklook_list.py and output clear_scene_counts.txt it consistently misses counting the first clear scene of each year, but counts the remaining scenes for the path_row and year.

I'm not sure if it has to do with how the counts = defaultdict(dict) is structured (line 142), or the try and except routine (lines 148-151).

Any tips on getting this to work correctly?

error

I tried running the first batch of code and ran into some issues (python metadata_csv_download.py). The errors are listed bellow. I downloaded Anaconda per the instructions and am using Jupyter QtConsole to run the code.

SystemExit Traceback (most recent call last)
in ()
136
137 if name == 'main':
--> 138 args = arg_parse()
139
140 logging.basicConfig(level=args.loglevel, format='%(message)s')

in arg_parse()
126 '-d', '--debug', default=logging.INFO, const=logging.DEBUG,
127 help='Debug level logging', action='store_const', dest='loglevel')
--> 128 args = parser.parse_args()
129
130 if args.csv and os.path.isfile(os.path.abspath(args.csv)):

C:\ProgramData\Anaconda3_\lib\argparse.py in parse_args(self, args, namespace)
1731 if argv:
1732 msg = _('unrecognized arguments: %s')
-> 1733 self.error(msg % ' '.join(argv))
1734 return args
1735

C:\ProgramData\Anaconda3_\lib\argparse.py in error(self, message)
2387 self.print_usage(_sys.stderr)
2388 args = {'prog': self.prog, 'message': message}
-> 2389 self.exit(2, _('%(prog)s: error: %(message)s\n') % args)

C:\ProgramData\Anaconda3_\lib\argparse.py in exit(self, status, message)
2374 if message:
2375 self._print_message(message, _sys.stderr)
-> 2376 _sys.exit(status)
2377
2378 def error(self, message):

SystemExit: 2

browseURL values are invalid

Consider using the full Landsat Collection 1 Product ID as the scene identifier

For consistency, we should consider using the full Landsat Collection 1 Product ID (https://landsat.usgs.gov/sites/default/files/images/Scene_ProductID_compare-.jpg). One benefit of this is that it would be much easier to identify and download the Landsat images from the Google storage bucket since the naming would be identical.

One potential problem with doing this is that we could have multiple versions of images on the same date (with different processing dates), which may not be obvious or desirable. Another problem is that the images will not sort by date if the files are named with the product ID since the Landsat type is first.

It would be possible to maintain a lookup file to translate the thumbnail file names to the product IDs.

Input fields of metadata_quicklook_download.py have changed

It seems like some of the input fields have changed in the LANDSAT csv files. For example, the metadata_quicklook_download.py file is looking for the "ACQUISITION_DATE" column in the csv and that column is now "acquisitionDate." Additionally, I wasn't able to find the equivalent of the "WRS2_TILE" column in the new csv files that should have values like "p038r031."

Landsat 7 (and 5?) files can't be filtered

Chris was having a problem and reported it to the USGS. I started looking into this and I am wondering if it is a result of the download station field have extra commas that are not being parsed correctly.

Rename scripts to make it more obvious what each does

I'm thinking something like the following:

  • metadata_csv_api.py -> api_csv_download.py
  • metadata_csv_download.py -> bulk_csv_download.py
  • metadata_csv_filter.py -> bulk_csv_filter.py
  • metadata_quicklook_download.py ->quicklook_download.py

make_quicklook_lists.py can probably stay the same for now.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.