Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
favyen2 committed Dec 19, 2024
1 parent 0f1a7db commit 31421ad
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 39 deletions.
21 changes: 21 additions & 0 deletions rslp/satlas/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,36 @@
This contains training, inference, and post-processing pipelines for the models served
at https://satlas.allen.ai/.

## Marine Infrastructure

Training:

python -m rslp.rslearn_main model fit --config data/satlas/marine_infra/config.yaml

Inference:

python -m rslp.main satlas write_jobs_for_year_months '[[2024, 7]]' MARINE_INFRA 'gs://rslearn-eai/projects/satlas/marine_infra/version-20241212/{year:04d}-{month:02d}/' skylight-proto-1 rslp-job-queue-favyen

Post-processing:

python -m rslp.main satlas merge_points MARINE_INFRA 2024-07 gs://rslearn-eai/projects/satlas/marine_infra/version-20241212/2024-07/ gs://rslearn-eai/projects/satlas/marine_infra/version-20241212/merged/
python -m rslp.main satlas smooth_points MARINE_INFRA 2024-07 gs://rslearn-eai/projects/satlas/marine_infra/version-20241212/merged/ gs://rslearn-eai/projects/satlas/marine_infra/version-20241212/smoothed/
python -m rslp.main satlas publish_points MARINE_INFRA gs://rslearn-eai/projects/satlas/marine_infra/version-20241212/smoothed/ 'marine-default-cluster@v4'

## Wind Turbine

Training:

python -m rslp.rslearn_main model fit --config data/satlas/wind_turbine/config.yaml

Inference:

python -m rslp.main satlas write_jobs_for_year_months '[[2024, 1]]' WIND_TURBINE 'gs://rslearn-eai/projects/satlas/wind_turbine/version-20241210/{year:04d}-{month:02d}/' skylight-proto-1 rslp-job-queue-favyen --days_before 90 --days_after 181

Post-processing:

python -m rslp.main satlas merge_points WIND_TURBINE 2024-01 gs://rslearn-eai/projects/satlas/wind_turbine/version-20241210/2024-01/ gs://rslearn-eai/projects/satlas/wind_turbine/version-20241210/merged/
python -m rslp.main satlas smooth_points WIND_TURBINE 2024-01 gs://rslearn-eai/projects/satlas/wind_turbine/version-20241210/merged/ gs://rslearn-eai/projects/satlas/wind_turbine/version-20241210/smoothed/

Publishing for wind turbine is not supported yet since it needs to be combined with the
detected solar farms and published as "renewable energy" GeoJSON.
39 changes: 0 additions & 39 deletions rslp/satlas/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,61 +144,22 @@ def publish_points(
for fname in available_fnames[-NUM_RECOMPUTE:]:
logger.info("upload %s", str(fname))
local_geojson_fname = os.path.join(tmp_dir, "data.geojson")
# local_shp_prefix = os.path.join(tmp_dir, "shp_data")
# local_kml_fname = os.path.join(tmp_dir, "data.kml")

with fname.open("rb") as src:
with open(local_geojson_fname, "wb") as dst:
shutil.copyfileobj(src, dst)

"""
subprocess.check_call([
'ogr2ogr',
'-F', 'ESRI Shapefile',
'-nlt', 'POINT',
local_shp_prefix + ".shp",
local_geojson_fname,
])
make_shapefile_zip(local_shp_prefix)
subprocess.check_call([
'ogr2ogr',
'-F', 'KML',
local_kml_fname,
local_geojson_fname,
])
"""

fname_prefix = fname.name.split(".")[0]

bucket.upload_file(
local_geojson_fname,
f"outputs/{app_name_on_r2}/{fname_prefix}.geojson",
)
"""
bucket.upload_file(
local_shp_prefix + ".shp.zip",
f"outputs/{app_name_on_r2}/{fname_prefix}.shp.zip",
)
bucket.upload_file(
local_kml_fname,
f"outputs/{app_name_on_r2}/{fname_prefix}.kml",
)
"""
if fname == available_fnames[-1]:
bucket.upload_file(
local_geojson_fname,
f"outputs/{app_name_on_r2}/latest.geojson",
)
"""
bucket.upload_file(
local_shp_prefix + ".shp.zip",
f"outputs/{app_name_on_r2}/latest.shp.zip",
)
bucket.upload_file(
local_kml_fname,
f"outputs/{app_name_on_r2}/latest.kml",
)
"""

update_index(bucket, f"outputs/{app_name_on_r2}/")

Expand Down

0 comments on commit 31421ad

Please sign in to comment.