@@ -1132,52 +1132,6 @@ def help(self, cache=True):
1132
1132
print ("Alma.query(payload=dict(project_code='2017.1.01355.L', "
1133
1133
"source_name_alma='G008.67'))" )
1134
1134
1135
- def _json_summary_to_table (self , data , base_url ):
1136
- """
1137
- Special tool to convert some JSON metadata to a table Obsolete as of
1138
- March 2020 - should be removed along with stage_data_prefeb2020
1139
- """
1140
- from ..utils import url_helpers
1141
- columns = {'mous_uid' : [], 'URL' : [], 'size' : []}
1142
- for entry in data ['node_data' ]:
1143
- # de_type can be useful (e.g., MOUS), but it is not necessarily
1144
- # specified
1145
- # file_name and file_key *must* be specified.
1146
- is_file = \
1147
- (entry ['file_name' ] != 'null' and entry ['file_key' ] != 'null' )
1148
- if is_file :
1149
- # "de_name": "ALMA+uid://A001/X122/X35e",
1150
- columns ['mous_uid' ].append (entry ['de_name' ][5 :])
1151
- if entry ['file_size' ] == 'null' :
1152
- columns ['size' ].append (np .nan * u .Gbyte )
1153
- else :
1154
- columns ['size' ].append (
1155
- (int (entry ['file_size' ]) * u .B ).to (u .Gbyte ))
1156
- # example template for constructing url:
1157
- # https://almascience.eso.org/dataPortal/requests/keflavich/940238268/ALMA/
1158
- # uid___A002_X9d6f4c_X154/2013.1.00546.S_uid___A002_X9d6f4c_X154.asdm.sdm.tar
1159
- # above is WRONG... except for ASDMs, when it's right
1160
- # should be:
1161
- # 2013.1.00546.S_uid___A002_X9d6f4c_X154.asdm.sdm.tar/2013.1.00546.S_uid___A002_X9d6f4c_X154.asdm.sdm.tar
1162
- #
1163
- # apparently ASDMs are different from others:
1164
- # templates:
1165
- # https://almascience.eso.org/dataPortal/requests/keflavich/946895898/ALMA/
1166
- # 2013.1.00308.S_uid___A001_X196_X93_001_of_001.tar/2013.1.00308.S_uid___A001_X196_X93_001_of_001.tar
1167
- # uid___A002_X9ee74a_X26f0/2013.1.00308.S_uid___A002_X9ee74a_X26f0.asdm.sdm.tar
1168
- url = url_helpers .join (base_url ,
1169
- entry ['file_key' ],
1170
- entry ['file_name' ])
1171
- if 'null' in url :
1172
- raise ValueError ("The URL {0} was created containing "
1173
- "'null', which is invalid." .format (url ))
1174
- columns ['URL' ].append (url )
1175
-
1176
- columns ['size' ] = u .Quantity (columns ['size' ], u .Gbyte )
1177
-
1178
- tbl = Table ([Column (name = k , data = v ) for k , v in columns .items ()])
1179
- return tbl
1180
-
1181
1135
def get_project_metadata (self , projectid , * , cache = True ):
1182
1136
"""
1183
1137
Get the metadata - specifically, the project abstract - for a given project ID.
0 commit comments