stage pekel water map#19
Conversation
seongsujeong
left a comment
There was a problem hiding this comment.
Thanks for adding the script to stage the water map. Here are my comments, suggestions, and questions - Seongsu
| # [TODO] need to update the bucket | ||
| """Name of the default S3 bucket containing the full JRC Pikel's water map to crop from. | ||
| """ | ||
| S3_REF_WATER_BUCKET = "opera-reference-water" |
There was a problem hiding this comment.
The commands below did not work for me. Can you provide me about more info about accessing the bucket?
aws s3 ls s3://opera-reference-water/
aws s3 ls --no-sign-request s3://opera-reference-water/
| List of shapely polygons | ||
| epsgs: list, str | ||
| List of EPSG codes corresponding to | ||
| elements in polys |
There was a problem hiding this comment.
Please add description for the return variable poly
| """Transform coordinates of polys (list of polygons) | ||
| to target epsgs (list of EPSG codes) | ||
|
|
||
| Parameters: |
There was a problem hiding this comment.
| Parameters: | |
| Parameters |
| def get_geo_polygon(ref_tif): | ||
| """Get polygon from GeoTiff image | ||
|
|
||
| Parameters: |
There was a problem hiding this comment.
| Parameters: | |
| Parameters |
| ref_tif: str | ||
| Path to RTC product to stage the pekel's water map | ||
|
|
||
| Returns: |
There was a problem hiding this comment.
| Returns: | |
| Returns |
| formatter_class=argparse.ArgumentDefaultsHelpFormatter | ||
| ) | ||
| parser.add_argument('-p', '--product', type=str, action='store', | ||
| help='Input reference RTC HDF5 product') |
There was a problem hiding this comment.
I could be wrong, but it seems the function has changed to take in RTC GEOTIFF product to compute the polygon. Can you check?
| Longitude margin as a result of the conversion | ||
| ''' | ||
| delta_lon = (180 * 1000 * margin_in_km / | ||
| (np.pi * EARTH_RADIUS * np.cos(np.pi * lat / 180))) |
There was a problem hiding this comment.
what is going to happen when lat is 90.0 or very close to 90.0?
| else: | ||
| logger.info(f"{url} not found") | ||
| counter += 1 | ||
| else: |
There was a problem hiding this comment.
Based on what I see in here and check_aws_connection(),It looks like the code would only work with the google public storage. No need to add the functionality to make it work with S3 bucket, but wanted to check with you.
|
Couple of findings when testing the code:
|
This PR adds the new python script staging Pekel occurrence or seasonality map for given input coordinates.
Usage :
stage_pekel_water.py -b 177.38 -19.62 -178.88 -17.34 -s googleapi