This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parser.add_argument("--fk", help="add the fk prefix on processing?", | |
default=False, | |
action='store_true') | |
args = parser.parse_args() | |
if args.fk: | |
# do something. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import struct | |
mpc_line = " ANONN01* C2013 11 01.30171 01 24 29.830+11 52 12.04 22.9 r 568" | |
mpc_format = '0s5s7s1s1s1s17s12s12s9x5s1s6x3s' | |
mpc_record = struct.unpack(mpc_format, mpc_line)) | |
print mpc_record |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def smoka_datarequest(frame_ids): | |
""" | |
Make a datarequest given a SMOKA frame id. | |
This is method is in here as an exmple for datalink service to follow. | |
:param frame_ids: list of frames to retrieve | |
:type frame_ids: list | |
:return: The content of the resulting POST to the smoka datarequest service. | |
""" | |
endpoint = """http://smoka.nao.ac.jp/datarequest""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_suprimecam_mosaic_preview(frame_id="SUPA0010598X"): | |
""" | |
Retrieve a PNG mosiac preview from the SMOKA site | |
:param date: | |
:param frame_id: | |
:return: | |
""" | |
endpoint = "http://smoka.nao.ac.jp/qlis/ImagePNG" | |
frame_id = frame_id.replace("X", "0") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
points = [] | |
vertices = [] | |
segment_type = SegmentType['MOVE'] | |
for x, y in ([0, 0], [1, 0], [1, 1], [0, 1 ]): | |
V = w.all_pix2world(x*header['naxis1'], y*header['naxis2'], 1, 1, 1) | |
points.append(Point(float(V[0]), float(V[1]))) | |
vertices.append(Vertex(float(V[0]), float(V[1]), segment_type)) | |
segment_type = SegmentType['LINE'] |