MickaelRigault / skysurvey

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

Survey should accept a single region and propogate to the fields #5

Open mcoughlin opened 2 years ago

mcoughlin commented 2 years ago

I think survey should take a "region" or similar argument that propagates that region (or Moc) or whatever to the fields with a given field center, i.e. how we do it here:

https://github.com/skyportal/skyportal/blob/main/skyportal/handlers/api/instrument.py#L740

MickaelRigault commented 2 years ago

The following is already inplemented:

import pandas
from skysurvey import survey

pointing = [{"fieldid":450, "mjd":56000, "band":"ztfr", "skynoise":2, "gain":1, "zp":25},
            {"fieldid":541, "mjd":56000, "band":"ztfr", "skynoise":2, "gain":1, "zp":25}]
pointing = pandas.DataFrame(pointings)

s = survey.Survey.from_pointings(pointing, 
    fieds={450:"box(50,30, 3,4,0)", 541:"ellipse(190,-10,1.5,1,50)"})

fields here are "region" strings, but you could also provide a "Region" object (or any shapely object)

mcoughlin commented 2 years ago

@MickaelRigault i guess what I mean is just providing the shape once and letting the code figure out how they propagate based on the field centers.

MickaelRigault commented 2 years ago

Ah, I see.

Would you like to provide centroid_list plus field_shape at while loading the survey or you think you don't know yet the centroid while loading and provide the centroid_list later on ?

mcoughlin commented 2 years ago

I think we should let the user provide a list of fields (a la ZTF) and the region and it knows how to make the field list.

mcoughlin commented 1 year ago

@MickaelRigault Sorry I completely lost track of this, did this happen?