Skip to content

Commit

Permalink
Add default-null targname field
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdstein committed Aug 29, 2023
1 parent 25db725 commit 19b9005
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion wintertoo/data/observing_request_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"ditherNumber": {"type": "integer", "default": 1},
"ditherStepSize": {"type": "number", "comment": "arcsec", "default": 600.0},
"fieldID": {"type": "integer", "default": 999999999},
"targName": {"type": "string", "comment": "Target name e.g. GW170817"}
"targName": {"type": "string", "comment": "Target name e.g. GW170817", "default": null}
},
"required": [
"obsHistID",
Expand Down
5 changes: 5 additions & 0 deletions wintertoo/models/too.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ class ToORequest(BaseModel):
le=5,
title="Allowed airmass range",
)
target_name: Optional[str] = Field(
title="Target name",
default=None,
examples=["SN2021abc", "GW170817_A", "IC191001A_1"],
)

@field_validator("end_time_mjd")
@classmethod
Expand Down
1 change: 1 addition & 0 deletions wintertoo/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def make_schedule(
"maxAirmass": too.max_airmass,
"ditherNumber": too.n_dither,
"ditherStepSize": too.dither_distance,
"targName": too.target_name,
}
all_entries.append(new)

Expand Down

0 comments on commit 19b9005

Please sign in to comment.