MickaelRigault / skysurvey

Simulate transients within the sky
Apache License 2.0
9 stars 7 forks source link

skysurvey footprint #8

Open mcoughlin opened 1 year ago

mcoughlin commented 1 year ago

The footprint is quite restrictive in terms of options. Circle and Rectangles should be allowed. https://github.com/skyportal/skyportal/blob/main/skyportal/handlers/api/instrument.py#L164 Also I think either a single Polygon or a list of Polygons (as required by ZTF) should also be allowed.

if type(verts_or_polygon) == geometry.Polygon: # polygon
    as_polygon = True
    fra, fdec = np.asarray(verts_or_polygon.exterior.xy)
else:
    as_polygon = False
    fra, fdec = np.asarray(verts_or_polygon)
mcoughlin commented 1 year ago

On a similar note, I think PolygonSkyRegion should also be allowed. Getting the vertices is relatively straightforward: https://github.com/skyportal/skyportal/blob/main/skyportal/handlers/api/instrument.py#L1119

MickaelRigault commented 1 year ago

I 100% agree.

Working on it.

MickaelRigault commented 1 year ago

@mcoughlin This function is part of ztffields.

I'll add the issue there (keeping this one open until solved)

MickaelRigault commented 1 year ago

https://github.com/MickaelRigault/ztffields/issues/1